Class DefaultMappingLine
- java.lang.Object
-
- de.hybris.platform.importcockpit.model.mappingview.mappingline.impl.DefaultMappingLine
-
- All Implemented Interfaces:
MappingLineModel,MappingLineObservable
- Direct Known Subclasses:
AtomicTypeMapping,DefaultAttribCollectionMapping,DefaultCollectionMapping,DefaultComposedTypeMapping,DefaultTranslatorMapping,EnumTypeMapping,LocalizedTypeMapping,VirtualMappingLine
public class DefaultMappingLine extends java.lang.Object implements MappingLineModel
Superclass of all types of mapping lines that implements many of the methods defined by the MappingLineModel interface.
-
-
Constructor Summary
Constructors Constructor Description DefaultMappingLine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(MappingLineModel line)Adds a new sub mappingLineModel (child) to the mapping mappingLineModel.voidaddObserver(MappingLineObserver observer)java.lang.StringgetAttributeCode()Returns the code of the attribute represented by the mapping mappingLineModel.AttributeDescriptorModelgetAttributeDescriptor()Returns the attribute descriptor of this mapping mappingLineModel.java.util.List<MappingLineModel>getChildren()Returns the list of child/sub lines.TypeModelgetCollectionElementType()Returns the type of this collection element.java.lang.StringgetDisplayName()Returns the attribute name of the mapping mappingLineModel for display in the mapping area.AbstractImportFormatgetFormatPattern()Gets the format pattern of the mappingLineModel if there is one (for numbers and dates).intgetLevel()Returns the level of this mappingLineModel in the mapping.MappingModelgetMapping()Returns the mapping to which this mappingLineModel belongs to.MappingLineModelgetParent()Returns the parent of this mapping mappingLineModel or null if the mappingLineModel is on the top level.java.lang.StringgetPropDescriptorQualifier()Returns the property descriptor qualifier of the mapping linSourceColumnModelgetSource()Returns the assigned source column.java.lang.StringgetTranslator()Returns the translator that should be used for importing the mapped attribute values of this mapping mappingLineModel.java.lang.StringgetType()Returns the type of this attribute.java.lang.StringgetTypeCode()Returns the code of the attribute type of the mapping mappingLineModel.java.lang.StringgetValue()Returns the content of the value field of the mapping mappingLineModel.booleanhasChildren()Returns true if this mappingLineModel has children/sub lines.booleanhasSource()Returns true if this mappingLineModel has a sourcebooleanisAllowNull()Returns true if this mappingLineModel is marked to allow null values.booleanisAtomic()Returns true if this mappingLineModel represents an atomic type with (no sub lines possible).booleanisCollapsed()Returns true if the mapping mappingLineModel is opened (in the mapping view) after next updatebooleanisCollectionElement()Returns true if the mapping mappingLineModel is a collection element.booleanisComposed()Returns true if this mappingLineModel is a composed mappingLineModel.booleanisFocused()Returns true if the mapping mappingLineModel is focused after next updatebooleanisSelectorLocked()Returns true if the unique selector is locked for changes.booleanisSourceLocked()Returns true if the source cell field is locked for changes.booleanisUnique()Returns true if this mappingLineModel is marked as unique.booleanisValid()Returns whether the mapping mappingLineModel is valid according to result of the mapping validation.booleanisValueLocked()Returns true if the value field is locked for changes.voidnotifyObservers()voidremoveChild(MappingLineModel line)Removes a mappingLineModel from the list of children.voidremoveObserver(MappingLineObserver observer)voidsetAllowNull(boolean isAllowNull)Sets true if the mapping mappingLineModel should allow null values during import.voidsetAttributeDescriptor(AttributeDescriptorModel attributeDescriptor)Sets the attribute descriptor to the mapping mappingLineModel.voidsetCollapsed(boolean collapsed)Sets the variable that defines if the mapping mappingLineModel is opened or closed (in the mapping view) after next updatevoidsetCollectionElementType(TypeModel model)Sets the type of the collection element.voidsetFocused(boolean focused)Sets the variable that defines if the mapping mappingLineModel is focused after next updatevoidsetFormatPattern(AbstractImportFormat formatPattern)Sets the format patter to the mapping mappingLineModel (for numbers or dates).voidsetMapping(MappingModel mapping)Sets the mapping of the mapping mappingLineModel.voidsetParent(MappingLineModel line)Sets the parent of the mapping mappingLineModelvoidsetPropDescriptorQualifier(java.lang.String propDescriptorQualifier)Sets the property descriptor qualifier to the mapping mappingLineModel.voidsetSource(SourceColumnModel source)Sets the mapped source column (SourceColumnListitemModel object) to the mapping mappingLineModel.voidsetTranslator(java.lang.String translator)Sets the translator that should be used for importing the mapped attribute values of this mapping mappingLineModel.voidsetUnique(boolean unique)voidsetValid(boolean valid)Sets whether the mapping mappingLineModel is valid according to the mapping validation logic.voidsetValue(java.lang.String value)Sets the content to the value field of the mapping mappingLineModel.java.lang.StringtoString()
-
-
-
Method Detail
-
addChild
public void addChild(MappingLineModel line)
Description copied from interface:MappingLineModelAdds a new sub mappingLineModel (child) to the mapping mappingLineModel.- Specified by:
addChildin interfaceMappingLineModel- Parameters:
line- additional mappingLineModel
-
addObserver
public void addObserver(MappingLineObserver observer)
- Specified by:
addObserverin interfaceMappingLineObservable
-
getChildren
public java.util.List<MappingLineModel> getChildren()
Description copied from interface:MappingLineModelReturns the list of child/sub lines.- Specified by:
getChildrenin interfaceMappingLineModel- Returns:
- list of MappingLineModel sub mappingLineModel objects
-
getLevel
public int getLevel()
Description copied from interface:MappingLineModelReturns the level of this mappingLineModel in the mapping. If this is a direct child of the mapping then the level is 0. If it is a child of another mappingLineModel then it is the level of the parent plus one.- Specified by:
getLevelin interfaceMappingLineModel- Returns:
- level int
-
getMapping
public MappingModel getMapping()
Description copied from interface:MappingLineModelReturns the mapping to which this mappingLineModel belongs to.- Specified by:
getMappingin interfaceMappingLineModel- Returns:
- mapping
-
getAttributeCode
public java.lang.String getAttributeCode()
Description copied from interface:MappingLineModelReturns the code of the attribute represented by the mapping mappingLineModel.- Specified by:
getAttributeCodein interfaceMappingLineModel- Returns:
- attribute code
-
getDisplayName
public java.lang.String getDisplayName()
Description copied from interface:MappingLineModelReturns the attribute name of the mapping mappingLineModel for display in the mapping area.- Specified by:
getDisplayNamein interfaceMappingLineModel- Returns:
- display name of the attribute represented by the mapping mappingLineModel
-
hasSource
public boolean hasSource()
Description copied from interface:MappingLineModelReturns true if this mappingLineModel has a source- Specified by:
hasSourcein interfaceMappingLineModel- Returns:
- true if has source
-
getParent
public MappingLineModel getParent()
Description copied from interface:MappingLineModelReturns the parent of this mapping mappingLineModel or null if the mappingLineModel is on the top level.- Specified by:
getParentin interfaceMappingLineModel- Returns:
- parent
-
getSource
public SourceColumnModel getSource()
Description copied from interface:MappingLineModelReturns the assigned source column.- Specified by:
getSourcein interfaceMappingLineModel- Returns:
- source SourceColumnListitemModel object
-
getType
public java.lang.String getType()
Description copied from interface:MappingLineModelReturns the type of this attribute.- Specified by:
getTypein interfaceMappingLineModel- Returns:
- type
-
getTypeCode
public java.lang.String getTypeCode()
Description copied from interface:MappingLineModelReturns the code of the attribute type of the mapping mappingLineModel.- Specified by:
getTypeCodein interfaceMappingLineModel- Returns:
- type code
-
getValue
public java.lang.String getValue()
Description copied from interface:MappingLineModelReturns the content of the value field of the mapping mappingLineModel.- Specified by:
getValuein interfaceMappingLineModel- Returns:
- value string
-
hasChildren
public boolean hasChildren()
Description copied from interface:MappingLineModelReturns true if this mappingLineModel has children/sub lines.- Specified by:
hasChildrenin interfaceMappingLineModel- Returns:
- true if the mapping mappingLineModel children
-
isAtomic
public boolean isAtomic()
Description copied from interface:MappingLineModelReturns true if this mappingLineModel represents an atomic type with (no sub lines possible).- Specified by:
isAtomicin interfaceMappingLineModel- Returns:
- true if basic
-
isComposed
public boolean isComposed()
Description copied from interface:MappingLineModelReturns true if this mappingLineModel is a composed mappingLineModel. (Sub lines possible, true for collection or composed mapping lines)- Specified by:
isComposedin interfaceMappingLineModel- Returns:
- true if composed
-
isSourceLocked
public boolean isSourceLocked()
Description copied from interface:MappingLineModelReturns true if the source cell field is locked for changes.- Specified by:
isSourceLockedin interfaceMappingLineModel- Returns:
- true if source cell is locked, otherwise false
-
isValueLocked
public boolean isValueLocked()
Description copied from interface:MappingLineModelReturns true if the value field is locked for changes.- Specified by:
isValueLockedin interfaceMappingLineModel- Returns:
- true if value field is locked for changes, otherwise false
-
isSelectorLocked
public boolean isSelectorLocked()
Description copied from interface:MappingLineModelReturns true if the unique selector is locked for changes.- Specified by:
isSelectorLockedin interfaceMappingLineModel- Returns:
- true if unique is locked for changes
-
notifyObservers
public void notifyObservers()
- Specified by:
notifyObserversin interfaceMappingLineObservable
-
removeChild
public void removeChild(MappingLineModel line)
Description copied from interface:MappingLineModelRemoves a mappingLineModel from the list of children.- Specified by:
removeChildin interfaceMappingLineModel- Parameters:
line- mappingLineModel to remove
-
removeObserver
public void removeObserver(MappingLineObserver observer)
- Specified by:
removeObserverin interfaceMappingLineObservable
-
setMapping
public void setMapping(MappingModel mapping)
Description copied from interface:MappingLineModelSets the mapping of the mapping mappingLineModel.- Specified by:
setMappingin interfaceMappingLineModel
-
setParent
public void setParent(MappingLineModel line)
Description copied from interface:MappingLineModelSets the parent of the mapping mappingLineModel- Specified by:
setParentin interfaceMappingLineModel- Parameters:
line- parent mapping mappingLineModel
-
setSource
public void setSource(SourceColumnModel source)
Description copied from interface:MappingLineModelSets the mapped source column (SourceColumnListitemModel object) to the mapping mappingLineModel.- Specified by:
setSourcein interfaceMappingLineModel- Parameters:
source- SourceColumnListitemModel object
-
setValue
public void setValue(java.lang.String value)
Description copied from interface:MappingLineModelSets the content to the value field of the mapping mappingLineModel.- Specified by:
setValuein interfaceMappingLineModel
-
getFormatPattern
public AbstractImportFormat getFormatPattern()
Description copied from interface:MappingLineModelGets the format pattern of the mappingLineModel if there is one (for numbers and dates).- Specified by:
getFormatPatternin interfaceMappingLineModel- Returns:
- format pattern as string
-
setFormatPattern
public void setFormatPattern(AbstractImportFormat formatPattern)
Description copied from interface:MappingLineModelSets the format patter to the mapping mappingLineModel (for numbers or dates).- Specified by:
setFormatPatternin interfaceMappingLineModel
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isUnique
public boolean isUnique()
Description copied from interface:MappingLineModelReturns true if this mappingLineModel is marked as unique.- Specified by:
isUniquein interfaceMappingLineModel- Returns:
- true if unique
-
setUnique
public void setUnique(boolean unique)
- Specified by:
setUniquein interfaceMappingLineModel
-
setAttributeDescriptor
public void setAttributeDescriptor(AttributeDescriptorModel attributeDescriptor)
Description copied from interface:MappingLineModelSets the attribute descriptor to the mapping mappingLineModel.- Specified by:
setAttributeDescriptorin interfaceMappingLineModel
-
getAttributeDescriptor
public AttributeDescriptorModel getAttributeDescriptor()
Description copied from interface:MappingLineModelReturns the attribute descriptor of this mapping mappingLineModel. Can be null in some cases (localization entries).- Specified by:
getAttributeDescriptorin interfaceMappingLineModel- Returns:
- attribute descriptor
-
isCollectionElement
public boolean isCollectionElement()
Description copied from interface:MappingLineModelReturns true if the mapping mappingLineModel is a collection element.- Specified by:
isCollectionElementin interfaceMappingLineModel- Returns:
- true if the mapping mappingLineModel is an element of a collection
-
getCollectionElementType
public TypeModel getCollectionElementType()
Description copied from interface:MappingLineModelReturns the type of this collection element.- Specified by:
getCollectionElementTypein interfaceMappingLineModel- Returns:
- element type TypeModel
-
setCollectionElementType
public void setCollectionElementType(TypeModel model)
Description copied from interface:MappingLineModelSets the type of the collection element.- Specified by:
setCollectionElementTypein interfaceMappingLineModel- Parameters:
model- TypeModel
-
getPropDescriptorQualifier
public java.lang.String getPropDescriptorQualifier()
Description copied from interface:MappingLineModelReturns the property descriptor qualifier of the mapping lin- Specified by:
getPropDescriptorQualifierin interfaceMappingLineModel- Returns:
- property descriptor qualifier
-
setPropDescriptorQualifier
public void setPropDescriptorQualifier(java.lang.String propDescriptorQualifier)
Description copied from interface:MappingLineModelSets the property descriptor qualifier to the mapping mappingLineModel.- Specified by:
setPropDescriptorQualifierin interfaceMappingLineModel
-
isValid
public boolean isValid()
Description copied from interface:MappingLineModelReturns whether the mapping mappingLineModel is valid according to result of the mapping validation.- Specified by:
isValidin interfaceMappingLineModel- Returns:
- true if the mapping mappingLineModel is valid
-
setValid
public void setValid(boolean valid)
Description copied from interface:MappingLineModelSets whether the mapping mappingLineModel is valid according to the mapping validation logic.- Specified by:
setValidin interfaceMappingLineModel
-
getTranslator
public java.lang.String getTranslator()
Description copied from interface:MappingLineModelReturns the translator that should be used for importing the mapped attribute values of this mapping mappingLineModel.- Specified by:
getTranslatorin interfaceMappingLineModel- Returns:
- translator
-
setTranslator
public void setTranslator(java.lang.String translator)
Description copied from interface:MappingLineModelSets the translator that should be used for importing the mapped attribute values of this mapping mappingLineModel.- Specified by:
setTranslatorin interfaceMappingLineModel
-
isAllowNull
public boolean isAllowNull()
Description copied from interface:MappingLineModelReturns true if this mappingLineModel is marked to allow null values. In this case a [allowNull=true] modifier will be added to impex header entry.- Specified by:
isAllowNullin interfaceMappingLineModel- Returns:
- true if allowNull set to "true"
-
setAllowNull
public void setAllowNull(boolean isAllowNull)
Description copied from interface:MappingLineModelSets true if the mapping mappingLineModel should allow null values during import. If true a [allowNull=true] modifier will be added to impex header entry.- Specified by:
setAllowNullin interfaceMappingLineModel
-
isCollapsed
public boolean isCollapsed()
Description copied from interface:MappingLineModelReturns true if the mapping mappingLineModel is opened (in the mapping view) after next update- Specified by:
isCollapsedin interfaceMappingLineModel
-
setCollapsed
public void setCollapsed(boolean collapsed)
Description copied from interface:MappingLineModelSets the variable that defines if the mapping mappingLineModel is opened or closed (in the mapping view) after next update- Specified by:
setCollapsedin interfaceMappingLineModel
-
isFocused
public boolean isFocused()
Description copied from interface:MappingLineModelReturns true if the mapping mappingLineModel is focused after next update- Specified by:
isFocusedin interfaceMappingLineModel
-
setFocused
public void setFocused(boolean focused)
Description copied from interface:MappingLineModelSets the variable that defines if the mapping mappingLineModel is focused after next update- Specified by:
setFocusedin interfaceMappingLineModel
-
-