|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xpath.SourceTreeManager
public class SourceTreeManager
This class bottlenecks all management of source trees. The methods in this class should allow easy garbage collection of source trees (not yet!), and should centralize parsing for those source trees.
Field Summary | |
---|---|
private java.util.Vector |
m_sourceTree
Vector of SourceTree objects that this manager manages. |
(package private) javax.xml.transform.URIResolver |
m_uriResolver
The TrAX URI resolver used to obtain source trees. |
Constructor Summary | |
---|---|
SourceTreeManager()
|
Method Summary | |
---|---|
java.lang.String |
findURIFromDoc(int owner)
Given a document, find the URL associated with that document. |
int |
getNode(javax.xml.transform.Source source)
Given a Source object, find the node associated with it. |
int |
getSourceTree(javax.xml.transform.Source source,
javax.xml.transform.SourceLocator locator,
XPathContext xctxt)
Get the source tree from the input source. |
int |
getSourceTree(java.lang.String base,
java.lang.String urlString,
javax.xml.transform.SourceLocator locator,
XPathContext xctxt)
Get the source tree from the a base URL and a URL string. |
javax.xml.transform.URIResolver |
getURIResolver()
Get the object that will be used to resolve URIs used in document(), etc. |
static org.xml.sax.XMLReader |
getXMLReader(javax.xml.transform.Source inputSource,
javax.xml.transform.SourceLocator locator)
This method returns the SAX2 parser to use with the InputSource obtained from this URI. |
int |
parseToNode(javax.xml.transform.Source source,
javax.xml.transform.SourceLocator locator,
XPathContext xctxt)
Try to create a DOM source tree from the input source. |
void |
putDocumentInCache(int n,
javax.xml.transform.Source source)
Put the source tree root node in the document cache. |
void |
removeDocumentFromCache(int n)
JJK: Support kluge in ElemForEach. |
void |
reset()
Reset the list of SourceTree objects that this manager manages. |
javax.xml.transform.Source |
resolveURI(java.lang.String base,
java.lang.String urlString,
javax.xml.transform.SourceLocator locator)
This will be called by the processor when it encounters an xsl:include, xsl:import, or document() function. |
void |
setURIResolver(javax.xml.transform.URIResolver resolver)
Set an object that will be used to resolve URIs used in document(), etc. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Vector m_sourceTree
javax.xml.transform.URIResolver m_uriResolver
Constructor Detail |
---|
public SourceTreeManager()
Method Detail |
---|
public void reset()
public void setURIResolver(javax.xml.transform.URIResolver resolver)
resolver
- An object that implements the URIResolver interface,
or null.public javax.xml.transform.URIResolver getURIResolver()
public java.lang.String findURIFromDoc(int owner)
owner
- Document that was previously processed by this liaison.
public javax.xml.transform.Source resolveURI(java.lang.String base, java.lang.String urlString, javax.xml.transform.SourceLocator locator) throws javax.xml.transform.TransformerException, java.io.IOException
base
- The base URI that should be used.urlString
- Value from an xsl:import or xsl:include's href attribute,
or a URI specified in the document() function.
java.io.IOException
javax.xml.transform.TransformerException
public void removeDocumentFromCache(int n)
n
- The node to remove.public void putDocumentInCache(int n, javax.xml.transform.Source source)
n
- The node to cache.source
- The Source object to cache.public int getNode(javax.xml.transform.Source source)
source
- The Source object to act as the key.
public int getSourceTree(java.lang.String base, java.lang.String urlString, javax.xml.transform.SourceLocator locator, XPathContext xctxt) throws javax.xml.transform.TransformerException
base
- The base URI to use if the urlString is relative.urlString
- An absolute or relative URL string.locator
- The location of the caller, for diagnostic purposes.
javax.xml.transform.TransformerException
- If the URL can not resolve to a node.public int getSourceTree(javax.xml.transform.Source source, javax.xml.transform.SourceLocator locator, XPathContext xctxt) throws javax.xml.transform.TransformerException
source
- The Source object that should identify the desired node.locator
- The location of the caller, for diagnostic purposes.
javax.xml.transform.TransformerException
- if the Source argument can't be resolved to
a node.public int parseToNode(javax.xml.transform.Source source, javax.xml.transform.SourceLocator locator, XPathContext xctxt) throws javax.xml.transform.TransformerException
source
- The Source object that identifies the source node.locator
- The location of the caller, for diagnostic purposes.
javax.xml.transform.TransformerException
- if the source argument can not be resolved
to a source node.public static org.xml.sax.XMLReader getXMLReader(javax.xml.transform.Source inputSource, javax.xml.transform.SourceLocator locator) throws javax.xml.transform.TransformerException
inputSource
- The value returned from the URIResolver.locator
- The location of the original caller, for diagnostic purposes.
javax.xml.transform.TransformerException
- if the reader can not be created.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |