Class VOElement
- Direct Known Subclasses:
FieldElement
,FieldRefElement
,GroupElement
,LinkElement
,ParamRefElement
,TableElement
,TimesysElement
,ValuesElement
This class is extended to provide the classes associated with
specific VOTable elements. These in turn provide more additional
methods associated with the specific properties of such elements,
for instance the TableElement
class has a getData
which returns the actual table cell data. Those element types
which don't require any extra associated functionality (such as
RESOURCE) don't have their own subclass, they are just represented
as VOElement
s. The class of each element in the DOM
is determined by its tag name - so every TABLE element will be
represented in the DOM as a TableElement
and so on.
- Author:
- Mark Taylor (Starlink)
-
Field Summary
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
-
Method Summary
Modifier and TypeMethodDescriptiongetChildByName
(String votagname) Returns the first child element of this element which has a given name in the VOTable namespace.Returns the child elements of this element.getChildrenByName
(String votagname) Returns all the child elements of this element which have a given name in the VOTable namespace.Returns the text of a DESCRIPTION element associated with this object, ornull
if none exists.getElementsByVOTagName
(String voTagName) Returns a NodeList of all descendant Elements with a given unqualified tag name in the VOTable namespace, in the order in which they are encountered in a preorder traversal of this Element tree.int
Returns the number of elements with the same tag name as this one which were present in the document when this one was added to it.Returns something that can be used informally as a name for this element.getID()
Returns theID
attribute value for this element, ornull
if none exists.getName()
Returns thename
attribute value for this element, ornull
if none exists.Returns the parent element of this element as a VOElement.getReferencedElement
(String refAtt, String votagname) Returns an element from the same document whose ID-typed attribute matches the value of a given (reference) attribute of this element.Returns any system ID associated with this node.Returns the name of this element in the VOTable namespace.toString()
Returns the same value asgetHandle()
.Methods inherited from class uk.ac.starlink.votable.dom.DelegatingElement
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
Methods inherited from class uk.ac.starlink.votable.dom.DelegatingNode
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
Method Details
-
getDescription
Returns the text of a DESCRIPTION element associated with this object, ornull
if none exists. The return value is a plain text string - any XML tags (XHTML is allowed in the VOTable1.1 DESCRIPTION content model) are stripped out. If you want the full XML structure of the DESCRIPTION tag, use insteadgetChildByName("DESCRIPTION")
.- Returns:
- the description
-
getID
Returns theID
attribute value for this element, ornull
if none exists.- Returns:
- the ID
-
getName
Returns thename
attribute value for this element, ornull
if none exists.- Returns:
- the name
-
getParent
Returns the parent element of this element as a VOElement. Note that the returned object is not guaranteed to be one of the elements in the VOTable DTD. If this element is at the root of the document,null
will be returned.- Returns:
- parent VOElement
-
getChildren
Returns the child elements of this element. Each is returned as an instance of VOElement or one of its specific subclasses.- Returns:
- an array of VOElement children of this one
-
getChildrenByName
Returns all the child elements of this element which have a given name in the VOTable namespace. Each is returned as a VOElement or the appropriate specific VOElement subclass.Note that since STIL v2.8, but not before, the namespacing of the argument to this method is influenced by the default
Namespacing
class.- Parameters:
votagname
- the unqualified element name in the VOTable namespace required (such as "TABLE")- Returns:
- an array of VOElement children of this one, all with element
name
tagname
-
getChildByName
Returns the first child element of this element which has a given name in the VOTable namespace. If there are more than one with the given name, later ones are ignored. If there are none,null
is returned. The element is returned as a VOElement or the appropriate specific VOElement subclass.Note that since STIL v2.8, but not before, the namespacing of the argument to this method is influenced by the default
Namespacing
class.- Parameters:
votagname
- the unqualified element name in the VOTable namespace required (such as "TABLE")- Returns:
- the first child of this one with element name
tagname
-
toString
Returns the same value asgetHandle()
. -
getHandle
Returns something that can be used informally as a name for this element. May be ID or something other than the value of the name attribute itself if no name exists.- Returns:
- a label for this element
-
getSystemId
Returns any system ID associated with this node. It is the system ID (basically, a relative or absolute location) of the owner document.- Returns:
- system ID
-
getVOTagName
Returns the name of this element in the VOTable namespace.- Returns:
- unqualified VOTable element name for this element, such as "TABLE"
-
getElementSequence
public int getElementSequence()Returns the number of elements with the same tag name as this one which were present in the document when this one was added to it.- Returns:
- sequence number of this element among similarly named ones
-
getReferencedElement
Returns an element from the same document whose ID-typed attribute matches the value of a given (reference) attribute of this element. The result is constrained to have a particular tag name; if no such element exists, null is returned.- Parameters:
refAtt
- name of referencing attribute of this elementvotagname
- the unqualified element name in the VOTable namespace required (such as "TABLE")- Returns:
- element with required tag name, or null
-
getElementsByVOTagName
Returns a NodeList of all descendant Elements with a given unqualified tag name in the VOTable namespace, in the order in which they are encountered in a preorder traversal of this Element tree. This does the same asElement.getElementsByTagName(java.lang.String)
, but takes care of VOTable namespacing issues; calling it with the argument "TABLE" will find all VOTable TABLE descendants.- Parameters:
voTagName
- unqualified element name in VOTable namespace- Returns:
- list of matching element nodes
-