sjg.xml
Class Element

java.lang.Object
  extended by sjg.xml.Element

public class Element
extends java.lang.Object

Class that represents an XML element.


Method Summary
 java.util.Enumeration elements()
          Returns an enumeration over the mixed contents of this element - of type String or Element.
 java.util.Enumeration elements(java.lang.String name)
          Returns an enumeration over the subelements of this element that have the given name.
 Attribute getAttribute(java.lang.String name)
          Returns the attribute given a name.
 java.lang.String getContents()
          Returns a textual representation of the contents of this element.
 java.lang.String getName()
          Returns the name of this element.
 Element getParent()
          Returns the parent element of this element.
 boolean hasAttribute(java.lang.String name)
          Returns whether an attribute of a given name exists.
 java.lang.String toString()
          Returns a textual representation of this element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getAttribute

public Attribute getAttribute(java.lang.String name)
Returns the attribute given a name.


hasAttribute

public boolean hasAttribute(java.lang.String name)
Returns whether an attribute of a given name exists.


elements

public java.util.Enumeration elements()
Returns an enumeration over the mixed contents of this element - of type String or Element.


elements

public java.util.Enumeration elements(java.lang.String name)
Returns an enumeration over the subelements of this element that have the given name.


getName

public java.lang.String getName()
Returns the name of this element.


getParent

public Element getParent()
Returns the parent element of this element. If no parent then null is returned.


getContents

public java.lang.String getContents()
Returns a textual representation of the contents of this element.


toString

public java.lang.String toString()
Returns a textual representation of this element.

Overrides:
toString in class java.lang.Object