org.apache.xml.utils
Class DTMManager

java.lang.Object
  |
  +--org.apache.xml.utils.DTMManager

public abstract class DTMManager
extends java.lang.Object

A DTMManager instance can be used to create DTM and DTMIterator objects, and manage the DTM objects in the system.

The system property that determines which Factory implementation to create is named "org.apache.xml.utils.DTMFactory". This property names a concrete subclass of the DTMFactory abstract class. If the property is not defined, a platform default is be used.

An instance of this class must be safe to use across thread instances. It is expected that a client will create a single instance of a DTMManager to use across multiple threads. This will allow sharing of DTMs across multiple processes.

Note: this class is incomplete right now. It will be pretty much modeled after javax.xml.transform.TransformerFactory in terms of its factory support.

State: In progress!!


Method Summary
abstract  DTMIterator createDTMIterator(int whatToShow, DTMFilter filter, boolean entityReferenceExpansion)
          Create a new DTMIterator based only on a whatToShow and a DTMFilter.
abstract  DTMIterator createDTMIterator(java.lang.Object xpathCompiler, int pos)
          Create a new DTMIterator based on an XPath UnionExpr.
abstract  DTMIterator createDTMIterator(java.lang.String xpathString, PrefixResolver presolver)
          Create a new DTMIterator based on an XPath UnionExpr.
abstract  DTM getDTM(int nodeHandle)
          Get an instance of a DTM that "owns" a node handle.
abstract  DTM getDTM(Source source, boolean unique)
          Get an instance of a DTM.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDTM

public abstract DTM getDTM(Source source,
                           boolean unique)
Get an instance of a DTM. If the unique flag is true, a new instance will always be returned. Otherwise it is up to the DTMManager to return a new instance or an instance that it already created and may be being used by someone else. (I think more parameters will need to be added for error handling, and entity resolution).
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.
Returns:
a non-null DTM reference.

getDTM

public abstract DTM getDTM(int nodeHandle)
Get an instance of a DTM that "owns" a node handle.
Parameters:
nodeHandle - the nodeHandle.
Returns:
a non-null DTM reference.

createDTMIterator

public abstract DTMIterator createDTMIterator(java.lang.Object xpathCompiler,
                                              int pos)
Create a new DTMIterator based on an XPath UnionExpr.
Parameters:
xpathCompiler - ??? Somehow we need to pass in a subpart of the expression. I hate to do this with strings, since the larger expression has already been parsed.
pos - The position in the expression.
Returns:
The newly created DTMIterator.

createDTMIterator

public abstract DTMIterator createDTMIterator(java.lang.String xpathString,
                                              PrefixResolver presolver)
Create a new DTMIterator based on an XPath UnionExpr.
Parameters:
xpathString - Must be a valid string expressing a UnionExpr.
presolver - An object that can resolve prefixes to namespace URLs.
Returns:
The newly created DTMIterator.

createDTMIterator

public abstract DTMIterator createDTMIterator(int whatToShow,
                                              DTMFilter filter,
                                              boolean entityReferenceExpansion)
Create a new DTMIterator based only on a whatToShow and a DTMFilter. The traversal semantics are defined as the descendant access.
Parameters:
whatToShow - This flag specifies which node types may appear in the logical view of the tree presented by the iterator. See the description of NodeFilter for the set of possible SHOW_ values.These flags can be combined using OR.
filter - The NodeFilter to be used with this TreeWalker, or null to indicate no filter.
entityReferenceExpansion - The value of this flag determines whether entity reference nodes are expanded.
Returns:
The newly created NodeIterator.


Copyright © 2000 Apache XML Project. All Rights Reserved.