org.dvb.xml.jdom
Interface Element

All Superinterfaces:
Node

public interface Element
extends Node

Interface that represents one XML Element.


Method Summary
 java.util.Enumeration findField(java.lang.String fieldName)
          Returns an enumeration containing all Elements / Attributes of the given field.
 java.lang.String findFirstField(java.lang.String fieldName)
          Returns the first String representation for the given field.
 Namespace[] getAdditionalNamespaces()
          Get the list of XML Schema namespaces that are available to this element.
 Attribute getAttribute(java.lang.String name)
          Get the named attribute of this element, ignoring XML namespaces.
 Attribute getAttribute(java.lang.String name, Namespace ns)
          Get the named attribute of this element, using an XML namespace.
 Attribute[] getAttributes()
          Get all the attributes of this element.
 Element getChild(java.lang.String name)
          Get the first child of this element that has the given name, ignoring XML namespaces.
 Element getChild(java.lang.String name, Namespace ns)
          Get the first child of this element that has the given name and belongs to the given namespace.
 Element[] getChildren()
          Get an array of all the children of this element.
 Element[] getChildren(java.lang.String name)
          Get an array of all the children of this element that have the given name, ignoring XML namespaces.
 Element[] getChildren(java.lang.String name, Namespace ns)
          Get an array of all the children of this element that have the given name and belong to the given namespace.
 UnknownElementContent getUnknownElementContent()
          Get the UnknownElementContent carried by this Element.
 boolean hasUnknownElementContent()
          Indicates whether this Element has an unknown extension.
 boolean isRootElement()
          Check to see if this is the root element.
 
Methods inherited from interface org.dvb.xml.jdom.Node
getBooleanValue, getDateValue, getDoubleValue, getLongValue, getName, getNamespace, getParent, getTextNormalize, getValue
 

Method Detail

getAdditionalNamespaces

Namespace[] getAdditionalNamespaces()
Get the list of XML Schema namespaces that are available to this element.

Returns:
an array of available namespaces (excluding the element's own namespace)

isRootElement

boolean isRootElement()
Check to see if this is the root element. (i.e. one with no parent)

Returns:
true if this is the root element.

findField

java.util.Enumeration findField(java.lang.String fieldName)
Returns an enumeration containing all Elements / Attributes of the given field. The field name is based on the TV Anytime defined field ID list from SP006.

Parameters:
fieldName - the name of the field to search for (e.g. "Title")
Returns:
an enumeration of of selected nodes, which will be instances of the Element or Attribute interfaces. If no matches are found, an empty enumerator is returned.

findFirstField

java.lang.String findFirstField(java.lang.String fieldName)
Returns the first String representation for the given field. The field name is based on the TV Anytime defined field ID list from SP006.

Parameters:
fieldName - the name of the field to search for (e.g. "Title")
Returns:
the first String representation of specified field or null if the field cannot be found.

getChildren

Element[] getChildren()
Get an array of all the children of this element.

Returns:
all the Elements that are children of this element

getChildren

Element[] getChildren(java.lang.String name)
Get an array of all the children of this element that have the given name, ignoring XML namespaces.

Parameters:
name - The name of the element
Returns:
all the Elements that are children of this element, that have this given name

getChildren

Element[] getChildren(java.lang.String name,
                      Namespace ns)
Get an array of all the children of this element that have the given name and belong to the given namespace.

Parameters:
name - The name of the element
ns - The namespace that the name belongs to
Returns:
all the Elements that are children of this element that have the name specificed, within the specified namespace

getChild

Element getChild(java.lang.String name)
Get the first child of this element that has the given name, ignoring XML namespaces.

Parameters:
name - The name of the element
Returns:
the first Element that is a child of this element that has the name specificed, or null if no suitable Element can be found

getChild

Element getChild(java.lang.String name,
                 Namespace ns)
Get the first child of this element that has the given name and belongs to the given namespace.

Parameters:
name - The name of the element
ns - The namespace that the name belongs to
Returns:
the first Element that is a child of this element that has the name specificed, within the specified namespace, or null if no suitable Element can be found

getAttributes

Attribute[] getAttributes()
Get all the attributes of this element.

Returns:
an array of all the attributes of this element. If this element has no attributes, an empty array is returned

getAttribute

Attribute getAttribute(java.lang.String name)
Get the named attribute of this element, ignoring XML namespaces.

Parameters:
name - The name of the attribute
Returns:
the Attribute with the specified name, or null if not found

getAttribute

Attribute getAttribute(java.lang.String name,
                       Namespace ns)
Get the named attribute of this element, using an XML namespace.

Parameters:
name - The name of the attribute
ns - The namespace that the name belongs to
Returns:
the Attribute with the specified name, or null if not found

hasUnknownElementContent

boolean hasUnknownElementContent()
Indicates whether this Element has an unknown extension.

Returns:
true if this Element has an unknown extension, false otherwise
See Also:
getUnknownElementContent()

getUnknownElementContent

UnknownElementContent getUnknownElementContent()
Get the UnknownElementContent carried by this Element. This method will return null if there is no unknown extension data. The readBits(int) method of the UnknownElementContent object returned by this method will access a binary stream carrying one or more ElementContentChunks.

Returns:
an UnknownElementContent object carrying the extension data or null.
See Also:
hasUnknownElementContent()