public abstract class DTMManager extends Object
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
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!!
Modifier and Type | Field and Description |
---|---|
static int |
IDENT_DTM_DEFAULT
When this bitmask is ANDed with a DTM node handle number, the result
is the DTM's document identity number.
|
static int |
IDENT_DTM_NODE_BITS
This value, set at compile time, controls how many bits of the
DTM node identifier numbers are used to identify a node within a
document, and thus sets the maximum number of nodes per
document.
|
static int |
IDENT_MAX_DTMS
This is the maximum number of DTMs available.
|
static int |
IDENT_NODE_DEFAULT
When this bitmask is ANDed with a DTM node handle number, the result
is the low bits of the node's index number within that DTM.
|
boolean |
m_incremental |
boolean |
m_source_location |
protected XMLStringFactory |
m_xsf
Factory for creating XMLString objects.
|
Modifier | Constructor and Description |
---|---|
protected |
DTMManager()
Default constructor is protected on purpose.
|
Modifier and Type | Method and Description |
---|---|
abstract DTM |
createDocumentFragment()
Creates a DTM representing an empty
DocumentFragment object. |
abstract DTMIterator |
createDTMIterator(int node)
Create a new
DTMIterator that holds exactly one node. |
abstract DTMIterator |
createDTMIterator(int whatToShow,
DTMFilter filter,
boolean entityReferenceExpansion)
Create a new
DTMIterator based only on a whatToShow
and a DTMFilter. |
abstract DTMIterator |
createDTMIterator(Object xpathCompiler,
int pos)
Create a new
DTMIterator based on an XPath
UnionExpr. |
abstract DTMIterator |
createDTMIterator(String xpathString,
PrefixResolver presolver)
Create a new
DTMIterator based on an XPath
UnionExpr. |
abstract DTM |
getDTM(int nodeHandle)
Get the instance of DTM that "owns" a node handle.
|
abstract 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.
|
abstract int |
getDTMHandleFromNode(Node node)
Given a W3C DOM node, try and return a DTM handle.
|
abstract int |
getDTMIdentity(DTM dtm)
%TBD% Doc
NEEDSDOC @param dtm
NEEDSDOC ($objectName$) @return
|
int |
getDTMIdentityMask()
%TBD% Doc
NEEDSDOC ($objectName$) @return
|
boolean |
getIncremental()
Get a flag indicating whether an incremental transform is desired
|
int |
getNodeIdentityMask()
%TBD% Doc
NEEDSDOC ($objectName$) @return
|
boolean |
getSource_location()
Get a flag indicating whether the transformation phase should
keep track of line and column numbers for the input source
document.
|
XMLStringFactory |
getXMLStringFactory()
Get the XMLStringFactory used for the DTMs.
|
static DTMManager |
newInstance(XMLStringFactory xsf)
Obtain a new instance of a
DTMManager . |
abstract boolean |
release(DTM dtm,
boolean shouldHardDelete)
Release a DTM either to a lru pool, or completely remove reference.
|
void |
setIncremental(boolean incremental)
Set a flag indicating whether an incremental transform is desired
This flag should have the same value as the FEATURE_INCREMENTAL feature
which is set by the TransformerFactory.setAttribut() method before a
DTMManager is created
|
void |
setSource_location(boolean sourceLocation)
Set a flag indicating whether the transformation phase should
keep track of line and column numbers for the input source
document.
|
void |
setXMLStringFactory(XMLStringFactory xsf)
Set the XMLStringFactory used for the DTMs.
|
protected XMLStringFactory m_xsf
public boolean m_incremental
public boolean m_source_location
public static final int IDENT_DTM_NODE_BITS
public static final int IDENT_NODE_DEFAULT
public static final int IDENT_DTM_DEFAULT
public static final int IDENT_MAX_DTMS
public XMLStringFactory getXMLStringFactory()
public void setXMLStringFactory(XMLStringFactory xsf)
xsf
- a valid XMLStringFactory object, should not be null.public static DTMManager newInstance(XMLStringFactory xsf) throws DTMConfigurationException
DTMManager
.
This static method creates a new factory instance
This method uses the following ordered lookup procedure to determine
the DTMManager
implementation class to
load:
org.apache.xml.dtm.DTMManager
system
property.
META-INF/services/org.apache.xml.dtm.DTMManager
in jars available to the runtime.
DTMManager
classname, which is
org.apache.xml.dtm.ref.DTMManagerDefault
.
DTMManager
it can use the factory to configure
and obtain parser instances.DTMConfigurationException
- if the implementation is not available or cannot be instantiated.public abstract DTM getDTM(Source source, boolean unique, DTMWSFilter whiteSpaceFilter, boolean incremental, boolean doIndexing)
source
- the specification of the source object, which may be null,
in which case it is assumed that node construction will take
by some other means.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.public abstract DTM getDTM(int nodeHandle)
nodeHandle
- the nodeHandle.public abstract int getDTMHandleFromNode(Node node)
node
- Non-null reference to a DOM node.public abstract DTM createDocumentFragment()
DocumentFragment
object.public abstract boolean release(DTM dtm, boolean shouldHardDelete)
dtm
- The DTM to be released.shouldHardDelete
- True if the DTM should be removed no matter what.public abstract DTMIterator createDTMIterator(Object xpathCompiler, int pos)
DTMIterator
based on an XPath
UnionExpr.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.DTMIterator
.public abstract DTMIterator createDTMIterator(String xpathString, PrefixResolver presolver)
DTMIterator
based on an XPath
UnionExpr.xpathString
- Must be a valid string expressing a
UnionExpr.presolver
- An object that can resolve prefixes to namespace URLs.DTMIterator
.public abstract DTMIterator createDTMIterator(int whatToShow, DTMFilter filter, boolean entityReferenceExpansion)
DTMIterator
based only on a whatToShow
and a DTMFilter. The traversal semantics are defined as the
descendant access.
Note that DTMIterators may not be an exact match to DOM NodeIterators. They are initialized and used in much the same way as a NodeIterator, but their response to document mutation is not currently defined.
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
DTMFilter
, or null
to indicate no filter.entityReferenceExpansion
- The value of this flag determines
whether entity reference nodes are expanded.DTMIterator
.public abstract DTMIterator createDTMIterator(int node)
DTMIterator
that holds exactly one node.node
- The node handle that the DTMIterator will iterate to.DTMIterator
.public boolean getIncremental()
public void setIncremental(boolean incremental)
incremental
- boolean to use to set m_incremental.public boolean getSource_location()
public void setSource_location(boolean sourceLocation)
sourceLocation
- boolean to use to set m_source_locationpublic abstract int getDTMIdentity(DTM dtm)
public int getDTMIdentityMask()
public int getNodeIdentityMask()
Copyright © 2016 JBoss by Red Hat. All rights reserved.