org.apache.xml.dtm.ref
public class DTMManagerDefault extends DTMManager
synchronized
.
Early tests suggest that doing so is not causing a significant
performance hit in Xalan. However, it should be noted that there
is a possible alternative solution: rewrite release() so it merely
posts a request for release onto a threadsafe queue, and explicitly
process that queue on an infrequent basis during main-thread
activity (eg, when getDTM() is invoked). The downside of that solution
would be a greater delay before the DTM's storage is actually released
for reuse.
Constructor Summary | |
---|---|
DTMManagerDefault()
Constructor DTMManagerDefault
|
Method Summary | |
---|---|
void | addDTM(DTM dtm, int id)
Add a DTM to the DTM table. |
void | addDTM(DTM dtm, int id, int offset)
Add a DTM to the DTM table.
|
DTM | createDocumentFragment()
Method createDocumentFragment
NEEDSDOC (createDocumentFragment) @return |
DTMIterator | createDTMIterator(int whatToShow, DTMFilter filter, boolean entityReferenceExpansion)
NEEDSDOC Method createDTMIterator
NEEDSDOC @param whatToShow
NEEDSDOC @param filter
NEEDSDOC @param entityReferenceExpansion
NEEDSDOC (createDTMIterator) @return |
DTMIterator | createDTMIterator(String xpathString, PrefixResolver presolver)
NEEDSDOC Method createDTMIterator
NEEDSDOC @param xpathString
NEEDSDOC @param presolver
NEEDSDOC (createDTMIterator) @return |
DTMIterator | createDTMIterator(int node)
NEEDSDOC Method createDTMIterator
NEEDSDOC @param node
NEEDSDOC (createDTMIterator) @return |
DTMIterator | createDTMIterator(Object xpathCompiler, int pos)
NEEDSDOC Method createDTMIterator
NEEDSDOC @param xpathCompiler
NEEDSDOC @param pos
NEEDSDOC (createDTMIterator) @return |
DTM | getDTM(Source source, boolean unique, DTMWSFilter whiteSpaceFilter, boolean incremental, boolean doIndexing)
Get an instance of a DTM, loaded with the content from the
specified source. |
DTM | getDTM(int nodeHandle)
Return the DTM object containing a representation of this node.
|
int | getDTMHandleFromNode(Node node)
Given a W3C DOM node, try and return a DTM handle.
|
int | getDTMIdentity(DTM dtm)
Given a DTM, find the ID number in the DTM tables which addresses
the start of the document. |
ExpandedNameTable | getExpandedNameTable(DTM dtm)
return the expanded name table.
|
int | getFirstFreeDTMID()
Get the first free DTM ID available. |
XMLReader | getXMLReader(Source inputSource)
This method returns the SAX2 parser to use with the InputSource
obtained from this URI.
|
boolean | release(DTM dtm, boolean shouldHardDelete)
Release the DTMManager's reference(s) to a DTM, making it unmanaged.
|
void | releaseXMLReader(XMLReader reader)
Indicates that the XMLReader object is no longer in use for the transform.
|
Parameters: dtm Should be a valid reference to a DTM. id Integer DTM ID to be bound to this DTM
Parameters: dtm Should be a valid reference to a DTM. id Integer DTM ID to be bound to this DTM. offset Integer addressing offset. The internal DTM Node ID is
obtained by adding this offset to the node-number field of the
public DTM Handle. For the first DTM ID accessing each DTM, this is 0;
for overflow addressing it will be a multiple of 1<
Parameters: source the specification of the source object. unique true if the returned DTM must be unique, probably because it is going to be mutated. whiteSpaceFilter Enables filtering of whitespace nodes, and may be null. incremental true if the DTM should be built incrementally, if possible. doIndexing true if the caller considers it worth it to use indexing schemes.
Returns: a non-null DTM reference.
Parameters: nodeHandle DTM Handle indicating which node to retrieve
Returns: a reference to the DTM object containing this node.
Parameters: node Non-null reference to a DOM node.
Returns: a valid DTM handle.
Parameters: dtm The DTM which (hopefully) contains this node.
Returns: The DTM ID (as the high bits of a NodeHandle, not as our internal index), or -1 if the DTM doesn't belong to this manager.
Parameters: inputSource The value returned from the URIResolver.
Returns: a SAX2 XMLReader to use to resolve the inputSource argument. non-null XMLReader reference ready to parse.
Parameters: dtm the DTM to be released. shouldHardDelete If false, this call is a suggestion rather than an order, and we may not actually release the DTM. This is intended to support intelligent caching of documents... which is not implemented in this version of the DTM manager.
Returns: true if the DTM was released, false if shouldHardDelete was set and we decided not to.
Parameters: reader The XMLReader to be released.