com.dat.xset
Class XSet

java.lang.Object
  |
  +--com.dat.xset.XSet
All Implemented Interfaces:
com.d_a_t.expeval.ExpressionContext

public class XSet
extends java.lang.Object
implements com.d_a_t.expeval.ExpressionContext

An XSet is a lightweight wrapper around any node in an XML DOM (Document Object Model) tree which provides a rich set for methods to:

An XSet is intially constructed by wrapping it around any node in the DOM tree. The node that it is wrapped around is the reference node for XPATH expressions used to navigate the DOM tree. Methods getSet and forEach will return new XSet objects wrapped around their referenced DOM nodes.

The getXXX methods retrieve the content from the DOM tree. You can retrieve content from either the wrapped DOM node or from the node referenced by an XPath expression relative to the wrapped DOM node.

The getXXX methods will attempt to convert the content to the specified Java type. This may result in a NullPointerException in the event that a referenced node is not found, or a standard conversion exception in the event that the content is not suitable for conversion to the requested Java type. For numeric Java types, a default value may specified in the event that a referenced node is not found.

Example:

       XSet order = new XSet(orderDomDocument);
       String customerName = order.getString("/order/customer/name");
 

Supported XPath expressions:

Names used in XPATH expression to getXXX methods are case sensitive. When performing a getXXX using an element name, if several elements or attribute have the same name, then the content of the first matching element/attribute will be returned.

The setXXX methods assign content to a node in the DOM tree. You can assign content to either the wrapped DOM node or to the node referenced by an XPath expression relative to the wrapped DOM node. If an XPath expression is used and the referenced node is not found then a NullPointerException will be thrown. To create nodes while assigning content, use the appendXXX, insertXXXBefore, insertXXXAfter methods.

The appendXXX methods will create a new element or attribute, assign it content, and append it as the last child of the referenced parent. The appendXXXX method is an extended XPath expression. That is all names except for the last name in the expression are used to reference an existing DOM node which will be used as the parent node. The last name in the expression will be the name of the element or attribute to be created. If the last name is prefixed with "@" then an attribute will be created, otherwise an element will be created. If only a single name is given, then the parent node will be the wrapped DOM node of the XSet. If a parent node cannot be found, then a NullPointerException will be thrown.

See Also:
XSets

Inner Class Summary
static class XSet.XSetAttributeField
           
static class XSet.XSetContentField
           
static class XSet.XSetField
          Allows field access to elements of a document.
 
Constructor Summary
XSet(com.dat.xset.Node node)
          Construct a new XSet wrapped around a DOM node.
XSet(com.dat.xset.Node node, boolean setAsRoot)
           
 
Method Summary
 void addListener(java.lang.String listenerTag, XSetListener listener)
           
 XSet[] all(java.lang.String xpathExpr)
           
 void appendByte(java.lang.String select, byte value)
          Append new element node or attribute node as the last child of the referenced parent, and set its content using a Java byte.
 XSet appendCopy(XSet source)
          Append a copy of a DOM subtree as the last child of the wrapped DOM node.
 void appendDouble(java.lang.String select, double value)
          Append new element node or attribute node as the last child of the referenced parent, and set its content using a Java double.
 void appendFloat(java.lang.String select, float value)
          Append new element node or attribute node as the last child of the referenced parent, and set its content using a Java float.
 void appendInt(java.lang.String select, int value)
          Append new element node or attribute node as the last child of the referenced parent, and set its content using a Java int.
 void appendLong(java.lang.String select, long value)
          Append new element node or attribute node as the last child of the referenced parent, and set its content using a Java long.
 XSet appendNewSet(java.lang.String select)
          Append an empty new element node as the last child of the wrapped DOM node.
 void appendShort(java.lang.String select, short value)
          Append new element node or attribute node as the last child of the referenced parent, and set its content using a Java short.
 XSet appendString(java.lang.String select, java.lang.String value)
          Append new element node or attribute node as the last child of the referenced parent, and set its content using a Java String.
 void applyTemplates()
           
 void applyTemplates(java.lang.String select)
           
 java.lang.String attribute(java.lang.String name)
           
 java.lang.String content()
           
static XSet createDocument()
          Create a new document.
static XSet createDocument(java.lang.String dtd, java.lang.String rootElement)
          Create a new document.
 XSets forEach(java.lang.String select)
          Get enumeration of XSet objects where each XSet is wrapped around a node which is satisfies the XPath expression relative to the current wrapped DOM node.
 XSets forEach(java.lang.String select, boolean forceResult)
           
 java.lang.String getAttribute(java.lang.String identifier)
          Gets the attribute value specified by identifier and returns it as a string.
 byte getByte()
          Get the content of the wrapped DOM node as a Java byte.
 byte getByte(byte defaultValue)
          Get the content of the wrapped DOM node as a Java byte.
 byte getByte(java.lang.String select)
          Get, as a Java byte, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 byte getByte(java.lang.String select, byte defaultValue)
          Get, as a Java byte, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 com.dat.xset.Document getDocument()
          Get the DOM Document of the document containing the wrapped DOM node of this XSet.
 java.lang.String getDocumentName()
          Get the name of the document containing the wrapped DOM node of this XSet.
 java.lang.String getDocumentXml()
          Get, as a String, the XML of the document containing the wrapped DOM node of this XSet.
 double getDouble()
          Get the content of the wrapped DOM node as a Java double.
 double getDouble(double defaultValue)
          Get the content of the wrapped DOM node as a Java double.
 double getDouble(java.lang.String select)
          Get, as a Java double, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 double getDouble(java.lang.String select, double defaultValue)
          Get, as a Java double, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 float getFloat()
          Get the content of the wrapped DOM node as a Java float.
 float getFloat(float defaultValue)
          Get the content of the wrapped DOM node as a Java float.
 float getFloat(java.lang.String select)
          Get, as a Java float, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 float getFloat(java.lang.String select, float defaultValue)
          Get, as a Java float, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 int getInt()
          Get the content of the wrapped DOM node as a Java int.
 int getInt(int defaultValue)
          Get the content of the wrapped DOM node as a Java int.
 int getInt(java.lang.String select)
          Get, as a Java int, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 int getInt(java.lang.String select, int defaultValue)
          Get, as a Java int, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 long getLong()
          Get the content of the wrapped DOM node as a Java long.
 long getLong(long defaultValue)
          Get the content of the wrapped DOM node as a Java long.
 long getLong(java.lang.String select)
          Get, as a Java long, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 long getLong(java.lang.String select, long defaultValue)
          Get, as a Java long, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 java.lang.String getName()
          Get the name of the wrapped DOM node.
 com.dat.xset.Node getNode()
          Get the wrapped DOM node.
 com.dat.xset.Node getRoot()
          Get the node designated as the root of the document containing the wrapped DOM node of this XSet.
 java.lang.String getRootXml()
          Get, as a String, the XML of the document defined by the logical root of the document containing the wrapped DOM node of this XSet.
 XSet getSet(java.lang.String select)
          Get a new XSet wrapped around the node referenced by an an XPath expression relative to the current wrapped DOM node.
 XSet getSetById(java.lang.String id)
          Get a new XSet wrapped around the node with a specific XML id.
 short getShort()
          Get the content of the wrapped DOM node as a Java short.
 short getShort(short defaultValue)
          Get the content of the wrapped DOM node as a Java short.
 short getShort(java.lang.String select)
          Get, as a Java short, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 short getShort(java.lang.String select, short defaultValue)
          Get, as a Java short, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
static com.d_a_t.expeval.ExpressionContext getStaticContext()
           
 java.lang.String getString()
          Get the content of the wrapped DOM node as a Java String.
 java.lang.String getString(java.lang.String select)
          Get, as a Java String, the content of the node reference by an an XPath expression relative to the wrapped DOM node.
 java.lang.String getXml()
          Get, as a String, the XML fragment of the subtree of the wrapped DOM node of this XSet.
 void insertAfterByte(java.lang.String name, byte value)
          Insert a new element node as a sibiling after the currently wrapped DOM node and set its content using a Java byte.
 void insertAfterDouble(java.lang.String name, double value)
          Insert a new element node as a sibiling after the currently wrapped DOM node and set its content using a Java double.
 void insertAfterFloat(java.lang.String name, float value)
          Insert a new element node as a sibiling after the currently wrapped DOM node and set its content using a Java float.
 void insertAfterInt(java.lang.String name, int value)
          Insert a new element node as a sibiling after the currently wrapped DOM node and set its content using a Java int.
 void insertAfterLong(java.lang.String name, long value)
          Insert a new element node as a sibiling after the currently wrapped DOM node and set its content using a Java long.
 XSet insertAfterNewSet(java.lang.String name)
          Insert an empty new element node as a sibiling after the currently wrapped DOM node.
 void insertAfterShort(java.lang.String name, short value)
          Insert a new element node as a sibiling after the currently wrapped DOM node and set its content using a Java short.
 XSet insertAfterString(java.lang.String name, java.lang.String value)
          Insert a new element node as a sibiling after the currently wrapped DOM node and set its content using a Java String.
 void insertBeforeByte(java.lang.String name, byte value)
          Insert a new element node as a sibiling before the currently wrapped DOM node and set its content using a Java byte.
 void insertBeforeDouble(java.lang.String name, double value)
          Insert a new element node as a sibiling before the currently wrapped DOM node and set its content using a Java double.
 void insertBeforeFloat(java.lang.String name, float value)
          Insert a new element node as a sibiling before the currently wrapped DOM node and set its content using a Java float.
 void insertBeforeInt(java.lang.String name, int value)
          Insert a new element node as a sibiling before the currently wrapped DOM node and set its content using a Java int.
 void insertBeforeLong(java.lang.String name, long value)
          Insert a new element node as a sibiling before the currently wrapped DOM node and set its content using a Java long.
 XSet insertBeforeNewSet(java.lang.String name)
          Insert a new empty element node as a sibiling before the currently wrapped DOM node.
 void insertBeforeShort(java.lang.String name, short value)
          Insert a new element node as a sibiling before the currently wrapped DOM node and set its content using a Java short.
 XSet insertBeforeString(java.lang.String name, java.lang.String value)
          Insert a new element node as a sibiling before the currently wrapped DOM node and set its content using a Java String.
 boolean isPrimative()
          Determine if the node is a primative element, ie, no subelements
static void main(java.lang.String[] args)
           
 void removeListener(java.lang.String listenerTag, XSetListener listener)
           
 java.lang.Class resolveClass(java.lang.String identifier)
          Returns the Class object identified by "identifier" or null if none exists.
 com.d_a_t.expeval.EEConstructor resolveConstructor(java.lang.Class constructorClass, java.lang.Class[] parameterTypes)
          Returns the EEConstruct object identified by "identifier" and the parameter type list or null if none exists.
 com.d_a_t.expeval.EEField resolveField(java.lang.String identifier)
          Returns the EEField object identified by "identifier" or null if none exists.
 com.d_a_t.expeval.EEMethod resolveMethod(java.lang.String identifier, java.lang.Class[] parameterTypes)
          Returns the EEMethod object identified by "identifier" and the parameter type list or null if none exists.
 void setByte(byte value)
          Set the content of the wrapped DOM node using a Java byte.
 void setByte(java.lang.String select, byte value)
          Set, using a Java byte, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 XSet setCopy(XSet source)
          Set children to a copy of a DOM subtree as the last child of the wrapped DOM node.
 void setDouble(double value)
          Set the content of the wrapped DOM node using a Java double.
 void setDouble(java.lang.String select, double value)
          Set, using a Java double, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 void setFloat(float value)
          Set the content of the wrapped DOM node using a Java float.
 void setFloat(java.lang.String select, float value)
          Set, using a Java float, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 void setInt(int value)
          Set the content of the wrapped DOM node using a Java int.
 void setInt(java.lang.String select, int value)
          Set, using a Java int, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 void setLong(long value)
          Set the content of the wrapped DOM node using a Java long.
 void setLong(java.lang.String select, long value)
          Set, using a Java long, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 void setObject(java.lang.String select, java.lang.Object value)
          Set, using any Java Object, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 void setShort(short value)
          Set the content of the wrapped DOM node using a Java short.
 void setShort(java.lang.String select, short value)
          Set, using a Java short, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 void setString(java.lang.String value)
          Set the content of the wrapped DOM node using a Java String.
 void setString(java.lang.String select, java.lang.String value)
          Set, using a Java String, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
 java.lang.String toString()
           
 java.lang.String valueOf()
          Get the content of the wrapped DOM node.
 java.lang.String valueOf(boolean allowNull)
          Get the content of the wrapped DOM node.
 java.lang.String valueOf(java.lang.String select)
          Get the content of the node reference by an an XPath expression relative to the wrapped DOM node.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XSet

public XSet(com.dat.xset.Node node)
Construct a new XSet wrapped around a DOM node.
Parameters:
node - the DOM node to be wrapped.

XSet

public XSet(com.dat.xset.Node node,
            boolean setAsRoot)
Method Detail

createDocument

public static XSet createDocument()
Create a new document.
Returns:
an XSet wrapped around the newly created document.

createDocument

public static XSet createDocument(java.lang.String dtd,
                                  java.lang.String rootElement)
Create a new document. The document will contain only the a single empty element, the root element.
Parameters:
dtd - the file name of a DTD for the document.
rootElement - the name of the root element. Must be a element name defined in the DTD.
Returns:
an XSet wrapped around the root node of the newly created document.

addListener

public void addListener(java.lang.String listenerTag,
                        XSetListener listener)

removeListener

public void removeListener(java.lang.String listenerTag,
                           XSetListener listener)

applyTemplates

public void applyTemplates()

applyTemplates

public void applyTemplates(java.lang.String select)

valueOf

public java.lang.String valueOf()
Get the content of the wrapped DOM node.
Returns:
the content.

valueOf

public java.lang.String valueOf(boolean allowNull)
Get the content of the wrapped DOM node.
Parameters:
allowNull - If true and there is no data, null will be returned; otherwise "" will be returned.
Returns:
the content.

isPrimative

public boolean isPrimative()
Determine if the node is a primative element, ie, no subelements
Returns:
true of the node is a primative element.

valueOf

public java.lang.String valueOf(java.lang.String select)
Get the content of the node reference by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
Returns:
the content of the referenced node; if referenced node is not found, the result is null

getSet

public XSet getSet(java.lang.String select)
Get a new XSet wrapped around the node referenced by an an XPath expression relative to the current wrapped DOM node.
Parameters:
select - the XPath expression.
Returns:
an XSet wrapped around the referenced node, if referenced node is not found, the result is null

getSetById

public XSet getSetById(java.lang.String id)
Get a new XSet wrapped around the node with a specific XML id.
Parameters:
id - the XML id of the desired node
Returns:
an XSet wrapped around the referenced node, if id is not found, the result is null

forEach

public XSets forEach(java.lang.String select)
Get enumeration of XSet objects where each XSet is wrapped around a node which is satisfies the XPath expression relative to the current wrapped DOM node. The XSets are returned in the order they are encountered in the document. Note:forEach will return an XSets Enumeration. An XSet fully inplements the Enumeration interface and also defines convenience methods which eliminate the need to cast the returned objects to XSet.
Parameters:
select - the XPath expression.
Returns:
an enumeration of XSet objects.

forEach

public XSets forEach(java.lang.String select,
                     boolean forceResult)

getName

public java.lang.String getName()
Get the name of the wrapped DOM node.
Returns:
the name of the wrapped DOM node.

getNode

public com.dat.xset.Node getNode()
Get the wrapped DOM node.
Returns:
the wrapped DOM node.

getString

public java.lang.String getString()
Get the content of the wrapped DOM node as a Java String.
Returns:
the content.

getAttribute

public java.lang.String getAttribute(java.lang.String identifier)
Gets the attribute value specified by identifier and returns it as a string.

getString

public java.lang.String getString(java.lang.String select)
Get, as a Java String, the content of the node reference by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
Returns:
the content of the referenced node; if referenced node is not found, the result is null

getInt

public int getInt()
Get the content of the wrapped DOM node as a Java int.
Returns:
the content.
Throws:
java.lang.NumberFormatException - if the content not contain a parsable integer.

getInt

public int getInt(int defaultValue)
Get the content of the wrapped DOM node as a Java int.
Parameters:
defaultValue - the value to be returned if the content does not contain a parsable integer.
Returns:
the content as a Java int or the default value in the event that the content does not contain a parsable integer.

getInt

public int getInt(java.lang.String select)
Get, as a Java int, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
Returns:
the content of the referenced node.
Throws:
java.lang.NumberFormatException - if the content not contain a parsable integer.
NullPointerException - if the referenced node could not be found.

getInt

public int getInt(java.lang.String select,
                  int defaultValue)
Get, as a Java int, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
defaultValue - the value to be returned if the content does not contain a parsable integer or the referenced node is not found.
Returns:
the content as a Java int or the default value in the event that the content does not contain a parsable integer or the referenced node is not found.

getLong

public long getLong()
Get the content of the wrapped DOM node as a Java long.
Returns:
the content.
Throws:
java.lang.NumberFormatException - if the content not contain a parsable long.

getLong

public long getLong(long defaultValue)
Get the content of the wrapped DOM node as a Java long.
Parameters:
defaultValue - the value to be returned if the content does not contain a parsable long.
Returns:
the content as a Java long or the default value in the event that the content does not contain a parsable long.

getLong

public long getLong(java.lang.String select)
Get, as a Java long, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
Returns:
the content of the referenced node.
Throws:
java.lang.NumberFormatException - if the content not contain a parsable long.
NullPointerException - if the referenced node could not be found.

getLong

public long getLong(java.lang.String select,
                    long defaultValue)
Get, as a Java long, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
defaultValue - the value to be returned if the content does not contain a parsable long or the referenced node is not found.
Returns:
the content as a Java long or the default value in the event that the content does not contain a parsable long or the referenced node is not found.

getShort

public short getShort()
Get the content of the wrapped DOM node as a Java short.
Returns:
the content.
Throws:
java.lang.NumberFormatException - if the content not contain a parsable short.

getShort

public short getShort(short defaultValue)
Get the content of the wrapped DOM node as a Java short.
Parameters:
defaultValue - the value to be returned if the content does not contain a parsable short.
Returns:
the content as a Java short or the default value in the event that the content does not contain a parsable short.

getShort

public short getShort(java.lang.String select)
Get, as a Java short, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
Returns:
the content of the referenced node.
Throws:
java.lang.NumberFormatException - if the content not contain a parsable short.
NullPointerException - if the referenced node could not be found.

getShort

public short getShort(java.lang.String select,
                      short defaultValue)
Get, as a Java short, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
defaultValue - the value to be returned if the content does not contain a parsable short or the referenced node is not found.
Returns:
the content as a Java short or the default value in the event that the content does not contain a parsable short or the referenced node is not found.

getByte

public byte getByte()
Get the content of the wrapped DOM node as a Java byte.
Returns:
the content.
Throws:
java.lang.NumberFormatException - if the content not contain a parsable byte.

getByte

public byte getByte(byte defaultValue)
Get the content of the wrapped DOM node as a Java byte.
Parameters:
defaultValue - the value to be returned if the content does not contain a parsable byte.
Returns:
the content as a Java byte or the default value in the event that the content does not contain a parsable byte.

getByte

public byte getByte(java.lang.String select)
Get, as a Java byte, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
Returns:
the content of the referenced node.
Throws:
java.lang.NumberFormatException - if the content not contain a parsable byte.
NullPointerException - if the referenced node could not be found.

getByte

public byte getByte(java.lang.String select,
                    byte defaultValue)
Get, as a Java byte, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
defaultValue - the value to be returned if the content does not contain a parsable byte or the referenced node is not found.
Returns:
the content as a Java byte or the default value in the event that the content does not contain a parsable byte or the referenced node is not found.

getDouble

public double getDouble()
Get the content of the wrapped DOM node as a Java double.
Returns:
the content.
Throws:
java.lang.NumberFormatException - if the content not contain a parsable double.

getDouble

public double getDouble(double defaultValue)
Get the content of the wrapped DOM node as a Java double.
Parameters:
defaultValue - the value to be returned if the content does not contain a parsable double.
Returns:
the content as a Java double or the default value in the event that the content does not contain a parsable double.

getDouble

public double getDouble(java.lang.String select)
Get, as a Java double, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
Returns:
the content of the referenced node.
Throws:
java.lang.NumberFormatException - if the content not contain a parsable double.
NullPointerException - if the referenced node could not be found.

getDouble

public double getDouble(java.lang.String select,
                        double defaultValue)
Get, as a Java double, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
defaultValue - the value to be returned if the content does not contain a parsable double or the referenced node is not found.
Returns:
the content as a Java double or the default value in the event that the content does not contain a parsable double or the referenced node is not found.

getFloat

public float getFloat()
Get the content of the wrapped DOM node as a Java float.
Returns:
the content.
Throws:
java.lang.NumberFormatException - if the content not contain a parsable float.

getFloat

public float getFloat(float defaultValue)
Get the content of the wrapped DOM node as a Java float.
Parameters:
defaultValue - the value to be returned if the content does not contain a parsable float.
Returns:
the content as a Java float or the default value in the event that the content does not contain a parsable float.

getFloat

public float getFloat(java.lang.String select)
Get, as a Java float, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
Returns:
the content of the referenced node.
Throws:
java.lang.NumberFormatException - if the content not contain a parsable float.
NullPointerException - if the referenced node could not be found.

getFloat

public float getFloat(java.lang.String select,
                      float defaultValue)
Get, as a Java float, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
defaultValue - the value to be returned if the content does not contain a parsable float or the referenced node is not found.
Returns:
the content as a Java float or the default value in the event that the content does not contain a parsable float or the referenced node is not found.

setString

public void setString(java.lang.String value)
Set the content of the wrapped DOM node using a Java String.
Parameters:
value - the new content

setString

public void setString(java.lang.String select,
                      java.lang.String value)
Set, using a Java String, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
value - the new content
Throws:
NullPointerException - if the referenced node could not be found.

setObject

public void setObject(java.lang.String select,
                      java.lang.Object value)
Set, using any Java Object, the content of the node referenced by an an XPath expression relative to the wrapped DOM node. The Java Object will be converted to String content using the object's toString method.
Parameters:
select - the XPath expression.
value - the new content
Throws:
NullPointerException - if the referenced node could not be found.

setInt

public void setInt(int value)
Set the content of the wrapped DOM node using a Java int.
Parameters:
value - the new content

setInt

public void setInt(java.lang.String select,
                   int value)
Set, using a Java int, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
value - the new content
Throws:
NullPointerException - if the referenced node could not be found.

setLong

public void setLong(long value)
Set the content of the wrapped DOM node using a Java long.
Parameters:
value - the new content

setLong

public void setLong(java.lang.String select,
                    long value)
Set, using a Java long, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
value - the new content
Throws:
NullPointerException - if the referenced node could not be found.

setShort

public void setShort(short value)
Set the content of the wrapped DOM node using a Java short.
Parameters:
value - the new content

setShort

public void setShort(java.lang.String select,
                     short value)
Set, using a Java short, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
value - the new content
Throws:
NullPointerException - if the referenced node could not be found.

setByte

public void setByte(byte value)
Set the content of the wrapped DOM node using a Java byte.
Parameters:
value - the new content

setByte

public void setByte(java.lang.String select,
                    byte value)
Set, using a Java byte, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
value - the new content
Throws:
NullPointerException - if the referenced node could not be found.

setDouble

public void setDouble(double value)
Set the content of the wrapped DOM node using a Java double.
Parameters:
value - the new content

setDouble

public void setDouble(java.lang.String select,
                      double value)
Set, using a Java double, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - the XPath expression.
value - the new content
Throws:
NullPointerException - if the referenced node could not be found.

setFloat

public void setFloat(float value)
Set the content of the wrapped DOM node using a Java float.
Parameters:
value - the new content

setFloat

public void setFloat(java.lang.String select,
                     float value)
Set, using a Java float, the content of the node referenced by an an XPath expression relative to the wrapped DOM node.
Parameters:
select - an XPath expression.
value - the new content
Throws:
NullPointerException - if the referenced node could not be found.

setCopy

public XSet setCopy(XSet source)
Set children to a copy of a DOM subtree as the last child of the wrapped DOM node.
Parameters:
source - an XSet wrapped around the root of the DOM subtree to be copied.

appendNewSet

public XSet appendNewSet(java.lang.String select)
Append an empty new element node as the last child of the wrapped DOM node.
Parameters:
select - an extended XPath expession.

appendCopy

public XSet appendCopy(XSet source)
Append a copy of a DOM subtree as the last child of the wrapped DOM node.
Parameters:
source - an XSet wrapped around the root of the DOM subtree to be copied.

appendString

public XSet appendString(java.lang.String select,
                         java.lang.String value)
Append new element node or attribute node as the last child of the referenced parent, and set its content using a Java String. The parent is referenced by the leading names of an extended XPath expression. The name of the new element or attribute is specified by the last name in an extended XPath expression. If the last name is prefixed with a "@" and attribute will be created, otherwise an element will be created.
Parameters:
select - an extended XPath expession.
value - the new content
Throws:
NullPointerException - if the referenced parent node could not be found.

appendInt

public void appendInt(java.lang.String select,
                      int value)
Append new element node or attribute node as the last child of the referenced parent, and set its content using a Java int. The parent is referenced by the leading names of an extended XPath expression. The name of the new element or attribute is specified by the last name in an extended XPath expression. If the last name is prefixed with a "@" and attribute will be created, otherwise an element will be created.
Parameters:
select - an extended XPath expession.
value - the new content
Throws:
NullPointerException - if the referenced parent node could not be found.

appendLong

public void appendLong(java.lang.String select,
                       long value)
Append new element node or attribute node as the last child of the referenced parent, and set its content using a Java long. The parent is referenced by the leading names of an extended XPath expression. The name of the new element or attribute is specified by the last name in an extended XPath expression. If the last name is prefixed with a "@" and attribute will be created, otherwise an element will be created.
Parameters:
select - an extended XPath expession.
value - the new content
Throws:
NullPointerException - if the referenced parent node could not be found.

appendShort

public void appendShort(java.lang.String select,
                        short value)
Append new element node or attribute node as the last child of the referenced parent, and set its content using a Java short. The parent is referenced by the leading names of an extended XPath expression. The name of the new element or attribute is specified by the last name in an extended XPath expression. If the last name is prefixed with a "@" and attribute will be created, otherwise an element will be created.
Parameters:
select - an extended XPath expession.
value - the new content
Throws:
NullPointerException - if the referenced parent node could not be found.

appendByte

public void appendByte(java.lang.String select,
                       byte value)
Append new element node or attribute node as the last child of the referenced parent, and set its content using a Java byte. The parent is referenced by the leading names of an extended XPath expression. The name of the new element or attribute is specified by the last name in an extended XPath expression. If the last name is prefixed with a "@" and attribute will be created, otherwise an element will be created.
Parameters:
select - an extended XPath expession.
value - the new content
Throws:
NullPointerException - if the referenced parent node could not be found.

appendDouble

public void appendDouble(java.lang.String select,
                         double value)
Append new element node or attribute node as the last child of the referenced parent, and set its content using a Java double. The parent is referenced by the leading names of an extended XPath expression. The name of the new element or attribute is specified by the last name in an extended XPath expression. If the last name is prefixed with a "@" and attribute will be created, otherwise an element will be created.
Parameters:
select - an extended XPath expession.
value - the new content
Throws:
NullPointerException - if the referenced parent node could not be found.

appendFloat

public void appendFloat(java.lang.String select,
                        float value)
Append new element node or attribute node as the last child of the referenced parent, and set its content using a Java float. The parent is referenced by the leading names of an extended XPath expression. The name of the new element or attribute is specified by the last name in an extended XPath expression. If the last name is prefixed with a "@" and attribute will be created, otherwise an element will be created.
Parameters:
select - an extended XPath expession.
value - the new content
Throws:
NullPointerException - if the referenced parent node could not be found.

insertAfterNewSet

public XSet insertAfterNewSet(java.lang.String name)
Insert an empty new element node as a sibiling after the currently wrapped DOM node.
Parameters:
name - the name of the new element.

insertAfterString

public XSet insertAfterString(java.lang.String name,
                              java.lang.String value)
Insert a new element node as a sibiling after the currently wrapped DOM node and set its content using a Java String.
Parameters:
name - the name of the new element.
value - the new content

insertAfterInt

public void insertAfterInt(java.lang.String name,
                           int value)
Insert a new element node as a sibiling after the currently wrapped DOM node and set its content using a Java int.
Parameters:
name - the name of the new element.
value - the new content

insertAfterLong

public void insertAfterLong(java.lang.String name,
                            long value)
Insert a new element node as a sibiling after the currently wrapped DOM node and set its content using a Java long.
Parameters:
name - the name of the new element.
value - the new content

insertAfterShort

public void insertAfterShort(java.lang.String name,
                             short value)
Insert a new element node as a sibiling after the currently wrapped DOM node and set its content using a Java short.
Parameters:
name - the name of the new element.
value - the new content

insertAfterByte

public void insertAfterByte(java.lang.String name,
                            byte value)
Insert a new element node as a sibiling after the currently wrapped DOM node and set its content using a Java byte.
Parameters:
name - the name of the new element.
value - the new content

insertAfterDouble

public void insertAfterDouble(java.lang.String name,
                              double value)
Insert a new element node as a sibiling after the currently wrapped DOM node and set its content using a Java double.
Parameters:
name - the name of the new element.
value - the new content

insertAfterFloat

public void insertAfterFloat(java.lang.String name,
                             float value)
Insert a new element node as a sibiling after the currently wrapped DOM node and set its content using a Java float.
Parameters:
name - the name of the new element.
value - the new content

insertBeforeNewSet

public XSet insertBeforeNewSet(java.lang.String name)
Insert a new empty element node as a sibiling before the currently wrapped DOM node.
Parameters:
name - the name of the new element.

insertBeforeString

public XSet insertBeforeString(java.lang.String name,
                               java.lang.String value)
Insert a new element node as a sibiling before the currently wrapped DOM node and set its content using a Java String.
Parameters:
name - the name of the new element.
value - the new content

insertBeforeInt

public void insertBeforeInt(java.lang.String name,
                            int value)
Insert a new element node as a sibiling before the currently wrapped DOM node and set its content using a Java int.
Parameters:
name - the name of the new element.
value - the new content

insertBeforeLong

public void insertBeforeLong(java.lang.String name,
                             long value)
Insert a new element node as a sibiling before the currently wrapped DOM node and set its content using a Java long.
Parameters:
name - the name of the new element.
value - the new content

insertBeforeShort

public void insertBeforeShort(java.lang.String name,
                              short value)
Insert a new element node as a sibiling before the currently wrapped DOM node and set its content using a Java short.
Parameters:
name - the name of the new element.
value - the new content

insertBeforeByte

public void insertBeforeByte(java.lang.String name,
                             byte value)
Insert a new element node as a sibiling before the currently wrapped DOM node and set its content using a Java byte.
Parameters:
name - the name of the new element.
value - the new content

insertBeforeDouble

public void insertBeforeDouble(java.lang.String name,
                               double value)
Insert a new element node as a sibiling before the currently wrapped DOM node and set its content using a Java double.
Parameters:
name - the name of the new element.
value - the new content

insertBeforeFloat

public void insertBeforeFloat(java.lang.String name,
                              float value)
Insert a new element node as a sibiling before the currently wrapped DOM node and set its content using a Java float.
Parameters:
name - the name of the new element.
value - the new content

getDocument

public com.dat.xset.Document getDocument()
Get the DOM Document of the document containing the wrapped DOM node of this XSet.
Returns:
the DOM document containing the wrapped DOM node.

getRoot

public com.dat.xset.Node getRoot()
Get the node designated as the root of the document containing the wrapped DOM node of this XSet.
Returns:
the DOM document containing the wrapped DOM node.

getXml

public java.lang.String getXml()
Get, as a String, the XML fragment of the subtree of the wrapped DOM node of this XSet.
Returns:
the XML fragment of the subtree of the wrapped DOM node of this XSet.

getDocumentName

public java.lang.String getDocumentName()
Get the name of the document containing the wrapped DOM node of this XSet.
Returns:
the name of the document containing the wrapped DOM node.

getDocumentXml

public java.lang.String getDocumentXml()
Get, as a String, the XML of the document containing the wrapped DOM node of this XSet.
Returns:
the XML of the document containing the wrapped DOM node.

getRootXml

public java.lang.String getRootXml()
Get, as a String, the XML of the document defined by the logical root of the document containing the wrapped DOM node of this XSet.
Returns:
the XML of the document containing the wrapped DOM node.

main

public static void main(java.lang.String[] args)

resolveField

public com.d_a_t.expeval.EEField resolveField(java.lang.String identifier)
                                       throws com.d_a_t.expeval.ExpressionException
Description copied from interface: com.d_a_t.expeval.ExpressionContext
Returns the EEField object identified by "identifier" or null if none exists.
Specified by:
resolveField in interface com.d_a_t.expeval.ExpressionContext

resolveConstructor

public com.d_a_t.expeval.EEConstructor resolveConstructor(java.lang.Class constructorClass,
                                                          java.lang.Class[] parameterTypes)
                                                   throws com.d_a_t.expeval.ExpressionException
Description copied from interface: com.d_a_t.expeval.ExpressionContext
Returns the EEConstruct object identified by "identifier" and the parameter type list or null if none exists.
Specified by:
resolveConstructor in interface com.d_a_t.expeval.ExpressionContext

resolveMethod

public com.d_a_t.expeval.EEMethod resolveMethod(java.lang.String identifier,
                                                java.lang.Class[] parameterTypes)
                                         throws com.d_a_t.expeval.ExpressionException
Description copied from interface: com.d_a_t.expeval.ExpressionContext
Returns the EEMethod object identified by "identifier" and the parameter type list or null if none exists.
Specified by:
resolveMethod in interface com.d_a_t.expeval.ExpressionContext

resolveClass

public java.lang.Class resolveClass(java.lang.String identifier)
                             throws com.d_a_t.expeval.ExpressionException
Description copied from interface: com.d_a_t.expeval.ExpressionContext
Returns the Class object identified by "identifier" or null if none exists.
Specified by:
resolveClass in interface com.d_a_t.expeval.ExpressionContext

getStaticContext

public static com.d_a_t.expeval.ExpressionContext getStaticContext()

all

public XSet[] all(java.lang.String xpathExpr)

attribute

public java.lang.String attribute(java.lang.String name)

content

public java.lang.String content()

toString

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