java.lang.Object
org.apache.hivemind.impl.BaseLocatable
org.apache.hivemind.impl.ElementImpl
- All Implemented Interfaces:
- org.apache.hivemind.Element, org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder
- public final class ElementImpl
- extends BaseLocatable
- implements org.apache.hivemind.Element
Implementation of org.apache.hivemind.Element.
| Fields inherited from class org.apache.hivemind.impl.BaseLocatable |
|
_elementName
private java.lang.String _elementName
_content
private java.lang.String _content
_elements
private java.util.List _elements
_safeElements
private java.util.List _safeElements
_attributes
private java.util.List _attributes
_attributesMap
private java.util.Map _attributesMap
_safeAttributes
private java.util.List _safeAttributes
ElementImpl
public ElementImpl()
setElementName
public void setElementName(java.lang.String elementName)
getElementName
public java.lang.String getElementName()
- Description copied from interface:
org.apache.hivemind.Element
- Returns the name of the element, as in, the name of the tag for the element.
- Specified by:
getElementName in interface org.apache.hivemind.Element
addAttribute
public void addAttribute(org.apache.hivemind.Attribute attribute)
addElement
public void addElement(org.apache.hivemind.Element element)
getAttributes
public java.util.List getAttributes()
- Description copied from interface:
org.apache.hivemind.Element
- Returns an unmodifiable list of org.apache.hivemind.Attribute for this element.
May return an empty list, but won't return null. The attributes
are in no specific order.
- Specified by:
getAttributes in interface org.apache.hivemind.Element
getContent
public java.lang.String getContent()
- Description copied from interface:
org.apache.hivemind.Element
- Returns the content of the element. This is a concatination of
all the text directly enclosed by the element. Ignorable whitespace
is ignored. The content is trimmed of leading and trailing whitespace.
- Specified by:
getContent in interface org.apache.hivemind.Element
getElements
public java.util.List getElements()
- Description copied from interface:
org.apache.hivemind.Element
- Returns an unmodifiable list of org.apache.hivemind.Element directly contained
by this element. May return an empty list, but won't return null.
The elements are returned in the order in which they were encountered
in the XML.
- Specified by:
getElements in interface org.apache.hivemind.Element
getAttributeValue
public java.lang.String getAttributeValue(java.lang.String attributeName)
- Description copied from interface:
org.apache.hivemind.Element
- Returns the value for an attribute, or null if the attribute is not specified.
- Specified by:
getAttributeValue in interface org.apache.hivemind.Element
isEmpty
public boolean isEmpty()
- Description copied from interface:
org.apache.hivemind.Element
- Returns true if this element contains no other elements.
- Specified by:
isEmpty in interface org.apache.hivemind.Element
setContent
public void setContent(java.lang.String string)
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method
never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string
concatenation with this object. If the result is
null, string concatenation will instead
use "null".
The default implementation returns
getClass().getName() + "@" +
Integer.toHexString(hashCode()).