org.bibalex.daf.handlers.statusdatahandler
Class NameValueInfo

java.lang.Object
  extended by org.bibalex.daf.handlers.statusdatahandler.NameValueInfo

public class NameValueInfo
extends java.lang.Object

Represents a NameValue piece of information. This class is used to hold an Xml node on the form:
<Name>Value</Name> in an object oriented form.

Author:
Shehab.Kamal

Field Summary
 java.lang.String name
          Holds the name of the element.
 java.lang.String value
          Holds the value of the element.
 
Constructor Summary
NameValueInfo()
          Creates a new instance of NameValueInfo.
NameValueInfo(org.w3c.dom.Node node)
          Creates a new instance of NameValueInfo.
NameValueInfo(java.lang.String nodeRep)
          Creates a new instance of NameValueInfo.
NameValueInfo(java.lang.String name, java.lang.String value)
          Creates a new instance of NameValueInfo.
 
Method Summary
private  void createElementFromNode(org.w3c.dom.Node node)
          Creates the NameValueInfo by supplying its XmlNode represenation.
 java.lang.String toString()
          Returns the string representation of this object.
 java.lang.String toXmlString()
          Returns a String representing the NameValueInfo in xml format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public java.lang.String name
Holds the name of the element.


value

public java.lang.String value
Holds the value of the element. This field can be null.

Constructor Detail

NameValueInfo

public NameValueInfo()
Creates a new instance of NameValueInfo.


NameValueInfo

public NameValueInfo(java.lang.String name,
                     java.lang.String value)
Creates a new instance of NameValueInfo.

Parameters:
name - The name of the element.
value - The value of the element.

NameValueInfo

public NameValueInfo(org.w3c.dom.Node node)
              throws NameValueInfoException
Creates a new instance of NameValueInfo.

Parameters:
node - The Xml Node representing this element.
Throws:
NameValueInfoException - If the given node couldn't be parsed.

NameValueInfo

public NameValueInfo(java.lang.String nodeRep)
              throws NameValueInfoException
Creates a new instance of NameValueInfo.

Parameters:
nodeRep - The Xml String representing this element.
Throws:
NameValueInfoException - If the given String couldn't be parsed.
Method Detail

createElementFromNode

private void createElementFromNode(org.w3c.dom.Node node)
                            throws NameValueInfoException
Creates the NameValueInfo by supplying its XmlNode represenation.

Parameters:
node - The Xml Node representing this element.
Throws:
NameValueInfoException - If the node couldn't be parsed.

toString

public java.lang.String toString()
Returns the string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
The string representation of this object.

toXmlString

public java.lang.String toXmlString()
Returns a String representing the NameValueInfo in xml format.

Returns:
A String representing the NameValueInfo in xml format.