com.vaadin.data.util.sqlcontainer
Class ColumnProperty

java.lang.Object
  extended by com.vaadin.data.util.sqlcontainer.ColumnProperty
All Implemented Interfaces:
Property, Serializable

public final class ColumnProperty
extends Object
implements Property

ColumnProperty represents the value of one column in a RowItem. In addition to the value, ColumnProperty also contains some basic column attributes such as nullability status, read-only status and data type. Note that depending on the QueryDelegate in use this does not necessarily map into an actual column in a database table.

See Also:
Serialized Form

Nested Class Summary
 class ColumnProperty.NotNullableException
          An exception that signals that a null value was passed to the setValue method, but the value of this property can not be set to null.
 
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
ColumnProperty(String propertyId, boolean readOnly, boolean allowReadOnlyChange, boolean nullable, Object value, Class<?> type)
           
 
Method Summary
 void commit()
           
 String getPropertyId()
           
 Class<?> getType()
          Returns the type of the Property.
 Object getValue()
          Gets the value stored in the Property.
 boolean isModified()
           
 boolean isNullable()
           
 boolean isReadOnly()
          Tests if the Property is in read-only mode.
 boolean isReadOnlyChangeAllowed()
           
 boolean isVersionColumn()
           
 void setOwner(RowItem owner)
           
 void setReadOnly(boolean newStatus)
          Sets the Property's read-only mode to the specified status.
 void setValue(Object newValue)
          Sets the value of the Property.
 void setVersionColumn(boolean versionColumn)
           
 String toString()
          Deprecated. get the string representation from the value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColumnProperty

public ColumnProperty(String propertyId,
                      boolean readOnly,
                      boolean allowReadOnlyChange,
                      boolean nullable,
                      Object value,
                      Class<?> type)
Method Detail

getValue

public Object getValue()
Description copied from interface: Property
Gets the value stored in the Property. The returned object is compatible with the class returned by getType().

Specified by:
getValue in interface Property
Returns:
the value stored in the Property

setValue

public void setValue(Object 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 Property.ReadOnlyException in this function.

Note : Since Vaadin 7.0, setting the value of a non-String property as a String is no longer supported.

Specified by:
setValue in interface Property
Parameters:
newValue - New value of the Property. This should be assignable to the type returned by getType
Throws:
Property.ReadOnlyException - if the object is in read-only mode

getType

public Class<?> getType()
Description copied from interface: Property
Returns the type of the Property. The methods 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.

Specified by:
getType in interface Property
Returns:
type of the Property

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 throw ReadOnlyException and will not modify the value of the Property.

Specified by:
isReadOnly in interface Property
Returns:
true if the Property is in read-only mode, false if it's not

isReadOnlyChangeAllowed

public boolean isReadOnlyChangeAllowed()

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 interface Property
Parameters:
newStatus - new read-only status of the Property

getPropertyId

public String getPropertyId()

toString

@Deprecated
public String toString()
Deprecated. get the string representation from the value

Returns the value of the Property in human readable textual format.

Overrides:
toString in class Object
See Also:
Object.toString()

setOwner

public void setOwner(RowItem owner)

isModified

public boolean isModified()

isVersionColumn

public boolean isVersionColumn()

setVersionColumn

public void setVersionColumn(boolean versionColumn)

isNullable

public boolean isNullable()

commit

public void commit()


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.