T
- public class BasicTransformer<T> extends Object implements Transformer<T>
Transformer
.Modifier and Type | Field and Description |
---|---|
protected String |
basePropertyName |
protected ConfiguredFieldDefinition |
definition |
protected String |
i18NPropertyName
Deprecated.
since 5.4.2 - should not be used any longer, alter
basePropertyName in setLocale(Locale) method if needed. |
protected com.vaadin.data.Item |
relatedFormItem |
protected Class<T> |
type |
Constructor and Description |
---|
BasicTransformer(com.vaadin.data.Item relatedFormItem,
ConfiguredFieldDefinition definition,
Class<T> type)
Deprecated.
since 5.4.2 - use
BasicTransformer(Item, ConfiguredFieldDefinition, Class, I18NAuthoringSupport) instead. |
BasicTransformer(com.vaadin.data.Item relatedFormItem,
ConfiguredFieldDefinition definition,
Class<T> type,
info.magnolia.ui.api.i18n.I18NAuthoringSupport i18NAuthoringSupport) |
Modifier and Type | Method and Description |
---|---|
protected String |
definePropertyName()
Based on the i18n information, define the property name to use.
|
protected String |
deriveLocaleAwareName(String baseName) |
String |
getBasePropertyName() |
protected info.magnolia.ui.api.i18n.I18NAuthoringSupport |
getI18NAuthoringSupport() |
Locale |
getLocale() |
protected <T> com.vaadin.data.Property<T> |
getOrCreateProperty(Class<T> type)
If the desired property (propertyName) already exist in the JcrNodeAdapter, return this property
else create a new Property . |
protected <T> com.vaadin.data.Property<T> |
getOrCreateProperty(Class<T> type,
boolean checkTypes)
If the desired property (propertyName) already exist in the JcrNodeAdapter, return this property
else create a new Property . |
com.vaadin.data.Item |
getRelatedFormItem() |
Class<T> |
getType() |
boolean |
hasI18NSupport()
Return true if this Property has to support i18n.
|
boolean |
isReadOnly() |
T |
readFromItem()
Transform a specific Item values to a specified type T.
|
void |
setI18NPropertyName(String i18nPropertyName) |
void |
setLocale(Locale locale) |
void |
setReadOnly(boolean isReadOnly) |
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. |
void |
writeToItem(T newValue)
Convert the T newValue to a specific Item format.
|
protected final ConfiguredFieldDefinition definition
protected com.vaadin.data.Item relatedFormItem
protected String basePropertyName
@Deprecated protected String i18NPropertyName
basePropertyName
in setLocale(Locale)
method if needed.@Inject public BasicTransformer(com.vaadin.data.Item relatedFormItem, ConfiguredFieldDefinition definition, Class<T> type, info.magnolia.ui.api.i18n.I18NAuthoringSupport i18NAuthoringSupport)
@Deprecated public BasicTransformer(com.vaadin.data.Item relatedFormItem, ConfiguredFieldDefinition definition, Class<T> type)
BasicTransformer(Item, ConfiguredFieldDefinition, Class, I18NAuthoringSupport)
instead.public com.vaadin.data.Item getRelatedFormItem()
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 <T> com.vaadin.data.Property<T> getOrCreateProperty(Class<T> type, boolean checkTypes)
Property
.protected String definePropertyName()
protected info.magnolia.ui.api.i18n.I18NAuthoringSupport getI18NAuthoringSupport()
public void setLocale(Locale locale)
setLocale
in interface info.magnolia.ui.api.i18n.I18NAwareHandler
public void setI18NPropertyName(String i18nPropertyName)
setI18NPropertyName
in interface info.magnolia.ui.api.i18n.I18NAwareHandler
public Locale getLocale()
getLocale
in interface info.magnolia.ui.api.i18n.I18NAwareHandler
public String getBasePropertyName()
getBasePropertyName
in interface info.magnolia.ui.api.i18n.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.public boolean isReadOnly()
isReadOnly
in interface Transformer<T>
public void setReadOnly(boolean isReadOnly)
setReadOnly
in interface Transformer<T>
Copyright © 2016 Magnolia International Ltd.. All rights reserved.