Groovy Documentation

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

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

@SuppressWarnings("unchecked")
protected class ByteArrayPropertyConverter
extends PropertyConverter

Autoboxes an underlying Byte[] to byte[].

Note that if original datasource type is not Byte[], then this class does nothing, just passes through the value unchanged.

Authors:
Francis McKenzie


Constructor Summary
ByteArrayPropertyConverter()

Initialise empty

ByteArrayPropertyConverter(Property propertyDataSource)

Initialise with data source

 
Method Summary
Object convert(Object value)

Converts value to byte[] if is Byte[], otherwise just returns value unchanged

Class getType()

If class of original datasource is Byte[] then returns byte[], else returns original datasource's class unchanged.

Object restore(Object value)

Restores value to Byte[] if is byte[] and underlying datasource type is Byte[], otherwise just returns value unchanged

 
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
 

Constructor Detail

ByteArrayPropertyConverter

ByteArrayPropertyConverter()
Initialise empty


ByteArrayPropertyConverter

ByteArrayPropertyConverter(Property propertyDataSource)
Initialise with data source


 
Method Detail

convert

@Override
Object convert(Object value)
Converts value to byte[] if is Byte[], otherwise just returns value unchanged


getType

@Override
Class getType()
If class of original datasource is Byte[] then returns byte[], else returns original datasource's class unchanged.

If no original datasource is set, then returns byte[]


restore

@Override
Object restore(Object value)
Restores value to Byte[] if is byte[] and underlying datasource type is Byte[], otherwise just returns value unchanged


 

Groovy Documentation