public class VOElementFactory
extends java.lang.Object
Element or from some non-DOM source such
 as a file, input stream, or SAX stream.
 In the latter case a DOM is built using the
 transformToDOM(javax.xml.transform.Source,boolean)
 method with no validation.  There are several optimisations performed
 by this method which distinguish it from a DOM that you'd get
 if you constructed it directly; the most important ones are that
 the data-bearing parts (children of STREAM or TABLEDATA elements)
 of the XML document are not included in the built DOM, and that
 any reference to the VOTable DTD is resolved locally rather than
 making a potential network connection.  You almost certainly don't
 need to worry about this; however if for some reason you want to
 work on a 'normal' DOM, or if you want validation, you can construct
 the DOM yourself and invoke one of the non-transforming
 makeVOElement methods on the result.
 
 The various makeVOElement methods may return an object of class
 VOElement or of one of its subclasses, according to the
 name of the element in question; specific subclasses are provided only
 where some extra functionality is available, for instance the
 TableElement.getData() method of the TableElement class.
 One upshot of this is that a tree of VOElements need not conform to
 the VOTable DTD, elements of any name may be in it.  Wherever an
 element has a name which matches an element with specific significance
 in a VOTable document however, such as "TABLE", it is handled
 accordingly.
| Modifier and Type | Field and Description | 
|---|---|
static boolean | 
STRICT_DEFAULT
Determines whether the default strictness state is true or false
 when the  
STRICT_PROPERTY property has not been set. | 
static java.lang.String | 
STRICT_PROPERTY
Property which determines the default strictness state. 
 | 
| Constructor and Description | 
|---|
VOElementFactory()
Constructs a new VOElementFactory with the default storage policy. 
 | 
VOElementFactory(StoragePolicy policy)
Constructs a new VOElementFactory with a given storage policy. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
StoragePolicy | 
getStoragePolicy()
Returns the storage policy currently in effect. 
 | 
boolean | 
isStrict()
Indicates whether a strict reading of the VOTable standard is
 in effect. 
 | 
static boolean | 
isStrictByDefault()
Indicates whether strict interpretation of the VOTable standard is
 on by default (if it has not been set explicitly). 
 | 
VOElement | 
makeVOElement(DataSource datsrc)
Builds a custom DOM read from a DataSource and returns a new VOElement
 based on its top-level element. 
 | 
VOElement | 
makeVOElement(org.w3c.dom.Document doc,
             java.lang.String systemId)
Returns a new VOElement based on a DOM Document node. 
 | 
VOElement | 
makeVOElement(javax.xml.transform.dom.DOMSource dsrc)
Returns a VOElement based on a DOM source. 
 | 
VOElement | 
makeVOElement(org.w3c.dom.Element el,
             java.lang.String systemId)
Returns a VOElement based on a given DOM element. 
 | 
VOElement | 
makeVOElement(java.io.File file)
Builds a custom DOM read from a file and returns a new VOElement
 based on its top-level element. 
 | 
VOElement | 
makeVOElement(java.io.InputStream strm,
             java.lang.String systemId)
Builds a custom DOM from an input stream and returns a new VOElement
 based on its top-level element. 
 | 
VOElement | 
makeVOElement(javax.xml.transform.Source xsrc)
Returns a VOElement based on an XML Source. 
 | 
VOElement | 
makeVOElement(java.lang.String uri)
Builds a custom DOM read from a URI and returns a new VOElement
 based on its top-level element. 
 | 
VOElement | 
makeVOElement(java.net.URL url)
Builds a custom DOM read from a URL and returns a new VOElement
 based on its top-level element. 
 | 
void | 
setStoragePolicy(StoragePolicy policy)
Sets the storage policy. 
 | 
void | 
setStrict(boolean strict)
Determines whether a strict reading of the VOTable standard will be
 enforced. 
 | 
javax.xml.transform.dom.DOMSource | 
transformToDOM(javax.xml.transform.Source xsrc,
              boolean validate)
Gets a custom DOMSource from a generic XML Source. 
 | 
public static final java.lang.String STRICT_PROPERTY
STRICT_DEFAULT.  The return value of the 
 isStrict() method will be set like this unless strictness
 is set explicitly.setStrict(boolean), 
Constant Field Valuespublic static boolean STRICT_DEFAULT
STRICT_PROPERTY property has not been set.
 True by default.public VOElementFactory(StoragePolicy policy)
policy - storage policypublic VOElementFactory()
StoragePolicy.getDefaultPolicy()public StoragePolicy getStoragePolicy()
public void setStoragePolicy(StoragePolicy policy)
policy - new storage policypublic VOElement makeVOElement(org.w3c.dom.Element el, java.lang.String systemId)
el is already a VOElement, it is just returned.el - DOM element on which the new object will be basedsystemId - the location of the documentpublic VOElement makeVOElement(org.w3c.dom.Document doc, java.lang.String systemId)
doc - DOM document nodesystemId - the location of the documentdocpublic VOElement makeVOElement(javax.xml.transform.dom.DOMSource dsrc)
dsrc - DOM source representing an Element or Document nodedsrcpublic VOElement makeVOElement(javax.xml.transform.Source xsrc) throws org.xml.sax.SAXException, java.io.IOException
xsrc - the XML source representing the elementxsrcorg.xml.sax.SAXException - if xsrc is not a DOM source
          and there is a parse error transforming it to a DOMjava.io.IOException - if xsrc is not a DOM source
          and there is an I/O error transforming to a DOMpublic VOElement makeVOElement(java.io.InputStream strm, java.lang.String systemId) throws org.xml.sax.SAXException, java.io.IOException
strm - stream containing XML datasystemId - the location of the documentorg.xml.sax.SAXExceptionjava.io.IOExceptionpublic VOElement makeVOElement(java.lang.String uri) throws org.xml.sax.SAXException, java.io.IOException
uri - location of the documentorg.xml.sax.SAXExceptionjava.io.IOExceptionpublic VOElement makeVOElement(java.net.URL url) throws org.xml.sax.SAXException, java.io.IOException
url - location of the documentorg.xml.sax.SAXExceptionjava.io.IOExceptionpublic VOElement makeVOElement(java.io.File file) throws org.xml.sax.SAXException, java.io.IOException
file - file containing XML documentorg.xml.sax.SAXExceptionjava.io.IOExceptionpublic VOElement makeVOElement(DataSource datsrc) throws org.xml.sax.SAXException, java.io.IOException
datsrc - data source containing XMLorg.xml.sax.SAXExceptionjava.io.IOExceptionpublic javax.xml.transform.dom.DOMSource transformToDOM(javax.xml.transform.Source xsrc,
                                                        boolean validate)
                                                 throws org.xml.sax.SAXException,
                                                        java.io.IOException
VOElement or one of its specialist subclasses.
 The clever bit is that during the parse (if xsrc
 is not already a DOMSource) it intercepts SAX events
 which indicate the start and end of any DATA events it finds so
 that they are not incorporated as part of the DOM.
 Such elements it parses
 directly on the basis of what it knows about items that crop up
 in VOTables.  This keeps the resulting DOM to a reasonable size.
xsrc - input XML sourcevalidate - whether to use a validating parser if the
          transformation needs to be done (that is, if xsrc
          is not already a DOMSource)xsrc
          The DOMSource's node will be either a VOElement or a VODocumentorg.xml.sax.SAXExceptionjava.io.IOExceptionpublic void setStrict(boolean strict)
FIELD or PARAM element with 
     a datatype attribute of "char" or
     "unicodeChar" but no arraysize
     attribute will be assumed to represent a character array
     (arraysize="*")
     rather than a single-character value.strict - true iff you want a strict reading of the VOTable
          standardisStrict(), 
STRICT_PROPERTYpublic boolean isStrict()
isStrictByDefault().setStrict(boolean)public static boolean isStrictByDefault()
STRICT_PROPERTY, or of STRICT_DEFAULT
 if that is not set.setStrict(boolean)