public abstract class Builder extends java.lang.Object implements Receiver
Modifier and Type | Field and Description |
---|---|
static int |
AXIOM_TREE |
protected java.lang.String |
baseURI |
protected Configuration |
config |
protected NodeInfo |
currentRoot |
static int |
DOMINO_TREE |
static int |
JDOM_TREE |
static int |
JDOM2_TREE |
static int |
K_TREE |
protected boolean |
lineNumbering |
static int |
LINKED_TREE
Constant denoting the "linked tree" in which each node is represented as an object
|
protected NamePool |
namePool |
protected boolean |
open |
protected PipelineConfiguration |
pipe |
static int |
STANDARD_TREE
Alternative constant denoting the "linked tree" in which each node is represented as an object
Retained for backwards compatibility
|
protected boolean |
started |
protected java.lang.String |
systemId |
protected boolean |
timing |
static int |
TINY_TREE
Constant denoting the "tiny tree" in which the tree is represented internally using arrays of integers
|
static int |
TINY_TREE_CONDENSED
Constant denoting the "tiny tree condensed", a variant of the tiny tree in which text and attribute nodes
sharing the same string value use shared storage for the value.
|
static int |
UNSPECIFIED_TREE_MODEL
Constant denoting a request for the default tree model
|
protected boolean |
useEventLocation |
Constructor and Description |
---|
Builder()
Create a Builder and initialise variables
|
Builder(PipelineConfiguration pipe) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Notify the end of the event stream
|
java.lang.String |
getBaseURI()
Get the base URI of the document node of the tree being constructed by this builder
|
BuilderMonitor |
getBuilderMonitor()
Get a builder monitor for this builder.
|
Configuration |
getConfiguration()
Get the Configuration
|
NodeInfo |
getCurrentRoot()
Get the current root node.
|
PipelineConfiguration |
getPipelineConfiguration()
Get the pipeline configuration
|
java.lang.String |
getSystemId()
The SystemId is equivalent to the document-uri property defined in the XDM data model.
|
boolean |
isTiming()
Get timing option
|
boolean |
isUseEventLocation()
Ask whether the system IDs of constructed nodes (especially element nodes) are to be
taken from the system ID property of the
Location object passed as a parameter to
the Receiver.startElement(NodeName, SchemaType, Location, int) event. |
void |
open()
Notify the start of the event stream
|
void |
reset()
Reset the builder to its initial state.
|
void |
setBaseURI(java.lang.String baseURI)
Set the base URI of the document node of the tree being constructed by this builder
|
void |
setLineNumbering(boolean lineNumbering)
Set line numbering on or off
|
void |
setPipelineConfiguration(PipelineConfiguration pipe)
Set the pipeline configuration
|
void |
setSystemId(java.lang.String systemId)
The SystemId is equivalent to the document-uri property defined in the XDM data model.
|
void |
setTiming(boolean on)
Set timing option on or off
|
void |
setUseEventLocation(boolean useEventLocation)
Say that the system IDs of constructed nodes (especially element nodes) are to be
taken from the system ID property of the
Location object passed as a parameter to
the Receiver.startElement(NodeName, SchemaType, Location, int) event. |
boolean |
usesTypeAnnotations()
Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations
supplied on element and attribute events
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
append, append, attribute, characters, comment, endDocument, endElement, handlesAppend, namespace, processingInstruction, setUnparsedEntity, startContent, startDocument, startElement
public static final int UNSPECIFIED_TREE_MODEL
public static final int LINKED_TREE
public static final int STANDARD_TREE
public static final int TINY_TREE
public static final int TINY_TREE_CONDENSED
public static final int JDOM_TREE
public static final int JDOM2_TREE
public static final int AXIOM_TREE
public static final int DOMINO_TREE
public static final int K_TREE
protected PipelineConfiguration pipe
protected Configuration config
protected NamePool namePool
protected java.lang.String systemId
protected java.lang.String baseURI
protected NodeInfo currentRoot
protected boolean lineNumbering
protected boolean useEventLocation
protected boolean started
protected boolean timing
protected boolean open
public Builder()
public Builder(PipelineConfiguration pipe)
public void setPipelineConfiguration(PipelineConfiguration pipe)
Receiver
setPipelineConfiguration
in interface Receiver
pipe
- the pipeline configurationpublic PipelineConfiguration getPipelineConfiguration()
Receiver
getPipelineConfiguration
in interface Receiver
public Configuration getConfiguration()
public BuilderMonitor getBuilderMonitor()
public void setUseEventLocation(boolean useEventLocation)
Location
object passed as a parameter to
the Receiver.startElement(NodeName, SchemaType, Location, int)
event. This property
should be set to true when building a document from events originating with an XML parser,
because the Location
object in this case will have a system ID that changes
as external entities are processed. The base URI of a node in this case is determined
by the system ID, modified by any xml:base
attributes. If the property
is set to false, all nodes in the tree have the same system ID, this being supplied
as the systemID property of the builder. This will typically be the static base URI
of the instruction in the query or stylesheet that was used to construct the root node;
in the case of xsl:result-document
, it will be the absolutized value of the
href
attribute of the instruction.useEventLocation
- true if the system ID is to be taken from the Location parameter of
each event. The default value is true.public boolean isUseEventLocation()
Location
object passed as a parameter to
the Receiver.startElement(NodeName, SchemaType, Location, int)
event.public void setSystemId(java.lang.String systemId)
setSystemId
in interface javax.xml.transform.Result
setSystemId
in interface Receiver
systemId
- the SystemId, that is, the document-uri.public java.lang.String getSystemId()
getSystemId
in interface javax.xml.transform.Result
public void setBaseURI(java.lang.String baseURI)
baseURI
- the base URIpublic java.lang.String getBaseURI()
public void setLineNumbering(boolean lineNumbering)
lineNumbering
- set to true if line numbers are to be maintained for nodes in the tree being
constructed.public void setTiming(boolean on)
on
- set to true to turn timing on. This causes the builder to display statistical information
about the tree that is constructed. It corresponds to the command line -t optionpublic boolean isTiming()
public void open()
Receiver
public void close() throws XPathException
Receiver
close
in interface Receiver
XPathException
- if an error occurspublic boolean usesTypeAnnotations()
usesTypeAnnotations
in interface Receiver
public NodeInfo getCurrentRoot()
public void reset()
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.