Class ClassificationAttributeTranslator
- java.lang.Object
-
- de.hybris.platform.impex.jalo.translators.AbstractSpecialValueTranslator
-
- de.hybris.platform.catalog.jalo.classification.impex.ClassificationAttributeTranslator
-
- All Implemented Interfaces:
NotifiedSpecialValueTranslator,SpecialValueTranslator
- Direct Known Subclasses:
MarketplaceClassificationAttributeTranslator,SapClassificationAttributeAuthorTranslator
public class ClassificationAttributeTranslator extends AbstractSpecialValueTranslator implements NotifiedSpecialValueTranslator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceClassificationAttributeTranslator.Modifiers
-
Field Summary
Fields Modifier and Type Field Description protected PKallDoneForprotected charattributeSeparatorprotected ClassificationAttributeclassAttrprotected ClassAttributeAssignmentclassAttrAssignmentprotected java.lang.StringclassNameprotected ClassificationSystemVersionclassSystemVersionprotected charcollectionDelimiterprotected java.lang.StringcurrentCellValueprotected java.lang.StringdateFormatStringstatic java.lang.StringIMPEX_NONEXISTEND_CLSATTRVALUE_FALLBACK_KEYprotected Languagelangprotected java.util.Localelocaleprotected java.lang.StringnumberFormatStringprotected java.lang.Stringqualfierprotected java.lang.StringsystemNameprotected char[]TO_ESCAPEprotected java.lang.StringversionName
-
Constructor Summary
Constructors Constructor Description ClassificationAttributeTranslator()General no-arg constructorClassificationAttributeTranslator(ClassificationSystemVersion sysVer, ClassificationAttribute attr, char delimiter, Language lang)Testing purpose constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected ClassAttributeAssignmentgetAssignment()protected AbstractValueTranslatorgetFallbackValueTranslator()protected TypedFeaturegetFeature(Product product)protected AbstractValueTranslatorgetSingleCellValueTranslator(ClassAttributeAssignment assignment)protected SessionContextgetValueCtx(boolean localized)voidinit(SpecialColumnDescriptor columnDescriptor)Called once upon header creation to do some initial setup logic.protected ClassAttributeAssignmentmatchAssignment(java.util.Collection<ClassificationClass> classes)voidnotifyTranslationEnd(ValueLine line, HeaderDescriptor header, Item processedItem)Is called if allSpecialValueTranslators used in header have been triggered.java.lang.StringperformExport(Item item)Called each time an item is exported using the enclosing header.voidperformImport(java.lang.String cellValue, Item processedItem)Called each time a non-empty cell value has to be imported.protected java.util.ListsplitValues(ClassAttributeAssignment assignment, java.lang.String valueCollection)java.util.Collection<UnitAwareValue>translateCurrentUnitAwareValues(ValueLine line, ClassAttributeAssignment assignment, Product processedItem)java.util.Collection<java.lang.Object>translateCurrentValues(ValueLine line, ClassAttributeAssignment assignment, Product processedItem)Deprecated.since ages-
Methods inherited from class de.hybris.platform.impex.jalo.translators.AbstractSpecialValueTranslator
isEmpty, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.impex.jalo.translators.SpecialValueTranslator
isEmpty, validate
-
-
-
-
Field Detail
-
IMPEX_NONEXISTEND_CLSATTRVALUE_FALLBACK_KEY
public static final java.lang.String IMPEX_NONEXISTEND_CLSATTRVALUE_FALLBACK_KEY
- See Also:
- Constant Field Values
-
qualfier
protected java.lang.String qualfier
-
systemName
protected java.lang.String systemName
-
versionName
protected java.lang.String versionName
-
className
protected java.lang.String className
-
lang
protected Language lang
-
locale
protected java.util.Locale locale
-
dateFormatString
protected java.lang.String dateFormatString
-
numberFormatString
protected java.lang.String numberFormatString
-
classAttr
protected ClassificationAttribute classAttr
-
classAttrAssignment
protected ClassAttributeAssignment classAttrAssignment
-
classSystemVersion
protected ClassificationSystemVersion classSystemVersion
-
collectionDelimiter
protected char collectionDelimiter
-
attributeSeparator
protected char attributeSeparator
-
TO_ESCAPE
protected char[] TO_ESCAPE
-
allDoneFor
protected PK allDoneFor
-
currentCellValue
protected java.lang.String currentCellValue
-
-
Constructor Detail
-
ClassificationAttributeTranslator
public ClassificationAttributeTranslator()
General no-arg constructor
-
ClassificationAttributeTranslator
public ClassificationAttributeTranslator(ClassificationSystemVersion sysVer, ClassificationAttribute attr, char delimiter, Language lang)
Testing purpose constructor.
-
-
Method Detail
-
init
public void init(SpecialColumnDescriptor columnDescriptor) throws HeaderValidationException
Description copied from interface:SpecialValueTranslatorCalled once upon header creation to do some initial setup logic.- Specified by:
initin interfaceSpecialValueTranslator- Overrides:
initin classAbstractSpecialValueTranslator- Parameters:
columnDescriptor- the newly created column descriptor- Throws:
HeaderValidationException- indicates that the column descriptor is not configured properly
-
getSingleCellValueTranslator
protected AbstractValueTranslator getSingleCellValueTranslator(ClassAttributeAssignment assignment) throws HeaderValidationException
- Throws:
HeaderValidationException
-
getFallbackValueTranslator
protected AbstractValueTranslator getFallbackValueTranslator()
-
getAssignment
protected ClassAttributeAssignment getAssignment()
-
matchAssignment
protected ClassAttributeAssignment matchAssignment(java.util.Collection<ClassificationClass> classes)
-
getValueCtx
protected SessionContext getValueCtx(boolean localized) throws HeaderValidationException
- Throws:
HeaderValidationException
-
getFeature
protected TypedFeature getFeature(Product product)
-
performExport
public java.lang.String performExport(Item item) throws ImpExException
Description copied from interface:SpecialValueTranslatorCalled each time an item is exported using the enclosing header.- Specified by:
performExportin interfaceSpecialValueTranslator- Overrides:
performExportin classAbstractSpecialValueTranslator- Parameters:
item- the item to export- Returns:
- the string representation of the value to export
- Throws:
ImpExException- indicates an export error
-
performImport
public void performImport(java.lang.String cellValue, Item processedItem) throws ImpExExceptionDescription copied from interface:SpecialValueTranslatorCalled each time a non-empty cell value has to be imported.- Specified by:
performImportin interfaceSpecialValueTranslator- Overrides:
performImportin classAbstractSpecialValueTranslator- Parameters:
cellValue- the cell value stringprocessedItem- the item to import the value for- Throws:
ImpExException- indicates an import error
-
translateCurrentValues
@Deprecated public java.util.Collection<java.lang.Object> translateCurrentValues(ValueLine line, ClassAttributeAssignment assignment, Product processedItem) throws HeaderValidationException
Deprecated.since ages- Throws:
HeaderValidationException
-
translateCurrentUnitAwareValues
public java.util.Collection<UnitAwareValue> translateCurrentUnitAwareValues(ValueLine line, ClassAttributeAssignment assignment, Product processedItem) throws HeaderValidationException
- Throws:
HeaderValidationException
-
splitValues
protected java.util.List splitValues(ClassAttributeAssignment assignment, java.lang.String valueCollection)
-
notifyTranslationEnd
public void notifyTranslationEnd(ValueLine line, HeaderDescriptor header, Item processedItem) throws ImpExException
Description copied from interface:NotifiedSpecialValueTranslatorIs called if allSpecialValueTranslators used in header have been triggered. Implement here special logic which has to be executed after end of overall translation.- Specified by:
notifyTranslationEndin interfaceNotifiedSpecialValueTranslator- Parameters:
line- current value lineheader- current headerprocessedItem- item which was created or updated- Throws:
ImpExException- an ImpEx specific problem has occur
-
-