com.pega.pegarules.parserule
Class XMLNode

java.lang.Object
  extended by com.pega.pegarules.parserule.XMLNode

public class XMLNode
extends java.lang.Object

Author:
rajashakerg This class provides convinient methods for creating node. Each XMLNode object represent one tag in the xml. Provides getter and setter methods. Used in SAX parsing. 15-Aug-08 golod Bug-14711 added appendToNodeValue method 1-Sep-06 islas B-21619 fixed SAX Parser results to match that of DOM Parser

Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String VERSION
           
 
Constructor Summary
XMLNode()
           
XMLNode(java.lang.String name)
          Method XMLNode create the object with name.
XMLNode(java.lang.String name, org.xml.sax.Attributes attributes)
          Method XMLNode create the object with name and attributes.
XMLNode(java.lang.String name, java.lang.String value)
          Method XMLNode create the object with name and value.
XMLNode(java.lang.String name, java.lang.String value, org.xml.sax.Attributes attributes)
          Method XMLNode create the object with name, value and attributes.
XMLNode(java.lang.String name, java.lang.String value, org.xml.sax.Attributes attributes, java.lang.String path)
          Method XMLNode create the object with name, value, attributes and path.
 
Method Summary
 XMLNode appendChild(XMLNode child)
           
 void appendToNodeValue(java.lang.String value)
          Method appendToNodeValue to append to the node value.
 XMLNode getAttributeNode(java.lang.String name)
          Method getAttributeNode to create a new XMLNode with name and value given the attribute name.
 org.xml.sax.Attributes getAttributes()
          Method getAttributes return the attributes.
 java.lang.String getAttributeValue(java.lang.String name)
          Method getAttributeValue finds the attribute with name and returns its value.
 XMLNodeList getChildNodes()
           
 XMLNode getFirstChild()
           
 XMLNode getLastChild()
           
 java.lang.String getNodeName()
          Method getNodeName returns the node name.
 java.lang.String getNodeValue()
          Method getNodeValue returns the node value.
 XMLNode getParentNode()
           
 java.lang.String getPath()
          Method getPath will return the path of the node.
 boolean hasChildNodes()
           
 void setAttributes(org.xml.sax.Attributes attributes)
          Method setAttributes sets the attributes of the node.
 void setNodeName(java.lang.String name)
          Method setNodeName sets the node name.
 void setNodeValue(java.lang.String value)
          Method setNodeValue to set the node value.
 void setParentNode(XMLNode parent)
           
 void setPath(java.lang.String path)
          Method setPath sets the path of the node.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
Constructor Detail

XMLNode

public XMLNode()

XMLNode

public XMLNode(java.lang.String name)
Method XMLNode create the object with name.

Parameters:
name - is the node name

XMLNode

public XMLNode(java.lang.String name,
               java.lang.String value)
Method XMLNode create the object with name and value.

Parameters:
name - is the node name
value - is the node value

XMLNode

public XMLNode(java.lang.String name,
               org.xml.sax.Attributes attributes)
Method XMLNode create the object with name and attributes.

Parameters:
name - is the node name
attributes - associated with node

XMLNode

public XMLNode(java.lang.String name,
               java.lang.String value,
               org.xml.sax.Attributes attributes)
Method XMLNode create the object with name, value and attributes.

Parameters:
name - is the node name
value - is the node value
attributes - associated with node.

XMLNode

public XMLNode(java.lang.String name,
               java.lang.String value,
               org.xml.sax.Attributes attributes,
               java.lang.String path)
Method XMLNode create the object with name, value, attributes and path.

Parameters:
name - is the node name
value - is the node value
attributes - associated with node.
path - is the path of the current node from root tag
Method Detail

setNodeName

public void setNodeName(java.lang.String name)
Method setNodeName sets the node name.

Parameters:
name - is the node name

getNodeName

public java.lang.String getNodeName()
Method getNodeName returns the node name.

Returns:
String

getNodeValue

public java.lang.String getNodeValue()
Method getNodeValue returns the node value.

Returns:
String

setNodeValue

public void setNodeValue(java.lang.String value)
Method setNodeValue to set the node value.

Parameters:
value -

appendToNodeValue

public void appendToNodeValue(java.lang.String value)
Method appendToNodeValue to append to the node value.

Parameters:
value -

setAttributes

public void setAttributes(org.xml.sax.Attributes attributes)
Method setAttributes sets the attributes of the node.

Parameters:
attributes -

getAttributes

public org.xml.sax.Attributes getAttributes()
Method getAttributes return the attributes.

Returns:
Attributes

getPath

public java.lang.String getPath()
Method getPath will return the path of the node.

Returns:
String

setPath

public void setPath(java.lang.String path)
Method setPath sets the path of the node.

Parameters:
path -

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String name)
Method getAttributeValue finds the attribute with name and returns its value.

Parameters:
name - is the attribute name to find its value
Returns:
String empty if attribute with name is not found otherwise return the value of the attribute.

getAttributeNode

public XMLNode getAttributeNode(java.lang.String name)
Method getAttributeNode to create a new XMLNode with name and value given the attribute name.

Parameters:
name - is the attribute name.
Returns:
XMLNode

appendChild

public XMLNode appendChild(XMLNode child)

getChildNodes

public XMLNodeList getChildNodes()

getFirstChild

public XMLNode getFirstChild()

getLastChild

public XMLNode getLastChild()

getParentNode

public XMLNode getParentNode()

hasChildNodes

public boolean hasChildNodes()

setParentNode

public void setParentNode(XMLNode parent)


Copyright © 2012 Pegasystems Inc. All Rights Reserved.