|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.ui.form.field.transformer.basic.BasicTransformer<T>
T
- public class BasicTransformer<T>
Basic implementation of a Transformer
.
This handler is used for most of the basic fields (textBox, Date, ...).
His responsibility is to:
- retrieve or create a basic property from the related item
- update the item property value in case of changes performed on the related field.
Field Summary | |
---|---|
protected String |
basePropertyName
|
protected ConfiguredFieldDefinition |
definition
|
protected String |
i18NPropertyName
|
protected com.vaadin.data.Item |
relatedFormItem
|
protected Class<T> |
type
|
Constructor Summary | |
---|---|
BasicTransformer(com.vaadin.data.Item relatedFormItem,
ConfiguredFieldDefinition definition,
Class<T> type)
|
Method Summary | ||
---|---|---|
protected String |
definePropertyName()
Based on the i18n information, define the property name to use. |
|
String |
getBasePropertyName()
|
|
Locale |
getLocale()
|
|
protected
|
getOrCreateProperty(Class<T> type)
If the desired property (propertyName) already exist in the JcrNodeAdapter, return this property else create a new Property .If the defaultValueString is empty or null, return a typed null value property. |
|
Class<T> |
getType()
|
|
boolean |
hasI18NSupport()
Return true if this Property has to support i18n. |
|
T |
readFromItem()
Transform a specific Item values to a specified type T. |
|
void |
setI18NPropertyName(String i18nPropertyName)
|
|
void |
setLocale(Locale locale)
|
|
protected void |
setType(Class<T> typeFromDefinition)
If the value type is not initialize by the field factory ( UndefinedPropertyType ), check if the property already exist in the Item.If the Item has already this property, return the property value type. Else return the default type 'String' |
|
void |
writeToItem(T newValue)
Convert the T newValue to a specific Item format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected com.vaadin.data.Item relatedFormItem
protected final ConfiguredFieldDefinition definition
protected String basePropertyName
protected String i18NPropertyName
protected Class<T> type
Constructor Detail |
---|
@Inject public BasicTransformer(com.vaadin.data.Item relatedFormItem, ConfiguredFieldDefinition definition, Class<T> type)
Method Detail |
---|
public void writeToItem(T newValue)
Transformer
writeToItem
in interface Transformer<T>
public T readFromItem()
Transformer
readFromItem
in interface Transformer<T>
protected void setType(Class<T> typeFromDefinition)
UndefinedPropertyType
), check if the property already exist in the Item.
protected <T> com.vaadin.data.Property<T> getOrCreateProperty(Class<T> type)
Property
.
T
- protected String definePropertyName()
public void setLocale(Locale locale)
setLocale
in interface I18NAwareHandler
public void setI18NPropertyName(String i18nPropertyName)
setI18NPropertyName
in interface I18NAwareHandler
public Locale getLocale()
getLocale
in interface I18NAwareHandler
public String getBasePropertyName()
getBasePropertyName
in interface I18NAwareHandler
public boolean hasI18NSupport()
Transformer
hasI18NSupport
in interface Transformer<T>
public Class<T> getType()
getType
in interface Transformer<T>
value
must be assignable
to this type.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |