com.vaadin.data.util.
Class GeneratedPropertyContainer.GeneratedProperty<T>
- java.lang.Object
-
- com.vaadin.data.util.GeneratedPropertyContainer.GeneratedProperty<T>
-
All Implemented Interfaces:
Property<T>
,Serializable
Enclosing class:
protected static class GeneratedPropertyContainer.GeneratedProperty<T> extends Object implements Property<T>
Property implementation for generated properties
See Also:
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.data.Property
Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeEvent, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeEvent, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer
-
-
Constructor Summary
Constructors Constructor Description GeneratedProperty(Item item, Object propertyId, Object itemId, PropertyValueGenerator<T> generator)
-
Method Summary
All Methods Modifier and Type Method Description Class<? extends T>
getType()
Returns the type of the Property.
T
getValue()
Gets the value stored in the Property.
boolean
isReadOnly()
Tests if the Property is in read-only mode.
void
setReadOnly(boolean newStatus)
Sets the Property's read-only mode to the specified status.
void
setValue(T newValue)
Sets the value of the Property.
-
-
-
Constructor Detail
-
GeneratedProperty
public GeneratedProperty(Item item, Object propertyId, Object itemId, PropertyValueGenerator<T> generator)
-
-
Method Detail
-
getValue
public T getValue()
Description copied from interface:
Property
Gets the value stored in the Property. The returned object is compatible with the class returned by getType().
-
setValue
public void setValue(T newValue) throws Property.ReadOnlyException
Description copied from interface:
Property
Sets the value of the Property.
Implementing this functionality is optional. If the functionality is missing, one should declare the Property to be in read-only mode and throw
Note : Since Vaadin 7.0, setting the value of a non-String property as a String is no longer supported.Property.ReadOnlyException
in this function.Specified by:
setValue
in interfaceProperty<T>
Parameters:
newValue
- New value of the Property. This should be assignable to the type returned by getTypeThrows:
Property.ReadOnlyException
- if the object is in read-only mode
-
getType
public Class<? extends T> getType()
Description copied from interface:
Property
Returns the type of the Property. The methods
getValue
andsetValue
must be compatible with this type: one must be able to safely cast the value returned fromgetValue
to the given type and pass any variable assignable to this type as an argument tosetValue
.
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:
Property
Tests if the Property is in read-only mode. In read-only mode calls to the method
setValue
will throwReadOnlyException
and will not modify the value of the Property.Specified by:
isReadOnly
in interfaceProperty<T>
Returns:
true
if the Property is in read-only mode,false
if it's not
-
setReadOnly
public void setReadOnly(boolean newStatus)
Description copied from interface:
Property
Sets the Property's read-only mode to the specified status. This functionality is optional, but all properties must implement the
isReadOnly
mode query correctly.Specified by:
setReadOnly
in interfaceProperty<T>
Parameters:
newStatus
- new read-only status of the Property
-
-