info.magnolia.ui.form.field.transformer.composite
Class CompositeTransformer
java.lang.Object
info.magnolia.ui.form.field.transformer.basic.BasicTransformer<com.vaadin.data.util.PropertysetItem>
info.magnolia.ui.form.field.transformer.composite.CompositeTransformer
- All Implemented Interfaces:
- I18NAwareHandler, Transformer<com.vaadin.data.util.PropertysetItem>
- Direct Known Subclasses:
- SwitchableTransformer
public class CompositeTransformer
- extends BasicTransformer<com.vaadin.data.util.PropertysetItem>
Default composite field Transformer
implementation storing and retrieving properties defined under an Item as PropertysetItem
element.
Storage strategy:
- getValue():
-- iterate the fieldsName property and retrieve all stored property.
-- Fulfill the PropertysetItem
.
- setValue():
-- iterate the incoming PropertysetItem
.
-- if the related parent item do not contain this property, add it.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fieldsName
protected List<String> fieldsName
CompositeTransformer
public CompositeTransformer(com.vaadin.data.Item relatedFormItem,
ConfiguredFieldDefinition definition,
Class<com.vaadin.data.util.PropertysetItem> type,
List<String> fieldsName)
createPropertyPrefix
protected String createPropertyPrefix(ConfiguredFieldDefinition definition)
- Returns:
- propertyPrefix used to prefix the property name.
writeToItem
public void writeToItem(com.vaadin.data.util.PropertysetItem newValues)
- Description copied from interface:
Transformer
- Convert the T newValue to a specific Item format.
- Specified by:
writeToItem
in interface Transformer<com.vaadin.data.util.PropertysetItem>
- Overrides:
writeToItem
in class BasicTransformer<com.vaadin.data.util.PropertysetItem>
readFromItem
public com.vaadin.data.util.PropertysetItem readFromItem()
- Description copied from interface:
Transformer
- Transform a specific Item values to a specified type T.
- Specified by:
readFromItem
in interface Transformer<com.vaadin.data.util.PropertysetItem>
- Overrides:
readFromItem
in class BasicTransformer<com.vaadin.data.util.PropertysetItem>
getCompositePropertyName
protected String getCompositePropertyName(String propertyName)
Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.