public abstract class AbstractNodeElement extends Object implements NodeElement
NodeElement. Overrides equals(Object) and hashCode() methods by comparing the fully
qualified name of this element -- getFQName()| Modifier and Type | Field and Description |
|---|---|
protected List<NodeAttribute> |
attributes
List of attributes
|
protected List<NodeElement> |
children
List of child elements
|
protected String |
innerContent
the inner string content
|
protected boolean |
optional
Whether this element is optional
|
protected NodeElement |
parent
The parent
|
| Constructor and Description |
|---|
AbstractNodeElement(NodeElement parent)
Constructor accepting the parent of this element
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(NodeElementVisitor visitor)
Accepts an
NodeElementVisitor |
static void |
addAllFactoryConfigsAsChildElements(NodeElement element,
String name,
Collection<? extends FactoryConfiguration> factoryConfigurations)
Helper method that adds all the
FactoryConfiguration from the parameter as child elements by creating
FactoryConfigurationElement for each of them |
void |
addAttribute(NodeAttribute attribute)
Add an attribute
|
void |
addChildElement(NodeElement childElement)
Adds a child element.
|
boolean |
equals(Object obj) |
static List<FactoryConfigurationElement> |
getAllFactoryElements(NodeElement parent,
String name,
Collection<? extends FactoryConfiguration> factoryConfigurations)
Helper method that creates
FactoryConfigurationElement's from a collection of FactoryConfiguration's |
List<NodeAttribute> |
getAttributes()
List of attributes of this element
|
List<NodeElement> |
getChildElements()
Returns the list of child elements.
|
String |
getFQName()
Same as calling
NodeElement.getFQName(String) with the string "." |
String |
getFQName(String delimiter)
The fully qualified name of the element.
|
String |
getInnerContent()
The inner content of this element as string.
|
abstract String |
getName()
The name of the element
|
NodeElement |
getParent()
Returns the parent of this element.
|
boolean |
hasChildren()
Returns true if there is at least one child
|
int |
hashCode() |
boolean |
isOptional()
Returns true if this element is optional
|
void |
setInnerContent(String content)
Sets the inner content of this element
|
void |
setOptional(boolean optional)
Sets optional or not
|
String |
toString() |
protected final List<NodeAttribute> attributes
protected final List<NodeElement> children
protected NodeElement parent
protected boolean optional
protected String innerContent
public AbstractNodeElement(NodeElement parent)
parent - public abstract String getName()
getName in interface NodeElementpublic NodeElement getParent()
getParent in interface NodeElementpublic List<NodeAttribute> getAttributes()
getAttributes in interface NodeElementpublic List<NodeElement> getChildElements()
getChildElements in interface NodeElementpublic void addAttribute(NodeAttribute attribute)
addAttribute in interface NodeElementattribute - add an attributepublic void addChildElement(NodeElement childElement)
addChildElement in interface NodeElementchildElement - adds a child elementpublic boolean isOptional()
isOptional in interface NodeElementpublic void setOptional(boolean optional)
setOptional in interface NodeElementpublic boolean hasChildren()
hasChildren in interface NodeElementpublic String getInnerContent()
getInnerContent in interface NodeElementpublic void setInnerContent(String content)
setInnerContent in interface NodeElementpublic static void addAllFactoryConfigsAsChildElements(NodeElement element, String name, Collection<? extends FactoryConfiguration> factoryConfigurations)
FactoryConfiguration from the parameter as child elements by creating
FactoryConfigurationElement for each of themelement - the element in which the child elements will be addedname - name to be used for the child element(s)factoryConfigurations - the FactoryConfiguration'spublic static List<FactoryConfigurationElement> getAllFactoryElements(NodeElement parent, String name, Collection<? extends FactoryConfiguration> factoryConfigurations)
FactoryConfigurationElement's from a collection of FactoryConfiguration'sparent - the parent for each of the create FactoryConfigurationElementname - name of the element(s)factoryConfigurations - the FactoryConfiguration'sFactoryConfigurationElementpublic String getFQName()
NodeElement.getFQName(String) with the string "."getFQName in interface NodeElementpublic String getFQName(String delimiter)
delimiter stringgetFQName in interface NodeElementpublic void accept(NodeElementVisitor visitor)
NodeElementVisitoraccept in interface NodeElementvisitor - the visitor whose visit methods will be calledCopyright © 2003-2014 Terracotta, Inc.. All Rights Reserved.