com.xml_project.morganaxproc
Class XProcSource

java.lang.Object
  extended by com.xml_project.morganaxproc.XProcSource

public class XProcSource
extends java.lang.Object

This class is used to hold xml documents to serve as source either for compilation or for documents on input ports.


Constructor Summary
XProcSource(nu.xom.Document document)
           Creates a new XProcSource from the given document.
XProcSource(javax.xml.transform.Source source)
           Creates a new XProcSource from the given source, which may be a StreamSource or a SAXSource.
XProcSource(java.lang.String uri)
           Creates a new XProcSource which the reference to an xml document.
 
Method Summary
 nu.xom.Document getDocument(XProcSecurityManager.Operations operation, XProcConfiguration config, java.net.URI baseURI)
           Return the xml document associated with this XProcSource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XProcSource

public XProcSource(java.lang.String uri)
            throws XProcInterfaceException

Creates a new XProcSource which the reference to an xml document. designated by the uri.

Parameters:
uri - an uri (relative or absolute) to designate an xml document.
Throws:
XProcInterfaceException - if uri is null or an empty string.

XProcSource

public XProcSource(javax.xml.transform.Source source)
            throws XProcInterfaceException

Creates a new XProcSource from the given source, which may be a StreamSource or a SAXSource.

Parameters:
source - a source to build the document.
Throws:
XProcInterfaceException - if source is null or neither a StreamSource nor a SAXSource.

XProcSource

public XProcSource(nu.xom.Document document)
            throws XProcInterfaceException

Creates a new XProcSource from the given document.

Parameters:
document - an xml document.
Throws:
XProcInterfaceException - if document is null
Method Detail

getDocument

public nu.xom.Document getDocument(XProcSecurityManager.Operations operation,
                                   XProcConfiguration config,
                                   java.net.URI baseURI)
                            throws XProcSecurityException,
                                   java.io.IOException,
                                   XProcFilesystem.UnsupportedXMLVersionException,
                                   nu.xom.ValidityException,
                                   nu.xom.ParsingException,
                                   XProcFilesystem.DefectiveURIException

Return the xml document associated with this XProcSource.

If the XProcSource was created by new XProcSource(document) this document is returned. Otherwise the given uri is used to obtain a document. If the uri is relative it is made absolute by using baseURI.

Please note that the document is obtained only once from the given uri. Any later change to the document designated by the uri is not reflected. Create a new XProcSource every time you refer to the document if you know that the document was modified since last call of getDocument and always need the current version.

Parameters:
operation - the operation (as defined by XProcSecurityManager for which the document is needed.
config - the XProcConfiguration to be used for obtaining the document from the uri.
baseURI - the baseURI to resolve relative uris.
Returns:
the document associated with this XProcSource.
Throws:
java.io.IOException - if there was an error obtaining the document from the given uri.
XProcFilesystem.UnsupportedXMLVersionException - if the document is in an xml version not supported.
nu.xom.ParsingException
nu.xom.ValidityException
XProcFilesystem.DefectiveURIException
XProcSecurityException