org.merlotxml.util.xml
Class FieldNode

java.lang.Object
  extended byorg.merlotxml.util.xml.FieldNode

public class FieldNode
extends java.lang.Object

A place holder for the org.w3c.dom.Node that would represent a field - either an attribute (org.w3c.dom.Attr) or the simple content #text (org.w3c.dom.Text). The place holder is necessary because the Node may be null if it doesn't yet have a value.

Author:
Evert Hoff

Field Summary
protected static int _debugLevel
           
protected  org.w3c.dom.Element _element
           
protected  java.lang.String _fieldName
           
protected  org.w3c.dom.Node _node
           
 
Constructor Summary
protected FieldNode()
           
protected FieldNode(org.w3c.dom.Element element, org.w3c.dom.Node node, java.lang.String fieldName)
           
 
Method Summary
protected static void debug(int level, java.lang.String message)
           
 boolean equals(java.lang.Object o)
           
static FieldNode getFieldNode(org.w3c.dom.Element element, org.w3c.dom.Node node, java.lang.String fieldName)
          Gets a FieldNode that corresponds to these parameters.
static FieldNode getFieldNode(org.w3c.dom.Node node)
          Gets a FieldNode that corresponds to a non-null Node.
 org.w3c.dom.Node getNode()
          Gets the Node.
 java.lang.String getNodeName()
          Same as the org.w3c.dom.Node method.
 java.lang.String getNodeValue()
          Same as the org.w3c.dom.Node method.
 org.w3c.dom.Node getParentNode()
          Same as the org.w3c.dom.Node method.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_debugLevel

protected static int _debugLevel

_node

protected org.w3c.dom.Node _node

_element

protected org.w3c.dom.Element _element

_fieldName

protected java.lang.String _fieldName
Constructor Detail

FieldNode

protected FieldNode()

FieldNode

protected FieldNode(org.w3c.dom.Element element,
                    org.w3c.dom.Node node,
                    java.lang.String fieldName)
Method Detail

debug

protected static void debug(int level,
                            java.lang.String message)

getFieldNode

public static FieldNode getFieldNode(org.w3c.dom.Node node)
Gets a FieldNode that corresponds to a non-null Node.

Parameters:
node - The Attr or Text Node.
Returns:
The corresponding FieldNode or null.

getFieldNode

public static FieldNode getFieldNode(org.w3c.dom.Element element,
                                     org.w3c.dom.Node node,
                                     java.lang.String fieldName)
Gets a FieldNode that corresponds to these parameters.

Parameters:
element - The owner element of the field.
node - The Node for this field or null.
fieldName - The node name of the field if the Node is not given.
Returns:
FieldNode

getParentNode

public org.w3c.dom.Node getParentNode()
Same as the org.w3c.dom.Node method.

Returns:
Node

getNodeName

public java.lang.String getNodeName()
Same as the org.w3c.dom.Node method.

Returns:
String

getNodeValue

public java.lang.String getNodeValue()
Same as the org.w3c.dom.Node method.

Returns:
String

getNode

public org.w3c.dom.Node getNode()
Gets the Node. If it was null, but has in the meantime been created, this will return the current Node.

Returns:
Node

equals

public boolean equals(java.lang.Object o)

toString

public java.lang.String toString()