Package com.ibm.di.config.base
Class AttributeMapItemImpl
- java.lang.Object
-
- com.ibm.di.config.base.BaseConfigurationImpl
-
- com.ibm.di.config.base.AttributeMapItemImpl
-
- All Implemented Interfaces:
AttributeMapItem
,BaseConfiguration
,MetamergeConfigChangeListener
,java.io.Serializable
public class AttributeMapItemImpl extends BaseConfigurationImpl implements AttributeMapItem
The implementation class of theAttributeMapItem
interface.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.ibm.di.config.base.BaseConfigurationImpl
NAME
-
Fields inherited from interface com.ibm.di.config.interfaces.AttributeMapItem
ADVANCED_MAPPING, SIMPLE_MAPPING, SUBSTITUTION_MAPPING
-
Fields inherited from interface com.ibm.di.config.interfaces.BaseConfiguration
CHILD_PATH_SEPARATOR, DISABLE_EXTPROPS, DISABLE_INHERITANCE, INHERIT_NONE, INHERIT_PARENT, ONE_LEVEL, RECURSIVE, RECURSIVE_ONELEVEL, RECURSIVE_SUBTREE, SEARCH_EXACTCASE, SEARCH_ONELEVEL, SEARCH_PARAMNAME, SEARCH_PARAMNAME_RE, SEARCH_PROPERTY, SEARCH_REGEX, SEARCH_SUBSTRING, SUBTREE
-
-
Constructor Summary
Constructors Constructor Description AttributeMapItemImpl()
Default Constructor.AttributeMapItemImpl(java.lang.Object config)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AttributeMapItem
clone(AttributeMapItem ami)
Clone an Attribute Map Item.boolean
detachFromParent()
Detach this Attribute Map item from its parent Attribute Map.boolean
flatten(java.util.List<java.lang.String> excludedNS)
This method combines all values from this object and its inherited objects into one single config object.boolean
getAdd()
Gets the add attribute of the AttributeMapItem objectjava.util.List
getChildAttributeMaps()
Returns a list of child attribute map items.boolean
getEnabled()
Gets the enabled attribute of this object.boolean
getModify()
Gets the modify attribute of the AttributeMapItem objectjava.lang.String
getScript()
Gets the script attribute of this object.java.lang.String
getSimple()
Gets the simple attribute of the AttributeMapItem objectjava.lang.String
getSubstitution()
Gets the substitution template attribute of the AttributeMapItem objectjava.lang.String
getType()
Gets the type attribute of the AttributeMapItem objectvoid
init()
Called after internal data structure is set.boolean
isAdvanced()
Returns true if this AttributeMapItem is an advanced attribute map (mapped by a script)boolean
isSimple()
Returns true if this AttributeMapItem is a simple attribute mapboolean
isSubstitution()
Returns true if this attribute map item is subject to property expansionboolean
reattachToParent(int position)
Re-attach this Attribute Map item to its parent Attribute Map.void
setAdd(boolean add)
Sets the add attribute of the AttributeMapItem objectvoid
setEnabled(boolean enabled)
Sets the enabled attribute of this object.void
setInheritsFrom(BaseConfiguration inheritFrom)
Sets the object from which this object inherits data.void
setModify(boolean modify)
Sets the modify attribute of the AttributeMapItem objectvoid
setScript(java.lang.String script)
Sets the script attribute of this object.void
setSimple(java.lang.String attribute)
Sets the simple attribute of the AttributeMapItem objectvoid
setSubstitution(java.lang.String str)
Sets the substitution template attribute of the AttributeMapItem objectvoid
setType(java.lang.String type)
Sets the type attribute of the AttributeMapItem object-
Methods inherited from class com.ibm.di.config.base.BaseConfigurationImpl
addListener, configurationChanged, deepClone, expandPropertyValue, expandPropertyValue, fromEntry, getBooleanParameter, getChild, getChildForPath, getChildNames, getClone, getData, getDataIterator, getDebug, getDebug, getDebugBreak, getFlags, getInheritsFrom, getInheritsFromRef, getIntegerParameter, getKeys, getLogEnabled, getLongName, getMetamergeConfig, getModified, getModTS, getName, getNamespace, getNullBehavior, getNullBehaviorValue, getNullDefinition, getNullDefinitionValue, getParameter, getParameter, getParameter, getParameterPropertySource, getParameterPropertySourceFromValue, getParameterRaw, getParent, getParentName, getPath, getReferences, getResHash, getScriptEngine, getShortName, getStringParameter, getSubstitutionMap, getUseConfigListeners, getUseListeners, getUserComment, hasParameter, isExpression, isParameterLocal, isProtectedParameter, nameForChild, notifyChange, notifyChange, notifyChange, performNotifyChange, removeListener, removeParameter, search, search, setBooleanParameter, setChild, setData, setDebug, setDebugBreak, setFlags, setInheritsFromRef, setIntegerParameter, setLogEnabled, setMetamergeConfig, setModified, setModTS, setName, setName, setNullBehavior, setNullBehaviorValue, setNullDefinition, setNullDefinitionValue, setParameter, setParameter, setParameterPropertySource, setParent, setProtectedParameter, setProtectedParameter, setScriptEngine, setStringParameter, setSubstitutionMap, setupInheritanceChain, setUseConfigListeners, setUseListeners, setUserComment, size, toEntry, toString, updateInheritsFrom, willExpandProps, willFlatten, willUseInherited
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.ibm.di.config.interfaces.BaseConfiguration
addListener, fromEntry, getBooleanParameter, getChild, getChildForPath, getChildNames, getClone, getData, getDataIterator, getDebug, getDebug, getDebugBreak, getFlags, getInheritsFrom, getInheritsFromRef, getIntegerParameter, getKeys, getLogEnabled, getMetamergeConfig, getModified, getModTS, getName, getNamespace, getNullBehavior, getNullBehaviorValue, getNullDefinition, getNullDefinitionValue, getParameter, getParameter, getParameter, getParameterPropertySource, getParameterRaw, getParent, getPath, getReferences, getScriptEngine, getShortName, getStringParameter, getSubstitutionMap, getUseListeners, getUserComment, hasParameter, isExpression, isParameterLocal, isProtectedParameter, nameForChild, notifyChange, notifyChange, notifyChange, removeListener, removeParameter, search, search, setBooleanParameter, setChild, setData, setDebug, setDebugBreak, setFlags, setInheritsFromRef, setIntegerParameter, setLogEnabled, setMetamergeConfig, setModified, setModTS, setName, setName, setNullBehavior, setNullBehaviorValue, setNullDefinition, setNullDefinitionValue, setParameter, setParameter, setParameterPropertySource, setParent, setProtectedParameter, setProtectedParameter, setScriptEngine, setStringParameter, setSubstitutionMap, setupInheritanceChain, setUseListeners, setUserComment, size, toEntry, updateInheritsFrom, willFlatten
-
-
-
-
Method Detail
-
init
public void init() throws java.lang.Exception
Called after internal data structure is set.- Specified by:
init
in interfaceBaseConfiguration
- Overrides:
init
in classBaseConfigurationImpl
- Throws:
java.lang.Exception
- if the initialization fails.
-
clone
public static AttributeMapItem clone(AttributeMapItem ami)
Clone an Attribute Map Item.- Parameters:
ami
- Attribute Map Item, which will be cloned.- Returns:
- The created clone.
-
getEnabled
public boolean getEnabled()
Gets the enabled attribute of this object.- Specified by:
getEnabled
in interfaceAttributeMapItem
- Specified by:
getEnabled
in interfaceBaseConfiguration
- Overrides:
getEnabled
in classBaseConfigurationImpl
- Returns:
- The nullBehaviorValue value.
-
setEnabled
public void setEnabled(boolean enabled)
Sets the enabled attribute of this object.- Specified by:
setEnabled
in interfaceAttributeMapItem
- Specified by:
setEnabled
in interfaceBaseConfiguration
- Overrides:
setEnabled
in classBaseConfigurationImpl
- Parameters:
enabled
-true
for enabling;false
otherwise.
-
getScript
public java.lang.String getScript()
Gets the script attribute of this object.- Specified by:
getScript
in interfaceAttributeMapItem
- Specified by:
getScript
in interfaceBaseConfiguration
- Overrides:
getScript
in classBaseConfigurationImpl
- Returns:
- The script value.
-
setScript
public void setScript(java.lang.String script)
Sets the script attribute of this object.- Specified by:
setScript
in interfaceAttributeMapItem
- Specified by:
setScript
in interfaceBaseConfiguration
- Overrides:
setScript
in classBaseConfigurationImpl
- Parameters:
script
- The new script value
-
getModify
public boolean getModify()
Gets the modify attribute of the AttributeMapItem object- Specified by:
getModify
in interfaceAttributeMapItem
- Returns:
- The modify value
-
setModify
public void setModify(boolean modify)
Sets the modify attribute of the AttributeMapItem object- Specified by:
setModify
in interfaceAttributeMapItem
- Parameters:
modify
- The new modify value
-
getAdd
public boolean getAdd()
Gets the add attribute of the AttributeMapItem object- Specified by:
getAdd
in interfaceAttributeMapItem
- Returns:
- The add value
-
setAdd
public void setAdd(boolean add)
Sets the add attribute of the AttributeMapItem object- Specified by:
setAdd
in interfaceAttributeMapItem
- Parameters:
add
- The new add value
-
getSimple
public java.lang.String getSimple()
Gets the simple attribute of the AttributeMapItem object- Specified by:
getSimple
in interfaceAttributeMapItem
- Returns:
- The simple value
-
setSimple
public void setSimple(java.lang.String attribute)
Sets the simple attribute of the AttributeMapItem object- Specified by:
setSimple
in interfaceAttributeMapItem
- Parameters:
attribute
- The new simple value
-
setType
public void setType(java.lang.String type)
Sets the type attribute of the AttributeMapItem object- Specified by:
setType
in interfaceAttributeMapItem
- Parameters:
type
- The new type value
-
getType
public java.lang.String getType()
Gets the type attribute of the AttributeMapItem object- Specified by:
getType
in interfaceAttributeMapItem
- Returns:
- The type value
-
isSimple
public boolean isSimple()
Returns true if this AttributeMapItem is a simple attribute map- Specified by:
isSimple
in interfaceAttributeMapItem
- Returns:
- The simple value
-
isAdvanced
public boolean isAdvanced()
Returns true if this AttributeMapItem is an advanced attribute map (mapped by a script)- Specified by:
isAdvanced
in interfaceAttributeMapItem
- Returns:
- The advanced value
-
isSubstitution
public boolean isSubstitution()
Returns true if this attribute map item is subject to property expansion- Specified by:
isSubstitution
in interfaceAttributeMapItem
- Returns:
- The if enabled, false if disabled
-
setSubstitution
public void setSubstitution(java.lang.String str)
Sets the substitution template attribute of the AttributeMapItem object- Specified by:
setSubstitution
in interfaceAttributeMapItem
- Parameters:
str
- The substitution template
-
getSubstitution
public java.lang.String getSubstitution()
Gets the substitution template attribute of the AttributeMapItem object- Specified by:
getSubstitution
in interfaceAttributeMapItem
- Returns:
- The substitution template
-
flatten
public boolean flatten(java.util.List<java.lang.String> excludedNS) throws java.lang.Exception
This method combines all values from this object and its inherited objects into one single config object. After flattening, the object is a complete object with no inherited values except those from the excludedNS list.- Specified by:
flatten
in interfaceBaseConfiguration
- Overrides:
flatten
in classBaseConfigurationImpl
- Parameters:
excludedNS
- List of namespaces to exclude from flattening- Returns:
true
if object attempted flattening, FALSE is this object inherits from an excluded namespace or has no inheritance- Throws:
java.lang.Exception
-
detachFromParent
public boolean detachFromParent()
Detach this Attribute Map item from its parent Attribute Map. Note that the modification affects only the Attribute Map, the item itself still keeps its knowledge that the Attribute Map is its parent. This behavior is used by thereattachToParent(int)
method.- Specified by:
detachFromParent
in interfaceBaseConfiguration
- Overrides:
detachFromParent
in classBaseConfigurationImpl
- Returns:
- Always true.
-
reattachToParent
public boolean reattachToParent(int position)
Re-attach this Attribute Map item to its parent Attribute Map.- Specified by:
reattachToParent
in interfaceBaseConfiguration
- Overrides:
reattachToParent
in classBaseConfigurationImpl
- Parameters:
position
- This parameter is ignored.- Returns:
- False if the Attribute Map already contains this Attribute Map item, true otherwise.
-
getChildAttributeMaps
public java.util.List getChildAttributeMaps()
Returns a list of child attribute map items.- Specified by:
getChildAttributeMaps
in interfaceAttributeMapItem
- Returns:
- List of child AttributeMapItem items
-
setInheritsFrom
public void setInheritsFrom(BaseConfiguration inheritFrom)
Sets the object from which this object inherits data.Note: Call this method to setup a temporary (non persistent) object for inheritance.
- Specified by:
setInheritsFrom
in interfaceBaseConfiguration
- Overrides:
setInheritsFrom
in classBaseConfigurationImpl
- Parameters:
inheritFrom
- The new inheritsFrom value.
-
-