Class SingleValueTranslator
java.lang.Object
de.hybris.platform.impex.jalo.translators.AbstractValueTranslator
de.hybris.platform.impex.jalo.translators.SingleValueTranslator
- Direct Known Subclasses:
ActiveDirectoryGroupCollectionTranslator.PrincipalGroupTranslator,AnonymousUserTranslator,AtomicValueTranslator,CampaignSourceRulesTranslator,ClassificationAttributeValueTranslator,DiscountValueTranslator,EClassAttributeTypeTranslator,EClassUnitTranslator,ETIMAttributeTypeTranslator,Europe1RowTranslator,ExtractUserGroupTranslator.UserGroupTranslator,ItemExpressionTranslator,ItemPKTranslator,ProductFeatureValueTranslator,ProfiClassAttributeTypeTranslator,PromotionPriceRowsTranslator.PriceRowTranslator,TaxValueTranslator
Base class of all translator translating single attribute values.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ObjectconvertToJalo(String expr, Item forItem) Converts a non-null and non-empty string into a jalo attribute value.protected abstract StringconvertToString(Object value) Converts a non-null jalo attribute value into its string representation.final StringexportValue(Object value) Translates an attribute value for export usage.protected ObjectThe representation of an empty value this translator uses.final ObjectimportValue(String valueExpr, Item toItem) Translates a tokenized csv value for import usage.protected booleanChecks whether an expression is empty.Methods inherited from class de.hybris.platform.impex.jalo.translators.AbstractValueTranslator
clearStatus, createTranslator, createTranslator, createTranslator, debug, error, getColumnDescriptor, getFlexibleSearch, info, init, isDebugEnabled, isInfoEnabled, setEmpty, setError, validate, warn, wasEmpty, wasUnresolved
-
Constructor Details
-
SingleValueTranslator
public SingleValueTranslator()
-
-
Method Details
-
isEmpty
Checks whether an expression is empty.- Parameters:
expr- expression to check- Returns:
- true if it is recognized as empty, false otherwise
-
getEmptyValue
The representation of an empty value this translator uses.- Returns:
- used null value
-
importValue
Description copied from class:AbstractValueTranslatorTranslates a tokenized csv value for import usage. This means that the result object must be a instance of the expected attribute type.- Specified by:
importValuein classAbstractValueTranslator- Parameters:
valueExpr- expression to translatetoItem- the target item in case it already exist, null otherwise (for partOf attributes!)- Returns:
- Object translated value
- Throws:
JaloInvalidParameterException- value can not be translated with this translator or is invalid
-
exportValue
Description copied from class:AbstractValueTranslatorTranslates an attribute value for export usage. This means the attribute value must be transformed into a string which should be re-importable again.- Specified by:
exportValuein classAbstractValueTranslator- Parameters:
value- value to translate- Returns:
- String translated value
- Throws:
JaloInvalidParameterException- value can not be translated with this translator or is invalid
-
convertToJalo
Converts a non-null and non-empty string into a jalo attribute value.- Parameters:
expr- string to translateforItem- item instance the translated value will be set to as attribute- Returns:
- Object translated value
-
convertToString
Converts a non-null jalo attribute value into its string representation.- Parameters:
value- value to translate- Returns:
- translated value
-