org.apache.hivemind.impl
Class ElementImpl

java.lang.Object
  extended by org.apache.hivemind.impl.BaseLocatable
      extended by org.apache.hivemind.impl.ElementImpl
All Implemented Interfaces:
Element, Locatable, LocationHolder

public final class ElementImpl
extends BaseLocatable
implements Element

Implementation of Element.

Author:
Howard Lewis Ship

Constructor Summary
ElementImpl()
           
 
Method Summary
 void addAttribute(Attribute attribute)
           
 void addElement(Element element)
           
 java.util.List getAttributes()
          Returns an unmodifiable list of Attribute for this element.
 java.lang.String getAttributeValue(java.lang.String attributeName)
          Returns the value for an attribute, or null if the attribute is not specified.
 java.lang.String getContent()
          Returns the content of the element.
 java.lang.String getElementName()
          Returns the name of the element, as in, the name of the tag for the element.
 java.util.List getElements()
          Returns an unmodifiable list of Element directly contained by this element.
 boolean isEmpty()
          Returns true if this element contains no other elements.
 void setContent(java.lang.String string)
           
 void setElementName(java.lang.String elementName)
           
 java.lang.String toString()
           
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Constructor Detail

ElementImpl

public ElementImpl()
Method Detail

setElementName

public void setElementName(java.lang.String elementName)

getElementName

public java.lang.String getElementName()
Description copied from interface: Element
Returns the name of the element, as in, the name of the tag for the element.

Specified by:
getElementName in interface Element

addAttribute

public void addAttribute(Attribute attribute)

addElement

public void addElement(Element element)

getAttributes

public java.util.List getAttributes()
Description copied from interface: Element
Returns an unmodifiable list of 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 Element

getContent

public java.lang.String getContent()
Description copied from interface: 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 Element

getElements

public java.util.List getElements()
Description copied from interface: Element
Returns an unmodifiable list of 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 Element

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String attributeName)
Description copied from interface: Element
Returns the value for an attribute, or null if the attribute is not specified.

Specified by:
getAttributeValue in interface Element

isEmpty

public boolean isEmpty()
Description copied from interface: Element
Returns true if this element contains no other elements.

Specified by:
isEmpty in interface Element

setContent

public void setContent(java.lang.String string)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object