org.dvb.xml.jdom
Interface Node

All Known Subinterfaces:
Attribute, Element

public interface Node

Interface that represents the common access methods for both Attributes and Elements.


Method Summary
 boolean getBooleanValue()
          Get the contents of this element / attribute as a boolean.
 java.util.Date getDateValue()
          Get the contents of this element / attribute as a Date.
 double getDoubleValue()
          Get the contents of this element / attribute as a Double number.
 long getLongValue()
          Get the contents of this element / attribute as a Long number.
 java.lang.String getName()
          Get the name of this element / attribute.
 Namespace getNamespace()
          Get the XML Schema namespace that this element / attribute belongs to.
 Element getParent()
          Get the parent of this element / attribute.
 java.lang.String getTextNormalize()
          Get the contents of this element / attribute as a String, with leading and trailing whitespace removed, and any internal spaces reduced to one space.
 java.lang.String getValue()
          Get the contents of this element / attribute, as a String.
 

Method Detail

getName

java.lang.String getName()
Get the name of this element / attribute. The String returned by this function does not include the namespace prefix.

Returns:
the name of this element / attribute

getParent

Element getParent()
Get the parent of this element / attribute.

Returns:
the patent of this element / attribute. If this is the root element, this function will return null.

getNamespace

Namespace getNamespace()
Get the XML Schema namespace that this element / attribute belongs to.

Returns:
the namespace of this element / attribute

getValue

java.lang.String getValue()
Get the contents of this element / attribute, as a String. Note that for an element that has children, getValue() does not include the contents of these children.

Returns:
the contents of this element / attribute. Returns an empty string if the element / attribute is empty

getTextNormalize

java.lang.String getTextNormalize()
Get the contents of this element / attribute as a String, with leading and trailing whitespace removed, and any internal spaces reduced to one space.

Returns:
the normalised contents of this element / attribute. Returns an empty string if the element / attribute is empty

getLongValue

long getLongValue()
                  throws java.lang.NumberFormatException
Get the contents of this element / attribute as a Long number.

Returns:
the numeric value of this element / attribute
Throws:
java.lang.NumberFormatException - if this element / attribute does not contain a value that can be represented by a Long

getDoubleValue

double getDoubleValue()
                      throws java.lang.NumberFormatException
Get the contents of this element / attribute as a Double number.

Returns:
the numeric value of this element / attribute
Throws:
java.lang.NumberFormatException - if this element / attribute does not contain a value that can be represented by a Double

getBooleanValue

boolean getBooleanValue()
                        throws java.lang.NumberFormatException
Get the contents of this element / attribute as a boolean.

Returns:
the boolean value of this element / attribute
Throws:
java.lang.NumberFormatException - if this element / attribute does not contain a value that can be represented by a boolean

getDateValue

java.util.Date getDateValue()
                            throws java.lang.NumberFormatException
Get the contents of this element / attribute as a Date. The Date returned shall contain a copy of the date contained in this instance such that it can be freely modified by applications without changing the date contained in this instance.

Returns:
the date value of this element / attribute
Throws:
java.lang.NumberFormatException - if this element / attribute does not contain a value that can be represented by a Date