Package com.microstrategy.utils.config
Class AbstractElementList
- java.lang.Object
-
- com.microstrategy.utils.config.AbstractConfigurationElement
-
- com.microstrategy.utils.config.AbstractElementList
-
- All Implemented Interfaces:
ConfigurationElement
,ConfigurationFile
,java.lang.Cloneable
- Direct Known Subclasses:
AbstractStyleCatalogList
,BeanFactory.BeanMappingInfoList
,BeanFactory.BeanPackageInfoList
,ControllerInfoList
,EventArgumentInfoList
,EventHandlersCatalog
,EventInfoList
,ParameterInfoList
public abstract class AbstractElementList extends AbstractConfigurationElement
This is the base class for nodes that represents a list in a configuration file. Subclasses need to override thegetListClass()
andgetListNodeName()
for this class to automatically identify the children's name and class.- Since:
- MicroStrategy Web 9.0.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
AbstractConfigurationElement.FilteredList
-
-
Field Summary
-
Fields inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
ATT_CONFIG_SRC, ATT_DELETED, ATT_POSITION, ATT_PROTOTYPE, ATT_USE_DEFAULT
-
-
Constructor Summary
Constructors Constructor Description AbstractElementList()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clear()
Removes all child elements from this list.boolean
containsKey(java.lang.Object key)
Returnstrue
if the object with the given key is part of this list.ConfigurationElement
get(int index)
Returns the ConfigurationElement in theindex
position.ConfigurationElement
get(java.lang.Object key)
Returns the ConfigurationElement in theindex
position.protected java.lang.String
getKeyAttribute()
This method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override thegetKey
andsetKey
methods.protected AbstractConfigurationElement.FilteredList
getList()
Returns the ImplicitList associated with this list's node nameprotected abstract java.lang.Class
getListClass()
Returns theClass
items beloging to this list will be instance of.protected abstract java.lang.String
getListNodeName()
Returns the name of the node representing children of this list.boolean
isEmpty()
Returns true if this list contains no configuration elements.ConfigurationElement
put(ConfigurationElement child)
Adds the specified ConfigurationElement to the list.ConfigurationElement
put(java.lang.Object key, ConfigurationElement child)
Associates the specified value with the specified key in this list.int
size()
Retuns the number of currently available items.-
Methods inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
addFileSource, applyCustomization, applyCustomizations, cleanUpDeletedElements, clone, delete, deltas, deltas, equalAtts, equalElements, equalNodeValues, equals, equalsIncludingDeletedElements, exportAttributesToXML, exportElementsToXML, exportNodeValueToXML, getAttribute, getAttributes, getBoolAttribute, getChildKey, getConfigSrc, getDTDFileName, getElement, getElement, getElements, getFileLoader, getIntAttribute, getIntAttribute, getKey, getLineNumber, getList, getNextKey, getNodeName, getNodeValue, getNodeValue, getOrCreateElement, getParent, getPosition, getPrototype, getRegisteredClass, getSelfInitPath, getSource, getStrAttribute, getUseDefault, getXMLParserParameters, getXMLSerializerParameters, hashCode, hashCodeAtts, hashCodeElements, hashCodeNodeValues, hasRegisteredClass, initAttributesFromXML, initDefaultAttributes, initElementFromXML, initElementsFromXML, initFromFile, initFromResource, initFromXML, initFromXML, initNodeValueFromXML, initPrototype, isActive, isCustomized, isDeleted, isDirty, isInSource, isKeyAttribute, load, mergeChanges, newChildInstance, newSource, original, populate, printAttributes, printElements, printNodeValue, refreshLists, registerClass, registerElement, registerElement, registerElementList, reload, reloadPrototype, removeAttribute, removeDefaults, replaceList, restore, save, save, saveChangesAs, saveConfig, saveFlatXML, saveNode, saveSource, setAttribute, setBoolAttribute, setChildOriginals, setConfigSrc, setCustomized, setElement, setFileLoader, setIntAttribute, setKey, setLineNumber, setNodeName, setNodeValue, setPosition, setPrototype, setSelfInitPath, setStrAttribute, setUseDefault, setUseValidation, throwConfigParseException, toString, toXML, toXML, toXML, toXML, useNodeValue, useValidation
-
-
-
-
Method Detail
-
getKeyAttribute
protected java.lang.String getKeyAttribute()
Description copied from class:AbstractConfigurationElement
This method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override thegetKey
andsetKey
methods.- Specified by:
getKeyAttribute
in classAbstractConfigurationElement
-
getListClass
protected abstract java.lang.Class getListClass()
Returns theClass
items beloging to this list will be instance of.
-
getListNodeName
protected abstract java.lang.String getListNodeName()
Returns the name of the node representing children of this list.
-
containsKey
public boolean containsKey(java.lang.Object key)
Returnstrue
if the object with the given key is part of this list.
-
size
public int size()
Retuns the number of currently available items. This size doesn not include elements that have been removed.
-
isEmpty
public boolean isEmpty()
Returns true if this list contains no configuration elements.
-
get
public ConfigurationElement get(int index)
Returns the ConfigurationElement in theindex
position. Elements that have been deleted are not considered part of the list.
-
get
public ConfigurationElement get(java.lang.Object key)
Returns the ConfigurationElement in theindex
position. Elements that have been deleted are not considered part of the list.
-
put
public ConfigurationElement put(java.lang.Object key, ConfigurationElement child)
Associates the specified value with the specified key in this list. If the list previously contained a value for this key, the old value is replaced.- Parameters:
key
- key with which the specified value is to be associated.child
- value to be associated with the specified key.- Returns:
- previous value associated with specified key, or null if there was no mapping for key. A null return can also indicate that the HashMap previously associated null with the specified key.
-
put
public ConfigurationElement put(ConfigurationElement child)
Adds the specified ConfigurationElement to the list. The key to used is automatically retrieved from the element itself. If the list previously contained a value for this key, the old value is replaced.- Parameters:
child
- value to be associated with the specified key.- Returns:
- previous value associated with specified key, or null if there was no mapping for key. A null return can also indicate that the HashMap previously associated null with the specified key.
-
clear
public void clear()
Removes all child elements from this list.
-
getList
protected AbstractConfigurationElement.FilteredList getList()
Returns the ImplicitList associated with this list's node name
-
-