Class JDOMDocument
- java.lang.Object
-
- gov.nist.secauto.decima.xml.document.AbstractJDOMDocument
-
- gov.nist.secauto.decima.xml.document.JDOMDocument
-
- All Implemented Interfaces:
Document,MutableDocument,XMLContextResolver,MutableXMLDocument,XMLDocument
- Direct Known Subclasses:
CompositeXMLDocument
public class JDOMDocument extends AbstractJDOMDocument
-
-
Constructor Summary
Constructors Modifier Constructor Description JDOMDocument(XMLDocument toCopy)A copy constructor.JDOMDocument(File location)JDOMDocument(File location, URL originalLocation)JDOMDocument(File location, URL originalLocation, org.jdom2.input.sax.SAXEngine saxEngine)Loads a JDOM document from aFilelocation using the providedSAXEngine.JDOMDocument(File location, org.jdom2.input.sax.SAXEngine saxEngine)Loads a JDOM document from aFilelocation using the providedSAXEngine.JDOMDocument(InputStream is, String systemId)JDOMDocument(InputStream is, String systemId, org.jdom2.input.sax.SAXEngine saxEngine)Loads an XML document from anInputStream.JDOMDocument(URL location)JDOMDocument(URL location, org.jdom2.input.sax.SAXEngine saxEngine)JDOMDocument(org.jdom2.Document document, URL originalLocation)protectedJDOMDocument(org.jdom2.Document document, URL originalLocation, XMLContextResolver resolver)A basic constructor for aJDOMDocumentthat can be used by extensions to construct a new document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jdom2.DocumentgetJDOMDocument(boolean copy)Retrieves the underlying JDOM document.URLgetOriginalLocation()protected XMLContextResolvergetXMLContextResolver()-
Methods inherited from class gov.nist.secauto.decima.xml.document.AbstractJDOMDocument
asString, copyTo, getContext, getContext, getJDOMDocument, getSource, getSourceInfo, getSystemId, getSystemId, getXPath, getXPath, newInputStream, newXMLDocumentFragment, newXMLDocumentFragment, newXPathEvaluator
-
-
-
-
Constructor Detail
-
JDOMDocument
public JDOMDocument(File location) throws DocumentException, FileNotFoundException
-
JDOMDocument
public JDOMDocument(File location, org.jdom2.input.sax.SAXEngine saxEngine) throws DocumentException, FileNotFoundException
Loads a JDOM document from aFilelocation using the providedSAXEngine.- Parameters:
location- the file location to load the XML document fromsaxEngine- the JDOMSAXEngineto use to parse the document- Throws:
DocumentException- if an error occured while reading the XML documentFileNotFoundException- if the file to be loaded does not exist
-
JDOMDocument
public JDOMDocument(File location, URL originalLocation) throws DocumentException, FileNotFoundException
-
JDOMDocument
public JDOMDocument(File location, URL originalLocation, org.jdom2.input.sax.SAXEngine saxEngine) throws DocumentException, FileNotFoundException
Loads a JDOM document from aFilelocation using the providedSAXEngine.- Parameters:
location- the file location to load the XML document fromoriginalLocation- the location the document was originally loaded from, before creating the current instancesaxEngine- the JDOMSAXEngineto use to parse the document- Throws:
DocumentException- if an error occured while reading the XML documentFileNotFoundException- if the file to be loaded does not exist
-
JDOMDocument
public JDOMDocument(URL location) throws DocumentException
- Throws:
DocumentException
-
JDOMDocument
public JDOMDocument(URL location, org.jdom2.input.sax.SAXEngine saxEngine) throws DocumentException
- Throws:
DocumentException
-
JDOMDocument
public JDOMDocument(InputStream is, String systemId) throws DocumentException, MalformedURLException
-
JDOMDocument
public JDOMDocument(InputStream is, String systemId, org.jdom2.input.sax.SAXEngine saxEngine) throws DocumentException, MalformedURLException
Loads an XML document from anInputStream.- Parameters:
is- theInputStreamto read fromsystemId- the location of the resource being readsaxEngine- the JDOMSAXEngineto use to parse the document- Throws:
DocumentException- if an error occured while reading the XML documentMalformedURLException- if the original location URL is malformed
-
JDOMDocument
public JDOMDocument(org.jdom2.Document document, URL originalLocation) throws DocumentException- Throws:
DocumentException
-
JDOMDocument
protected JDOMDocument(org.jdom2.Document document, URL originalLocation, XMLContextResolver resolver)A basic constructor for aJDOMDocumentthat can be used by extensions to construct a new document.- Parameters:
document- the JDOM 2Documentobjects that backs this document.originalLocation- the original document location ornullresolver- theXMLContextResolverto use to resolve XPaths, XPathContext, and systemId.
-
JDOMDocument
public JDOMDocument(XMLDocument toCopy)
A copy constructor.- Parameters:
toCopy- theXMLDocumentto copy
-
-
Method Detail
-
getOriginalLocation
public URL getOriginalLocation()
-
getJDOMDocument
public org.jdom2.Document getJDOMDocument(boolean copy)
Description copied from interface:MutableXMLDocumentRetrieves the underlying JDOM document. This will be a copy if the provided argument istrue.- Parameters:
copy- iftruethe returned document must be a cloned copy- Returns:
- the underlying JDOM document or a copy of it
-
getXMLContextResolver
protected XMLContextResolver getXMLContextResolver()
- Specified by:
getXMLContextResolverin classAbstractJDOMDocument
-
-