Package uk.ac.starlink.votable
Class VODocument
- java.lang.Object
-
- uk.ac.starlink.votable.dom.DelegatingNode
-
- uk.ac.starlink.votable.dom.DelegatingDocument
-
- uk.ac.starlink.votable.VODocument
-
- All Implemented Interfaces:
org.w3c.dom.Document
,org.w3c.dom.Node
public class VODocument extends DelegatingDocument
Document implementation which holds a VOTable-specific DOM. The elements in it are all instances ofVOElement
, or of VOElement subclasses according to their element names, that is any element with a tagname of "TABLE" in this DOM will be an instance of the classTableElement
and so on.- Since:
- 13 Sep 2004
- 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
-
-
Constructor Summary
Constructors Constructor Description VODocument()
Constructs a new VODocument.VODocument(java.lang.String systemId, boolean strict)
Constructs a new VODocument with a specified System ID.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DelegatingAttr
createDelegatingAttr(org.w3c.dom.Attr baseNode)
Creates a new node in this document that delegates to an object of classAttr
in the base model.protected DelegatingElement
createDelegatingElement(org.w3c.dom.Element node)
Creates a new node in this document that delegates to an object of classElement
in the base model.DelegatingNode
getDelegator(org.w3c.dom.Node base)
Returns the node in this document which delegates to (is based on) a given node in the base document.org.w3c.dom.Element
getElementById(java.lang.String elementId)
int
getElementCount(java.lang.String voTagName)
Returns the number of elements of a given name which have so far been added to this document.uk.ac.starlink.table.StoragePolicy
getStoragePolicy()
Returns the storage policy used for storing bulk table data found as elements in the DOM into a usable form.java.lang.String
getSystemId()
Returns the system ID associated with this document.java.lang.String
getVOTagName(org.w3c.dom.Element el)
Returns the unqualified tag name for an element in the VOTable namespace, taking care of namespacing issues.void
setElementId(org.w3c.dom.Element el, java.lang.String id)
Stores an element as the referent of a given ID string.void
setStoragePolicy(uk.ac.starlink.table.StoragePolicy policy)
Sets the storage policy used for storing bulk table data found as elements in the DOM into a usable form.-
Methods inherited from class uk.ac.starlink.votable.dom.DelegatingDocument
adoptNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDelegatingAttr, createDelegatingCDATASection, createDelegatingCharacterData, createDelegatingComment, createDelegatingDocumentFragment, createDelegatingDocumentType, createDelegatingEntity, createDelegatingEntityReference, createDelegatingNamedNodeMap, createDelegatingNodeList, createDelegatingNotation, createDelegatingProcessingInstruction, createDelegatingSimpleNode, createDelegatingText, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, getBaseDocument, getDoctype, getDocumentElement, getDocumentURI, getDomConfig, getElementsByTagName, getElementsByTagNameNS, getImplementation, getInputEncoding, getStrictErrorChecking, getXmlEncoding, getXmlStandalone, getXmlVersion, importNode, normalizeDocument, renameNode, setDocumentURI, setStrictErrorChecking, setXmlStandalone, setXmlVersion
-
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, toString, 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
-
-
-
-
Constructor Detail
-
VODocument
public VODocument(java.lang.String systemId, boolean strict)
Constructs a new VODocument with a specified System ID.- Parameters:
systemId
- system ID for the VOTable document represented by this DOM (sometimes used for resolving URLs) - may be nullstrict
- whether to enforce the VOTable standard strictly or in some cases do what is probably meant (seeVOElementFactory.setStrict(boolean)
)
-
VODocument
public VODocument()
Constructs a new VODocument. No system ID is registered, so that all URLs in the document will be considered as absolute ones. A default level of strictness is used.
-
-
Method Detail
-
getSystemId
public java.lang.String getSystemId()
Returns the system ID associated with this document.- Returns:
- system ID if there is one
-
getStoragePolicy
public uk.ac.starlink.table.StoragePolicy getStoragePolicy()
Returns the storage policy used for storing bulk table data found as elements in the DOM into a usable form.- Returns:
- current policy
-
setStoragePolicy
public void setStoragePolicy(uk.ac.starlink.table.StoragePolicy policy)
Sets the storage policy used for storing bulk table data found as elements in the DOM into a usable form. The default value isStoragePolicy.PREFER_MEMORY
.- Parameters:
policy
- new policy
-
setElementId
public void setElementId(org.w3c.dom.Element el, java.lang.String id)
Stores an element as the referent of a given ID string. This affects the return value of the DOMgetElementById(java.lang.String)
method.
-
getElementById
public org.w3c.dom.Element getElementById(java.lang.String elementId)
- Specified by:
getElementById
in interfaceorg.w3c.dom.Document
- Overrides:
getElementById
in classDelegatingDocument
-
getDelegator
public DelegatingNode getDelegator(org.w3c.dom.Node base)
Description copied from class:DelegatingDocument
Returns the node in this document which delegates to (is based on) a given node in the base document. If this node has not previously been encountered, it will be created here.- Overrides:
getDelegator
in classDelegatingDocument
- Parameters:
base
- node in the base document- Returns:
- corresponding node in this document
-
getElementCount
public int getElementCount(java.lang.String voTagName)
Returns the number of elements of a given name which have so far been added to this document.- Parameters:
voTagName
- VOTable-domain tag name- Returns:
- number of elements of that type
-
createDelegatingElement
protected DelegatingElement createDelegatingElement(org.w3c.dom.Element node)
Description copied from class:DelegatingDocument
Creates a new node in this document that delegates to an object of classElement
in the base model. This may be overridden to create specialised node types.- Overrides:
createDelegatingElement
in classDelegatingDocument
- Parameters:
node
- delegate node- Returns:
- new node in this model based on baseNode
-
createDelegatingAttr
protected DelegatingAttr createDelegatingAttr(org.w3c.dom.Attr baseNode)
Description copied from class:DelegatingDocument
Creates a new node in this document that delegates to an object of classAttr
in the base model. This may be overridden to create specialised node types.- Overrides:
createDelegatingAttr
in classDelegatingDocument
- Parameters:
baseNode
- delegate node- Returns:
- new node in this model based on baseNode
-
getVOTagName
public java.lang.String getVOTagName(org.w3c.dom.Element el)
Returns the unqualified tag name for an element in the VOTable namespace, taking care of namespacing issues.- Parameters:
el
- element- Returns:
- unqualified VOTable tag name, e.g. "TABLE"
-
-