info.magnolia.ui.form.field.transformer.multi
Class MultiValueJSONTransformer

java.lang.Object
  extended by info.magnolia.ui.form.field.transformer.basic.BasicTransformer<com.vaadin.data.util.PropertysetItem>
      extended by info.magnolia.ui.form.field.transformer.multi.MultiValueJSONTransformer
All Implemented Interfaces:
I18NAwareHandler, Transformer<com.vaadin.data.util.PropertysetItem>

public class MultiValueJSONTransformer
extends BasicTransformer<com.vaadin.data.util.PropertysetItem>

SingleProperty implementation of Transformer.
Store the list of values in a single property as a concatenation of string with ',' as separator.
Retrieve the single property as a List of String. This handler is implemented for backward capability with Magnolia 4.x.
As for Magnolia 4.x, the current implementation only support a list of String


Field Summary
 
Fields inherited from class info.magnolia.ui.form.field.transformer.basic.BasicTransformer
basePropertyName, definition, i18NPropertyName, relatedFormItem, type
 
Constructor Summary
MultiValueJSONTransformer(com.vaadin.data.Item relatedFormItem, ConfiguredFieldDefinition definition, Class<com.vaadin.data.util.PropertysetItem> type)
           
 
Method Summary
 com.vaadin.data.util.PropertysetItem readFromItem()
          Transform a specific Item values to a specified type T.
 void writeToItem(com.vaadin.data.util.PropertysetItem newValue)
          Convert the T newValue to a specific Item format.
 
Methods inherited from class info.magnolia.ui.form.field.transformer.basic.BasicTransformer
definePropertyName, getBasePropertyName, getLocale, getOrCreateProperty, getType, hasI18NSupport, setI18NPropertyName, setLocale, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiValueJSONTransformer

@Inject
public MultiValueJSONTransformer(com.vaadin.data.Item relatedFormItem,
                                        ConfiguredFieldDefinition definition,
                                        Class<com.vaadin.data.util.PropertysetItem> type)
Method Detail

writeToItem

public void writeToItem(com.vaadin.data.util.PropertysetItem newValue)
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>


Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.