com.ibm.di.config.base
Class BaseConfigurationImpl

java.lang.Object
  extended by com.ibm.di.config.base.BaseConfigurationImpl
All Implemented Interfaces:
BaseConfiguration, MetamergeConfigChangeListener, Serializable
Direct Known Subclasses:
AssemblyLineConfigImpl, AttributeMapConfigImpl, AttributeMapItemImpl, BranchConditionImpl, CallConfigImpl, CallParamConfigImpl, CheckpointConfigImpl, ConnectorConfigImpl, ConnectorSchemaConfigImpl, ConnectorSchemaItemConfigImpl, ContainerConfigImpl, DeltaConfigImpl, ExposedPropertyImpl, ExternalPropertiesDelegator, ExternalPropertiesImpl, FormConfigImpl, FormItemConfigImpl, FormSectionImpl, HookConfigImpl, InheritConfigImpl, InstanceConfigImpl, LibraryConfigImpl, LinkCriteriaConfigImpl, LinkCriteriaItemImpl, LogConfigImpl, LogConfigItemImpl, MetamergeConfigImpl, MetamergeFolderImpl, NamespaceConfigImpl, OperationConfigImpl, ParserConfigImpl, PoolDefConfigImpl, PoolInstanceConfigImpl, PropertyConfigImpl, PropertyManagerImpl, PropertyStoreConfigImpl, RawConnectorConfigImpl, RawFunctionConfigImpl, ReconnectConfigImpl, ReconnectRuleConfigImpl, SandboxConfigImpl, SchemaConfigImpl, SchemaItemConfigImpl, ScriptConfigImpl, SimulationConfigImpl, TombstonesConfigImpl

public class BaseConfigurationImpl
extends Object
implements BaseConfiguration, MetamergeConfigChangeListener

This class provides the basic methods for all the configuration classes.

See Also:
Serialized Form

Field Summary
static String NAME
          Name used for notify events.
 
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
BaseConfigurationImpl()
          Empty constructor
BaseConfigurationImpl(Object data)
          Constructor providing a TreeMap of attribute/value pairs
 
Method Summary
 void addListener(MetamergeConfigChangeListener listener)
          Registers an object to be notified of change events in this object.
 void configurationChanged(MetamergeConfigChange mcc)
          
 TreeMap deepClone(TreeMap inputMap)
          Clones the local data structure.
 boolean detachFromParent()
          This method removes this objects from its parent container.
 Object expandPropertyValue(Object name, Object value)
          Substitutes the parameter value with a user property value.
 Object expandPropertyValue(Object name, Object value, List<String> cref)
          Substitutes the parameter value with a user property value.
 boolean flatten(List<String> excludedNS)
          This method combines all values from this object and its inherited objects into one single config object.
 void fromEntry(Object entry)
          This method populates this object's internal data with the data from a Entry object.
 boolean getBooleanParameter(Object key, boolean defval)
          Converts value from getParameter call to a boolean
 BaseConfiguration getChild(Object name)
          
 BaseConfiguration getChildForPath(String path)
          This method traverses the child hierarchy (from the top) and returns the configuration object associated with the path.
 List<String> getChildNames()
          Returns a list of names for all child configuration object
 Object getClone()
          
 TreeMap getData()
          Returns a TreeMap with key/value pairs for all local parameters.
 Iterator<String> getDataIterator()
          Returns an Iterator for all keys in this object.
 boolean getDebug()
          Returns the debug flag for the object.
 boolean getDebug(boolean defval)
          Returns the debug flag for the object.
 boolean getDebugBreak(boolean defval)
          Gets the debugBreak attribute of this object.
 boolean getEnabled()
          Gets the enabled attribute of this object.
 int getFlags()
          Returns the flags which determines how the getParameter behaves in terms of inheritance and external properties.
 BaseConfiguration getInheritsFrom()
          Returns the object from which this object inherits data.
 String getInheritsFromRef()
          Gets the name of the object this object should inherit its values.
 int getIntegerParameter(Object key, int defval)
          Converts value from getParameter call to an int
 List<String> getKeys(int level)
          Returns a list of keys in this object.
 boolean getLogEnabled()
          Gets the log enabled attribute of this object.
 String getLongName()
           
 MetamergeConfig getMetamergeConfig()
          Gets the MetamergeConfig object to which this object belongs.
 boolean getModified()
          Returns the modified state of this object.
 Name getName()
          The object's full name
 Object getNamespace()
          Gets the namespace attribute of the BaseConfiguration object
 String getNullBehavior()
          Gets the nullBehavior attribute of this object.
 String getNullBehaviorValue()
          Gets the nullBehaviorValue attribute of this object.
 String getNullDefinition()
          Gets the nullDefinition attribute of the BaseConfiguration object
 String getNullDefinitionValue()
          Gets the nullDefinitionValue attribute of the BaseConfiguration object
 Object getParameter(Object name)
          Returns the value for a given config item.
 Object getParameter(Object name, Object createValue)
          Gets the parameter attribute of this config object.
 Object getParameter(Object name, Object createValue, List<String> cref)
          Returns the value for a given config item.
 String getParameterPropertySource(Object name)
          Returns the user property name for a parameter.
 String getParameterPropertySourceFromValue(Object value)
           
 Object getParameterRaw(Object name)
          Returns the value for a given config item without expanding the property value.
 BaseConfiguration getParent()
          Returns the parent object to which this object belongs.
 String getParentName()
           
 String getPath()
          This method returns the path to this object.
 List<String> getReferences(List<String> list)
          
static ResourceHash getResHash()
           
 String getScript()
          Gets the script attribute of this object.
 String getScriptEngine()
          Gets the ScriptEngine attribute of this object.
 String getShortName()
          Gets the shortName attribute of the BaseConfiguration object.
 String getStringParameter(Object name)
          Converts value from getParameter call to a string
 Map<String,Object> getSubstitutionMap()
           
static boolean getUseConfigListeners()
           
 boolean getUseListeners()
          Deprecated. 
 String getUserComment()
          
 boolean hasParameter(Object name)
          Returns true if parameter name is local to this object.
 void init()
          Called after internal data structure is set.
 boolean isExpression(Object parameter)
          
 boolean isParameterLocal(Object name)
          Returns true if the parameter is local and false if the parameter does not exist either in this object or in any inherited object.
 String nameForChild(BaseConfiguration config)
          Returns the name for a configuration object
 void notifyChange(MetamergeConfigChange event)
          Signal a change event to listeners.
 void notifyChange(Object source, Object key, int operation)
          Notifies listeners for a change event.
 void notifyChange(Object source, Object key, int operation, Object userObject)
          Notifies listeners for a change event.
protected  void performNotifyChange(MetamergeConfigChange mcc)
          Notifies all registered listeners for a specified config for a change event.
 boolean reattachToParent(int position)
          This method reattaches this object to its former parent.
 void removeListener(MetamergeConfigChangeListener listener)
          Removes a listener from the notification list.
 void removeParameter(Object name)
          Removes a local parameter from this object.
 List<Binding> search(String text, int options, int sizelimit)
          Searches a configuration object and optionally its children for a specific key or value.
 List<Binding> search(String text, int options, int sizelimit, List<Binding> results)
          Searches a configuration object and optionally its children for a specific key or value.
 void setBooleanParameter(Object name, boolean value)
          Calls setParameter converting value to a Boolean object.
 void setChild(Object name, BaseConfiguration config)
          Associates a configuration object with a name in this configuration
 void setData(TreeMap obj)
          Sets the data to be used by this object.
 void setDebug(boolean debug)
          Sets the debug flag for the object.
 void setDebugBreak(boolean debug)
          Sets the debugBreak attribute of this object.
 void setEnabled(boolean autoStart)
          Sets the enabled attribute of this object.
 void setFlags(int flags)
          Sets flags.
 void setInheritsFrom(BaseConfiguration inherit)
          Sets the object from which this object inherits data.
 void setInheritsFromRef(String ref)
          Sets the name of the object from which this object should inherit its values.
 void setIntegerParameter(Object name, int value)
          Calls setParameter converting value to an Integer object.
 void setLogEnabled(boolean enabled)
          Sets the log enabled attribute of this object.
 void setMetamergeConfig(MetamergeConfig mc)
          Sets the MetamergeConfig object to which this object belongs.
 void setModified(boolean modified)
          Sets the modified attribute of the BaseConfiguration object
 void setName(Name name)
          Sets the name of this object.
 void setName(String name)
          Sets the name attribute of this object.
 void setNullBehavior(String nb)
          Sets the nullBehavior attribute of this object.
 void setNullBehaviorValue(String nbv)
          Sets the nullBehaviorValue attribute of this object.
 void setNullDefinition(String nb)
          Sets the nullDefinition attribute of the BaseConfiguration object
 void setNullDefinitionValue(String nbv)
          Sets the nullDefinitionValue attribute of the BaseConfiguration object
 void setParameter(Object name, Object value)
          Sets the value for a given config item
 void setParameter(Object name, Object value, boolean notify)
          Sets the value for a given config item, optionally notifying the change.
 void setParameterPropertySource(Object name, String propertySource)
          Associates a parameter name with a user property.
 void setParent(BaseConfiguration parent)
          Sets the parent object.
 void setProtectedParameter(Object name, Object value)
          Stores the parameter value in the default password store if one is configured.
 void setScript(String script)
          Sets the script attribute of this object.
 void setScriptEngine(String engine)
          Sets the ScriptEngine attribute of this object.
 void setStringParameter(Object name, String value)
          Calls setParameter.
 void setSubstitutionMap(Map<String,Object> map)
          Sets the substitution map for this configuration object
 void setupInheritanceChain()
          Established the inheritance chain for this object.
static void setUseConfigListeners(boolean value)
          Enable/disable the use of configuration listeners in the JVM.
 void setUseListeners(boolean value)
          Deprecated. 
 void setUserComment(String comment)
          Sets the user defined comment string.
 int size()
          Number of key/value pairs.
 Object toEntry()
          This method returns a Entry object constructed from the internal data structure.
 String toString()
          Answers a string containing the name of the config.
 void updateInheritsFrom(String ref)
          Sets the name of the object from which this object should inherit its values and calls the setupInheritanceChain to activate the change.
 boolean willExpandProps()
           
 boolean willFlatten(List<String> excludedNS)
          
 boolean willUseInherited()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
Name used for notify events.

See Also:
Constant Field Values
Constructor Detail

BaseConfigurationImpl

public BaseConfigurationImpl()
Empty constructor


BaseConfigurationImpl

public BaseConfigurationImpl(Object data)
Constructor providing a TreeMap of attribute/value pairs

Parameters:
data - TreeMap of attribute/value pairs
Method Detail

getResHash

public static ResourceHash getResHash()
Returns:
ResourceHash object used for access of the TMS messages.

setupInheritanceChain

public void setupInheritanceChain()
                           throws Exception
Established the inheritance chain for this object.

Specified by:
setupInheritanceChain in interface BaseConfiguration
Throws:
Exception - if the operation could not be performed

getInheritsFrom

public BaseConfiguration getInheritsFrom()
Returns the object from which this object inherits data.

Specified by:
getInheritsFrom in interface BaseConfiguration
Returns:
The inherited object.

getInheritsFromRef

public String getInheritsFromRef()
Gets the name of the object this object should inherit its values.

Specified by:
getInheritsFromRef in interface BaseConfiguration
Returns:
The name of the inherited object.

setInheritsFrom

public void setInheritsFrom(BaseConfiguration inherit)
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 interface BaseConfiguration
Parameters:
inherit - The new inheritsFrom value.

updateInheritsFrom

public void updateInheritsFrom(String ref)
                        throws Exception
Sets the name of the object from which this object should inherit its values and calls the setupInheritanceChain to activate the change.

Specified by:
updateInheritsFrom in interface BaseConfiguration
Parameters:
ref - The new inheritsFromRef value
Throws:
Exception - if the operation does not succeed

setInheritsFromRef

public void setInheritsFromRef(String ref)
Sets the name of the object from which this object should inherit its values.

Specified by:
setInheritsFromRef in interface BaseConfiguration
Parameters:
ref - The new inheritsFromRef value

getModified

public boolean getModified()
Returns the modified state of this object.

Specified by:
getModified in interface BaseConfiguration
Returns:
the modified state.

setModified

public void setModified(boolean modified)
Sets the modified attribute of the BaseConfiguration object

Specified by:
setModified in interface BaseConfiguration
Parameters:
modified - The new modified value

setUseListeners

@Deprecated
public void setUseListeners(boolean value)
Deprecated. 

Specifies whether event listeners are used.

Specified by:
setUseListeners in interface BaseConfiguration
Parameters:
value - true indicates using event listeners; false - not using

getUseListeners

@Deprecated
public boolean getUseListeners()
Deprecated. 

Checks whether event listeners are used.

Specified by:
getUseListeners in interface BaseConfiguration
Returns:
true if event listeners are used; otherwise false.

setUseConfigListeners

public static void setUseConfigListeners(boolean value)
Enable/disable the use of configuration listeners in the JVM. This is an optimization to turn off listeners which the CE uses, but the Server does not need.

Parameters:
value - False to disable configuration listeners.
Since:
7.0

getUseConfigListeners

public static boolean getUseConfigListeners()
Returns:
Whether configuration listeners are enabled or disabled in this JVM.
Since:
7.0
See Also:
setUseConfigListeners(boolean)

addListener

public void addListener(MetamergeConfigChangeListener listener)
Registers an object to be notified of change events in this object.

Specified by:
addListener in interface BaseConfiguration
Parameters:
listener - The listener object to notify.

removeListener

public void removeListener(MetamergeConfigChangeListener listener)
Removes a listener from the notification list.

Specified by:
removeListener in interface BaseConfiguration
Parameters:
listener - The listener object to remove.

configurationChanged

public void configurationChanged(MetamergeConfigChange mcc)

Specified by:
configurationChanged in interface MetamergeConfigChangeListener

notifyChange

public void notifyChange(Object source,
                         Object key,
                         int operation)
Notifies listeners for a change event.

Note: This method is typically called by setParameter method but not from user code.

Specified by:
notifyChange in interface BaseConfiguration
Parameters:
source - The caller initiating the change event
key - The key that changed
operation - The operation performed on key

notifyChange

public void notifyChange(Object source,
                         Object key,
                         int operation,
                         Object userObject)
Notifies listeners for a change event.

Note: This method is typically called by setParameter method but not from user code.

Specified by:
notifyChange in interface BaseConfiguration
Parameters:
source - The caller initiating the change event
key - The key that changed
operation - The operation performed on key
userObject - Arbitrary object provided by caller

notifyChange

public void notifyChange(MetamergeConfigChange event)
Signal a change event to listeners. This method is typically called by setParameter but not user code.

Specified by:
notifyChange in interface BaseConfiguration
Parameters:
event - The event describing the change

performNotifyChange

protected void performNotifyChange(MetamergeConfigChange mcc)
Notifies all registered listeners for a specified config for a change event.

Parameters:
mcc - the config object

size

public int size()
Description copied from interface: BaseConfiguration
Number of key/value pairs.

Specified by:
size in interface BaseConfiguration
Returns:
the total number of keys in this configuration object.

getName

public Name getName()
Description copied from interface: BaseConfiguration
The object's full name

Specified by:
getName in interface BaseConfiguration
Returns:
the name of this object.

getShortName

public String getShortName()
Gets the shortName attribute of the BaseConfiguration object. The short name is the last component in a multi component name. E.g.: AssemblyLines/MyName --> "MyName"

Specified by:
getShortName in interface BaseConfiguration
Returns:
The shortName value

getLongName

public String getLongName()
Returns:
a string giving the complete name of this object, including the name of all parents.

getNamespace

public Object getNamespace()
Gets the namespace attribute of the BaseConfiguration object

Specified by:
getNamespace in interface BaseConfiguration
Returns:
The namespace value

setName

public void setName(Name name)
Sets the name of this object.

Specified by:
setName in interface BaseConfiguration
Parameters:
name - The new name value

setName

public void setName(String name)
             throws Exception
Sets the name attribute of this object.

Specified by:
setName in interface BaseConfiguration
Parameters:
name - The new name value
Throws:
Exception - if the operation does not succeed

getData

public TreeMap getData()
Returns a TreeMap with key/value pairs for all local parameters.

Specified by:
getData in interface BaseConfiguration
Returns:
The TreeMap object.

deepClone

public TreeMap deepClone(TreeMap inputMap)
Clones the local data structure.

Parameters:
inputMap - TreeMap object to be cloned
Returns:
clone of the inputMap parameter.

setData

public void setData(TreeMap obj)
Sets the data to be used by this object. The data is passed by a TreeMap object containing key/value pairs.

Note: The TreeMap data is not cloned.

Specified by:
setData in interface BaseConfiguration
Parameters:
obj - The new data value.

init

public void init()
          throws Exception
Called after internal data structure is set.

Specified by:
init in interface BaseConfiguration
Throws:
Exception

getDataIterator

public Iterator<String> getDataIterator()
Returns an Iterator for all keys in this object.

Specified by:
getDataIterator in interface BaseConfiguration
Returns:
The dataIterator value.

getKeys

public List<String> getKeys(int level)
Returns a list of keys in this object.

Specified by:
getKeys in interface BaseConfiguration
Parameters:
level - can have these values:
  • ONE_LEVEL - only simple key/value items are returned.
  • SUBTREE - all keys are returned regardless of whether they are complex (TreeMap) or simple (String, Boolean, Integer, Vector ).
  • RECURSIVE - inherited keys are returned as well.
  • Returns:
    The list of keys.

    getParent

    public BaseConfiguration getParent()
    Returns the parent object to which this object belongs.

    Specified by:
    getParent in interface BaseConfiguration
    Returns:
    The parent value.

    getParentName

    public String getParentName()
    Returns:
    a string giving the complete name of the parent, followed by a dot; if no parent, return empty string

    setParent

    public void setParent(BaseConfiguration parent)
    Sets the parent object.

    Specified by:
    setParent in interface BaseConfiguration
    Parameters:
    parent - the new parent

    setFlags

    public void setFlags(int flags)
    Sets flags. ( like ignore inheritance )

    Specified by:
    setFlags in interface BaseConfiguration
    Parameters:
    flags - the new flags to set

    getFlags

    public int getFlags()
    Returns the flags which determines how the getParameter behaves in terms of inheritance and external properties.

    Specified by:
    getFlags in interface BaseConfiguration
    Returns:
    value of the flags

    removeParameter

    public void removeParameter(Object name)
    Removes a local parameter from this object.

    Specified by:
    removeParameter in interface BaseConfiguration
    Parameters:
    name - Parameter name

    isParameterLocal

    public boolean isParameterLocal(Object name)
    Returns true if the parameter is local and false if the parameter does not exist either in this object or in any inherited object.

    Specified by:
    isParameterLocal in interface BaseConfiguration
    Parameters:
    name - Parameter name
    Returns:
    true if name is local; otherwise false.

    hasParameter

    public boolean hasParameter(Object name)
    Returns true if parameter name is local to this object.

    Specified by:
    hasParameter in interface BaseConfiguration
    Parameters:
    name - Parameter name
    Returns:
    true if name is local.

    getParameterRaw

    public Object getParameterRaw(Object name)
    Returns the value for a given config item without expanding the property value.

    Specified by:
    getParameterRaw in interface BaseConfiguration
    Parameters:
    name - The parameter name
    Returns:
    The parameter value

    getParameter

    public Object getParameter(Object name)
    Returns the value for a given config item. This method will call inherited object's getParameter if this object does not contain the named value. In case of returning an inherited value, the value from the inherited object will be cloned. It is up to the user to create a key/value local to this object by calling one of the setParameter methods.

    Specified by:
    getParameter in interface BaseConfiguration
    Parameters:
    name - The parameter name
    Returns:
    The parameter value

    getParameter

    public Object getParameter(Object name,
                               Object createValue)
    Gets the parameter attribute of this config object. If the parameter is not present a default value is assigned to the parameter using createValue.

    Specified by:
    getParameter in interface BaseConfiguration
    Parameters:
    name - The parameter name
    createValue - The value added to this object in case the parameter does not exist
    Returns:
    The parameter value

    getParameter

    public Object getParameter(Object name,
                               Object createValue,
                               List<String> cref)
    Returns the value for a given config item. This method will call inherited object's getParameter if this object does not contain the named value. In case of returning an inherited value, the value from the inherited object will be cloned. It is up to the user to create a key/value local to this object by calling one of the setParameter methods.

    This method also conveys the List object to ParameterSubstitution calls to resolve circular references. If the parameter is not present even after calling inherited object's getParameter, a default value is assigned to the parameter using createValue.

    Specified by:
    getParameter in interface BaseConfiguration
    Parameters:
    name - The parameter name
    createValue - The value added to this object in case the parameter does not exist
    cref - The circular references list of previously used config object expressions
    Returns:
    The parameter value

    getStringParameter

    public String getStringParameter(Object name)
    Converts value from getParameter call to a string

    Specified by:
    getStringParameter in interface BaseConfiguration
    Parameters:
    name - The parameter name
    Returns:
    The stringParameter value

    getBooleanParameter

    public boolean getBooleanParameter(Object key,
                                       boolean defval)
    Converts value from getParameter call to a boolean

    Specified by:
    getBooleanParameter in interface BaseConfiguration
    Parameters:
    key - The parameter name
    defval - The default value if parameter does not exist
    Returns:
    The boolean value

    getIntegerParameter

    public int getIntegerParameter(Object key,
                                   int defval)
    Converts value from getParameter call to an int

    Specified by:
    getIntegerParameter in interface BaseConfiguration
    Parameters:
    key - The parameter name
    defval - The default value if parameter does not exist
    Returns:
    The integerParameter value

    setParameter

    public void setParameter(Object name,
                             Object value)
    Sets the value for a given config item

    Specified by:
    setParameter in interface BaseConfiguration
    Parameters:
    name - Parameter name
    value - Parameter value

    setParameter

    public void setParameter(Object name,
                             Object value,
                             boolean notify)
    Sets the value for a given config item, optionally notifying the change. If notify is true, the behavior is identical to setParameter( name, value ).

    Specified by:
    setParameter in interface BaseConfiguration
    Parameters:
    name - Parameter name
    value - Parameter value
    notify - If true, notify of the change.

    setProtectedParameter

    public void setProtectedParameter(Object name,
                                      Object value)
                               throws Exception
    Stores the parameter value in the default password store if one is configured. Retrieval of the parameter is done through the standard getParameter methods.

    Specified by:
    setProtectedParameter in interface BaseConfiguration
    Parameters:
    name - Parameter name
    value - Parameter value
    Throws:
    Exception - if error occurs while setting property to the property store chosen by TDIProperties object associated with this config

    setBooleanParameter

    public void setBooleanParameter(Object name,
                                    boolean value)
    Calls setParameter converting value to a Boolean object.

    Specified by:
    setBooleanParameter in interface BaseConfiguration
    Parameters:
    name - Parameter name
    value - Parameter value

    setIntegerParameter

    public void setIntegerParameter(Object name,
                                    int value)
    Calls setParameter converting value to an Integer object.

    Specified by:
    setIntegerParameter in interface BaseConfiguration
    Parameters:
    name - Parameter name
    value - Parameter value

    setStringParameter

    public void setStringParameter(Object name,
                                   String value)
    Calls setParameter.

    Specified by:
    setStringParameter in interface BaseConfiguration
    Parameters:
    name - Parameter name
    value - Parameter value

    getParameterPropertySource

    public String getParameterPropertySource(Object name)
    Description copied from interface: BaseConfiguration
    Returns the user property name for a parameter.

    Specified by:
    getParameterPropertySource in interface BaseConfiguration
    Parameters:
    name - the parameter name
    Returns:
    the property name source for a given parameter name. If the parameter name is not associated with a user property then null is returned.

    getParameterPropertySourceFromValue

    public String getParameterPropertySourceFromValue(Object value)
    Parameters:
    value - parameter value
    Returns:
    the parameter property source. Also converts the old property source to the new Parameter substitution format.

    setParameterPropertySource

    public void setParameterPropertySource(Object name,
                                           String propertySource)
    Associates a parameter name with a user property.

    Specified by:
    setParameterPropertySource in interface BaseConfiguration
    Parameters:
    name - parameter name
    propertySource - parameter property source

    expandPropertyValue

    public Object expandPropertyValue(Object name,
                                      Object value)
    Substitutes the parameter value with a user property value.

    Parameters:
    name - parameter name
    value - parameter value
    Returns:
    expanded property value.

    expandPropertyValue

    public Object expandPropertyValue(Object name,
                                      Object value,
                                      List<String> cref)
    Substitutes the parameter value with a user property value.

    Parameters:
    name - parameter name
    value - parameter value
    cref - The circular references list of previously used config object expressions
    Returns:
    a valid substituted value; if error occurs returns an Exception object.

    toEntry

    public Object toEntry()
                   throws Exception
    This method returns a Entry object constructed from the internal data structure. Default implementation simply copies every attribute to/from entry using String values.

    Specified by:
    toEntry in interface BaseConfiguration
    Returns:
    The entry representing the internal data.
    Throws:
    Exception

    fromEntry

    public void fromEntry(Object entry)
                   throws Exception
    This method populates this object's internal data with the data from a Entry object.

    Specified by:
    fromEntry in interface BaseConfiguration
    Parameters:
    entry - The entry containing data.
    Throws:
    Exception

    toString

    public String toString()
    Answers a string containing the name of the config.

    Overrides:
    toString in class Object
    Returns:
    a printable representation of the name

    setMetamergeConfig

    public void setMetamergeConfig(MetamergeConfig mc)
    Sets the MetamergeConfig object to which this object belongs.

    Specified by:
    setMetamergeConfig in interface BaseConfiguration
    Parameters:
    mc - The new metamergeConfig object

    getMetamergeConfig

    public MetamergeConfig getMetamergeConfig()
    Gets the MetamergeConfig object to which this object belongs.

    Specified by:
    getMetamergeConfig in interface BaseConfiguration
    Returns:
    The metamergeConfig object

    getDebug

    public boolean getDebug()
    Returns the debug flag for the object.

    Specified by:
    getDebug in interface BaseConfiguration
    Returns:
    The debug value.

    getDebug

    public boolean getDebug(boolean defval)
    Returns the debug flag for the object.

    Specified by:
    getDebug in interface BaseConfiguration
    Parameters:
    defval - The value to be returned, if the debug parameter cannot be found
    Returns:
    The debug value.

    setDebug

    public void setDebug(boolean debug)
    Sets the debug flag for the object.

    Specified by:
    setDebug in interface BaseConfiguration
    Parameters:
    debug - The new debug value

    getDebugBreak

    public boolean getDebugBreak(boolean defval)
    Gets the debugBreak attribute of this object.

    Specified by:
    getDebugBreak in interface BaseConfiguration
    Parameters:
    defval - The value to be returned, if the debugBreak parameter cannot be found
    Returns:
    The debugBreak value.

    setDebugBreak

    public void setDebugBreak(boolean debug)
    Sets the debugBreak attribute of this object.

    Specified by:
    setDebugBreak in interface BaseConfiguration
    Parameters:
    debug - The new debugBreak value.

    getScript

    public String getScript()
    Gets the script attribute of this object.

    Specified by:
    getScript in interface BaseConfiguration
    Returns:
    The script value.

    setScript

    public void setScript(String script)
    Sets the script attribute of this object.

    Specified by:
    setScript in interface BaseConfiguration
    Parameters:
    script - The new script value

    getScriptEngine

    public String getScriptEngine()
    Gets the ScriptEngine attribute of this object.

    Specified by:
    getScriptEngine in interface BaseConfiguration
    Returns:
    The ScriptEngine value.

    setScriptEngine

    public void setScriptEngine(String engine)
    Sets the ScriptEngine attribute of this object.

    Specified by:
    setScriptEngine in interface BaseConfiguration
    Parameters:
    engine - The new ScriptEngine value

    getNullBehavior

    public String getNullBehavior()
    Gets the nullBehavior attribute of this object.

    Specified by:
    getNullBehavior in interface BaseConfiguration
    Returns:
    The nullBehavior value.

    getNullBehaviorValue

    public String getNullBehaviorValue()
    Gets the nullBehaviorValue attribute of this object.

    Specified by:
    getNullBehaviorValue in interface BaseConfiguration
    Returns:
    The nullBehaviorValue value.

    setNullBehavior

    public void setNullBehavior(String nb)
    Sets the nullBehavior attribute of this object.

    Specified by:
    setNullBehavior in interface BaseConfiguration
    Parameters:
    nb - The new nullBehavior value

    setNullBehaviorValue

    public void setNullBehaviorValue(String nbv)
    Sets the nullBehaviorValue attribute of this object.

    Specified by:
    setNullBehaviorValue in interface BaseConfiguration
    Parameters:
    nbv - The new nullBehaviorValue value

    getNullDefinition

    public String getNullDefinition()
    Gets the nullDefinition attribute of the BaseConfiguration object

    Specified by:
    getNullDefinition in interface BaseConfiguration
    Returns:
    The nullDefinition value

    getNullDefinitionValue

    public String getNullDefinitionValue()
    Gets the nullDefinitionValue attribute of the BaseConfiguration object

    Specified by:
    getNullDefinitionValue in interface BaseConfiguration
    Returns:
    The nullDefinitionValue value

    setNullDefinition

    public void setNullDefinition(String nb)
    Sets the nullDefinition attribute of the BaseConfiguration object

    Specified by:
    setNullDefinition in interface BaseConfiguration
    Parameters:
    nb - The new nullBehavior value

    setNullDefinitionValue

    public void setNullDefinitionValue(String nbv)
    Sets the nullDefinitionValue attribute of the BaseConfiguration object

    Specified by:
    setNullDefinitionValue in interface BaseConfiguration
    Parameters:
    nbv - The new nullBehaviorValue value

    getEnabled

    public boolean getEnabled()
    Gets the enabled attribute of this object.

    Specified by:
    getEnabled in interface BaseConfiguration
    Returns:
    The nullBehaviorValue value.

    setEnabled

    public void setEnabled(boolean autoStart)
    Sets the enabled attribute of this object.

    Specified by:
    setEnabled in interface BaseConfiguration
    Parameters:
    autoStart - true for enabling; false otherwise.

    willExpandProps

    public boolean willExpandProps()
    Returns:
    true if this object will expand the external properties; false otherwise.

    willUseInherited

    public boolean willUseInherited()
    Returns:
    true if this object will enable inherited access; false otherwise.

    getClone

    public Object getClone()
                    throws Exception

    Specified by:
    getClone in interface BaseConfiguration
    Returns:
    a cloned version of this object.
    Throws:
    Exception

    getLogEnabled

    public boolean getLogEnabled()
    Gets the log enabled attribute of this object.

    Specified by:
    getLogEnabled in interface BaseConfiguration
    Returns:
    The nullBehaviorValue value.

    setLogEnabled

    public void setLogEnabled(boolean enabled)
    Sets the log enabled attribute of this object.

    Specified by:
    setLogEnabled in interface BaseConfiguration
    Parameters:
    enabled - true for enabled log; false otherwise.

    setUserComment

    public void setUserComment(String comment)
    Sets the user defined comment string.

    Specified by:
    setUserComment in interface BaseConfiguration
    Parameters:
    comment - new value for user comment

    getUserComment

    public String getUserComment()

    Specified by:
    getUserComment in interface BaseConfiguration
    Returns:
    the user defined comment string.

    getSubstitutionMap

    public Map<String,Object> getSubstitutionMap()
    Specified by:
    getSubstitutionMap in interface BaseConfiguration
    Returns:
    the Map object containing available objects for param substitution.

    setSubstitutionMap

    public void setSubstitutionMap(Map<String,Object> map)
    Sets the substitution map for this configuration object

    Specified by:
    setSubstitutionMap in interface BaseConfiguration
    Parameters:
    map - the new substitution map

    flatten

    public boolean flatten(List<String> excludedNS)
                    throws 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 interface BaseConfiguration
    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:
    Exception

    willFlatten

    public boolean willFlatten(List<String> excludedNS)

    Specified by:
    willFlatten in interface BaseConfiguration
    Parameters:
    excludedNS - List of namespaces to exclude from flattening
    Returns:
    true if this object will attempt flattening given the provided excluded namespaces.

    getReferences

    public List<String> getReferences(List<String> list)

    Specified by:
    getReferences in interface BaseConfiguration
    Parameters:
    list - If non-null, the object must use the provided list rather than creating its own
    Returns:
    a list of all references to other object from which this object or its children inherit from.

    search

    public List<Binding> search(String text,
                                int options,
                                int sizelimit)
    Searches a configuration object and optionally its children for a specific key or value.

    Specified by:
    search in interface BaseConfiguration
    Parameters:
    text - The search text
    options - Search options (oneLevel=1, exactCase=2, regExp=4, paramName=8)
    sizelimit - Max number of hits returned
    Returns:
    List of Binding objects containing results from the performed search.

    search

    public List<Binding> search(String text,
                                int options,
                                int sizelimit,
                                List<Binding> results)
    Searches a configuration object and optionally its children for a specific key or value.

    Specified by:
    search in interface BaseConfiguration
    Parameters:
    text - The search text
    options - Search options (oneLevel=1, exactCase=2, regExp=4, paramName=8)
    sizelimit - Max number of hits returned
    results - A list of results.
    Returns:
    the results from the performed search added into the provided results parameter.

    getChild

    public BaseConfiguration getChild(Object name)

    Specified by:
    getChild in interface BaseConfiguration
    Parameters:
    name - The name of the configuration object
    Returns:
    the configuration object named name.

    setChild

    public void setChild(Object name,
                         BaseConfiguration config)
    Associates a configuration object with a name in this configuration

    Specified by:
    setChild in interface BaseConfiguration
    Parameters:
    name - The name
    config - The configuration object

    getChildNames

    public List<String> getChildNames()
    Returns a list of names for all child configuration object

    Specified by:
    getChildNames in interface BaseConfiguration
    Returns:
    list of names

    nameForChild

    public String nameForChild(BaseConfiguration config)
    Returns the name for a configuration object

    Specified by:
    nameForChild in interface BaseConfiguration
    Parameters:
    config - The configuration object
    Returns:
    The name associated with config or null if not found

    getChildForPath

    public BaseConfiguration getChildForPath(String path)
                                      throws NameNotFoundException
    This method traverses the child hierarchy (from the top) and returns the configuration object associated with the path. This method will in effect split the path in its components and recursively call getChild() to drill down to the last object in the path.

    Specified by:
    getChildForPath in interface BaseConfiguration
    Parameters:
    path - The complete path to an object (as returned by getPath())
    Returns:
    The configuration object associated with the path
    Throws:
    NameNotFoundException - if the child could not be found.

    getPath

    public String getPath()
    This method returns the path to this object. The path can be used to traverse a hierarchy of configuration objects/configuration values. The preferred name is the parent's name for this configuration object since we use the getChild() method to map between names and config objects. We do this since the name of this object can be different than the parent's name for the object, which basically happens when the parent container has several objects with the same name.

    Specified by:
    getPath in interface BaseConfiguration
    Returns:
    The path to this configuration object

    detachFromParent

    public boolean detachFromParent()
    This method removes this objects from its parent container. If this cannot be removed from the parent the contents should be cleared (default implementation) and true be returned as if it were removed. If the object cannot be cleared or removed it should return false.

    Specified by:
    detachFromParent in interface BaseConfiguration
    Returns:
    true if this object was removed; false if it could not be removed.

    reattachToParent

    public boolean reattachToParent(int position)
    This method reattaches this object to its former parent.

    Specified by:
    reattachToParent in interface BaseConfiguration
    Returns:
    true if this object was reattached; false if not;

    isExpression

    public boolean isExpression(Object parameter)

    Specified by:
    isExpression in interface BaseConfiguration
    Parameters:
    parameter - name of the parameter
    Returns:
    true if the parameter is an expression.