ehcache

net.sf.ehcache.config.generator.model
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 NodeElement

Interface that abstracts the idea of an element. An element has a name, list of NodeAttribute's, a parent element and child elements

Author:
Abhishek Sanoujam

Method Summary
 void accept(NodeElementVisitor visitor)
          Accepts an NodeElementVisitor
 void addAttribute(NodeAttribute attribute)
          Add an attribute
 void addChildElement(NodeElement childElement)
          Adds a child element.
 List<NodeAttribute> getAttributes()
          List of attributes of this element
 List<NodeElement> getChildElements()
          Returns the list of child elements.
 String getFQName()
          Same as calling 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.
 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
 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
 

Method Detail

getName

String getName()
The name of the element

Returns:
Name of the element

getFQName

String getFQName()
Same as calling getFQName(String) with the string "."

Returns:
the fully qualified name of this element

getFQName

String getFQName(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 the delimiter string

Parameters:
delimiter -
Returns:
the fully qualified name of this element separated by delimiter

getAttributes

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

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

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 an NodeElementVisitor

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(String content)
Sets the inner content of this element

Parameters:
content -

ehcache

Copyright 2001-2017, Terracotta, Inc.