info.magnolia.ui.form.field.transformer.basic
Class ListToSetTransformer<T>
java.lang.Object
info.magnolia.ui.form.field.transformer.basic.BasicTransformer<T>
info.magnolia.ui.form.field.transformer.basic.ListToSetTransformer<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
- info.magnolia.ui.api.i18n.I18NAwareHandler, Transformer<T>
public class ListToSetTransformer<T>
- extends BasicTransformer<T>
Specific MultiSelect field Transformer
.
For example, the Vaadin native OptionGroup
used as root component of our configured Option Group Field do not support List, but only Sets.
Methods inherited from class info.magnolia.ui.form.field.transformer.basic.BasicTransformer |
definePropertyName, getBasePropertyName, getLocale, getOrCreateProperty, getOrCreateProperty, getRelatedFormItem, getType, hasI18NSupport, setI18NPropertyName, setLocale, setType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ListToSetTransformer
public ListToSetTransformer(com.vaadin.data.Item relatedFormItem,
ConfiguredFieldDefinition definition,
Class<T> type)
writeToItem
public void writeToItem(T newValue)
- Description copied from interface:
Transformer
- Convert the T newValue to a specific Item format.
- Specified by:
writeToItem
in interface Transformer<T>
- Overrides:
writeToItem
in class BasicTransformer<T>
isCollectionConversionNeeded
protected boolean isCollectionConversionNeeded(T newValue,
Class<?> propertyType)
- Check if the newValue has to be transformed from a
Set
to a List
. Set
is used by Vaadin multi fields and multi values are stored as List
in Jcr.
readFromItem
public T readFromItem()
- Description copied from interface:
Transformer
- Transform a specific Item values to a specified type T.
- Specified by:
readFromItem
in interface Transformer<T>
- Overrides:
readFromItem
in class BasicTransformer<T>
Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.