Interface NodeElement
-
- All Known Implementing Classes:
AbstractNodeElement,CacheConfigurationElement,CacheWriterConfigurationElement,ConfigurationElement,CopyStrategyConfigurationElement,DefaultCacheConfigurationElement,DiskStoreConfigurationElement,ElementValueComparatorConfigurationElement,FactoryConfigurationElement,ManagementRESTServiceConfigurationElement,NonstopConfigurationElement,PersistenceConfigurationElement,PinningConfigurationElement,SearchableConfigurationElement,SimpleNodeElement,SizeOfPolicyConfigurationElement,TerracottaConfigConfigurationElement,TerracottaConfigurationElement,TimeoutBehaviorConfigurationElement
public interface NodeElementInterface that abstracts the idea of an element. An element has a name, list ofNodeAttribute's, a parent element and child elements- Author:
- Abhishek Sanoujam
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaccept(NodeElementVisitor visitor)Accepts anNodeElementVisitorvoidaddAttribute(NodeAttribute attribute)Add an attributevoidaddChildElement(NodeElement childElement)Adds a child element.java.util.List<NodeAttribute>getAttributes()List of attributes of this elementjava.util.List<NodeElement>getChildElements()Returns the list of child elements.java.lang.StringgetFQName()Same as callinggetFQName(String)with the string "."java.lang.StringgetFQName(java.lang.String delimiter)The fully qualified name of the element.java.lang.StringgetInnerContent()The inner content of this element as string.java.lang.StringgetName()The name of the elementNodeElementgetParent()Returns the parent of this element.booleanhasChildren()Returns true if there is at least one childbooleanisOptional()Returns true if this element is optionalvoidsetInnerContent(java.lang.String content)Sets the inner content of this elementvoidsetOptional(boolean optional)Sets optional or not
-
-
-
Method Detail
-
getName
java.lang.String getName()
The name of the element- Returns:
- Name of the element
-
getFQName
java.lang.String getFQName()
Same as callinggetFQName(String)with the string "."- Returns:
- the fully qualified name of this element
-
getFQName
java.lang.String getFQName(java.lang.String delimiter)
The fully qualified name of the element. The fully qualified name of the name is the name from the root element till this element separated by thedelimiterstring- Parameters:
delimiter-- Returns:
- the fully qualified name of this element separated by delimiter
-
getAttributes
java.util.List<NodeAttribute> getAttributes()
List of attributes of this element- Returns:
- list of attributes of this element
-
getParent
NodeElement getParent()
Returns the parent of this element. May be null.- Returns:
- parent of this element. May be null.
-
getChildElements
java.util.List<NodeElement> getChildElements()
Returns the list of child elements.- Returns:
- the list of child elements
-
hasChildren
boolean hasChildren()
Returns true if there is at least one child- Returns:
- true if there is at least one child, otherwise false
-
getInnerContent
java.lang.String getInnerContent()
The inner content of this element as string. Does not include the child elements- Returns:
- inner content of this element as string. This does not include the child elements
-
addAttribute
void addAttribute(NodeAttribute attribute)
Add an attribute- Parameters:
attribute- add an attribute
-
addChildElement
void addChildElement(NodeElement childElement)
Adds a child element.- Parameters:
childElement- adds a child element
-
accept
void accept(NodeElementVisitor visitor)
Accepts anNodeElementVisitor- Parameters:
visitor- the visitor whose visit methods will be called
-
isOptional
boolean isOptional()
Returns true if this element is optional- Returns:
- true if this element is optional
-
setOptional
void setOptional(boolean optional)
Sets optional or not- Parameters:
optional-
-
setInnerContent
void setInnerContent(java.lang.String content)
Sets the inner content of this element- Parameters:
content-
-
-