Groovy Documentation

org.grails.plugin.vaadin.utils
[Groovy] Class DefaultValuePropertyConverter

java.lang.Object
  com.vaadin.data.util.AbstractProperty
      org.grails.plugin.vaadin.utils.PropertyConverter
          org.grails.plugin.vaadin.utils.DefaultValuePropertyConverter

@SuppressWarnings("unchecked")
class DefaultValuePropertyConverter
extends PropertyConverter

Does no conversion, but substitutes the specified default value in place of a null, ONLY when getting the value.

As soon as any value is set on the field, the default value ceases to be used from then onwards.

Authors:
Francis McKenzie


Property Summary
def defaultValue

 
Constructor Summary
DefaultValuePropertyConverter(Property propertyDataSource, Object defaultValue)

 
Method Summary
Object convert(Object value)

Substitutes the default value if the specified value is null and the property has not yet been set.

Object restore(Object value)

Doesn't change the value, but notes that the property has now been set and therefore the default value should no longer be used.

 
Methods inherited from class PropertyConverter
convert, getPropertyDataSource, getType, getValue, isReadOnly, readOnlyStatusChange, restore, setPropertyDataSource, setReadOnly, setValue, toString, valueChange
 
Methods inherited from class AbstractProperty
toString, setReadOnly, isReadOnly, getListeners, addListener, addListener, removeListener, removeListener, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll, getValue, getType, setValue
 

Property Detail

defaultValue

def defaultValue


 
Constructor Detail

DefaultValuePropertyConverter

DefaultValuePropertyConverter(Property propertyDataSource, Object defaultValue)


 
Method Detail

convert

@Override
Object convert(Object value)
Substitutes the default value if the specified value is null and the property has not yet been set.


restore

@Override
Object restore(Object value)
Doesn't change the value, but notes that the property has now been set and therefore the default value should no longer be used.


 

Groovy Documentation