Class VODocument

All Implemented Interfaces:
Document, Node

public class VODocument extends DelegatingDocument
Document implementation which holds a VOTable-specific DOM. The elements in it are all instances of VOElement, 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 class TableElement and so on.
Since:
13 Sep 2004
Author:
Mark Taylor (Starlink)
  • Constructor Details

    • VODocument

      public VODocument(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 null
      strict - whether to enforce the VOTable standard strictly or in some cases do what is probably meant (see VOElementFactory.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 Details

    • getSystemId

      public 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 is StoragePolicy.PREFER_MEMORY.
      Parameters:
      policy - new policy
    • setElementId

      public void setElementId(Element el, String id)
      Stores an element as the referent of a given ID string. This affects the return value of the DOM getElementById(java.lang.String) method.
    • getElementById

      public Element getElementById(String elementId)
      Specified by:
      getElementById in interface Document
      Overrides:
      getElementById in class DelegatingDocument
    • getDelegator

      public DelegatingNode getDelegator(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 class DelegatingDocument
      Parameters:
      base - node in the base document
      Returns:
      corresponding node in this document
    • getElementCount

      public int getElementCount(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(Element node)
      Description copied from class: DelegatingDocument
      Creates a new node in this document that delegates to an object of class Element in the base model. This may be overridden to create specialised node types.
      Overrides:
      createDelegatingElement in class DelegatingDocument
      Parameters:
      node - delegate node
      Returns:
      new node in this model based on baseNode
    • createDelegatingAttr

      protected DelegatingAttr createDelegatingAttr(Attr baseNode)
      Description copied from class: DelegatingDocument
      Creates a new node in this document that delegates to an object of class Attr in the base model. This may be overridden to create specialised node types.
      Overrides:
      createDelegatingAttr in class DelegatingDocument
      Parameters:
      baseNode - delegate node
      Returns:
      new node in this model based on baseNode
    • getVOTagName

      public String getVOTagName(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"