|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.data.util.AbstractProperty
com.vaadin.data.util.NestedMethodProperty
public class NestedMethodProperty
Nested accessor based property for a bean. The property is specified in the dotted notation, e.g. "address.street", and can contain multiple levels of nesting. When accessing the property value, all intermediate getters must return non-null values.
MethodProperty
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class com.vaadin.data.util.AbstractProperty |
---|
AbstractProperty.ReadOnlyStatusChangeEvent |
Nested classes/interfaces inherited from interface com.vaadin.data.Property |
---|
Property.ConversionException, Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
Constructor Summary | |
---|---|
NestedMethodProperty(Object instance,
String propertyName)
Constructs a nested method property for a given object instance. |
Method Summary | |
---|---|
protected List<Method> |
getGetMethods()
Returns an unmodifiable list of getter methods to call in sequence to get the property value. |
Class<?> |
getType()
Returns the type of the Property. |
Object |
getValue()
Gets the value stored in the Property. |
protected void |
invokeSetMethod(Object value)
Internal method to actually call the setter method of the wrapped property. |
boolean |
isReadOnly()
Tests if the Property is in read-only mode. Override for additional restrictions on what is considered a read-only property. |
void |
setValue(Object newValue)
Sets the value of the property. |
Methods inherited from class com.vaadin.data.util.AbstractProperty |
---|
addListener, addListener, fireReadOnlyStatusChange, fireValueChange, getListeners, removeListener, removeListener, setReadOnly, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NestedMethodProperty(Object instance, String propertyName)
instance
- top-level bean to which the property appliespropertyName
- dot separated nested property name
IllegalArgumentException
- if the property name is invalidMethod Detail |
---|
public Class<?> getType()
Property
getValue
and
setValue
must be compatible with this type: one must be able
to safely cast the value returned from getValue
to the given
type and pass any variable assignable to this type as an argument to
setValue
.
public boolean isReadOnly()
AbstractProperty
setValue
will throw
ReadOnlyException
and will not modify the value of the
Property.
Override for additional restrictions on what is considered a read-only
property.
isReadOnly
in interface Property
isReadOnly
in class AbstractProperty
true
if the Property is in read-only mode,
false
if it's notpublic Object getValue()
public void setValue(Object newValue) throws Property.ReadOnlyException, Property.ConversionException
String
s if either String
is directly assignable
to property type, or the type class contains a string constructor.
newValue
- the New value of the property.
Property.ReadOnlyException
- if the object is in
read-only mode.
Property.ConversionException
- if
newValue
can't be converted into the Property's
native type directly or through String
.
Property.ReadOnlyException
- if the object is in read-only mode
Property.ConversionException
- if newValue can't be converted into the Property's native
type directly or through StringinvokeSetMethod(Object)
protected void invokeSetMethod(Object value)
value
- protected List<Method> getGetMethods()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |