Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.hivemind.impl
Class ElementImpl  view ElementImpl download ElementImpl.java

java.lang.Object
  extended byorg.apache.hivemind.impl.BaseLocatable
      extended byorg.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.


Field Summary
private  java.util.List _attributes
           
private  java.util.Map _attributesMap
           
private  java.lang.String _content
           
private  java.lang.String _elementName
           
private  java.util.List _elements
           
private  java.util.List _safeAttributes
           
private  java.util.List _safeElements
           
 
Fields inherited from class org.apache.hivemind.impl.BaseLocatable
 
Constructor Summary
ElementImpl()
           
 
Method Summary
 void addAttribute(org.apache.hivemind.Attribute attribute)
           
 void addElement(org.apache.hivemind.Element element)
           
 java.util.List getAttributes()
          Returns an unmodifiable list of org.apache.hivemind.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 org.apache.hivemind.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()
          Convert this Object to a human-readable String.
 
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
 

Field Detail

_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
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: 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()).