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 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!!
| 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.
|
| Modifier | Constructor and Description |
|---|---|
protected |
DTMManager()
Default constructor is protected on purpose.
|
| Modifier and Type | Method and Description |
|---|---|
abstract DTM |
getDTM(int nodeHandle)
Get the instance of DTM that "owns" a node handle.
|
abstract DTM |
getDTM(Source source,
boolean unique,
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.
|
static DTMManager |
newInstance()
Obtain a new instance of a
DTMManager. |
public static final int IDENT_DTM_NODE_BITS
If you change IDENT_DTM_NODE_BITS, be sure to rebuild _ALL_ the files which use it... including the IDKey testcases.
(FuncGenerateKey currently uses the node identifier directly and thus is affected when this changes. The IDKEY results will still be _correct_ (presuming no other breakage), but simple equality comparison against the previous "golden" files will probably complain.)
public static final int IDENT_NODE_DEFAULT
public static final int IDENT_DTM_DEFAULT
public static final int IDENT_MAX_DTMS
public static DTMManager newInstance()
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:
net.sourceforge.htmlunit.xpath.xml.dtm.DTMManager system property.
META-INF/services/net.sourceforge.htmlunit.xpath.xml.dtm.DTMManager in jars
available to the runtime.
DTMManager classname, which is
net.sourceforge.htmlunit.xpath.xml.dtm.ref.DTMManagerDefault.
DTMManager it can use the factory to configure and obtain parser instances.public abstract DTM getDTM(Source source, boolean unique, boolean incremental, boolean doIndexing)
(More parameters may eventually need to be added for error handling and entity resolution, and to better control selection of implementations.)
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.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.Copyright © 2022–2023. All rights reserved.