com.buildforge.services.common.api.xml
Class Element

java.lang.Object
  extended by com.buildforge.services.common.api.xml.Element
Direct Known Subclasses:
DataElement, PacketElement, RequestElement

public abstract class Element
extends java.lang.Object

Encapsulates the information from a generic XML element.


Field Summary
 Element parent
          The parent element, as specified in the constructor.
 
Constructor Summary
Element(Element parent)
          Creates a new element with the specified parent element.
 
Method Summary
abstract  void addChild(Element child)
          Adds a child element to this element.
static org.xml.sax.SAXException corrupted(java.lang.String msg)
          Convenience method for an element to form an exception that reports a violation of the protocol.
abstract  ElementType getElementType()
          Returns the type of element that this is.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

public final Element parent
The parent element, as specified in the constructor.

Constructor Detail

Element

public Element(Element parent)
Creates a new element with the specified parent element.

Method Detail

addChild

public abstract void addChild(Element child)
                       throws org.xml.sax.SAXException
Adds a child element to this element.

Throws:
org.xml.sax.SAXException

getElementType

public abstract ElementType getElementType()
Returns the type of element that this is.


corrupted

public static org.xml.sax.SAXException corrupted(java.lang.String msg)
Convenience method for an element to form an exception that reports a violation of the protocol.

Parameters:
msg - protocol violation details
Returns:
the new exception