public interface PullProvider
Modifier and Type | Field and Description |
---|---|
static int |
ATOMIC_VALUE
ATOMIC_VALUE is notified when the PullProvider is reading a sequence of items,
and one of the items is an atomic value rather than a node.
|
static int |
ATTRIBUTE
The ATTRIBUTE event is notified only for an attribute node that appears in its own right
as a top-level item in the sequence being read.
|
static int |
COMMENT
A COMMENT event is notified for a comment node, which may be either a top-level
comment or one nested within an element or document node.
|
static int |
END_DOCUMENT
END_DOCUMENT is notified at the end of processing a document node, that is,
after all the descendants of the document node have been notified.
|
static int |
END_ELEMENT
END_ELEMENT is notified at the end of an element node, that is, after all the children
and descendants of the element have either been processed or skipped.
|
static int |
END_OF_INPUT
The END_OF_INPUT event is returned to indicate the end of the sequence being read.
|
static int |
NAMESPACE
The NAMESPACE event is notified only for a namespace node that appears in its own right
as a top-level item in the sequence being read.
|
static int |
PROCESSING_INSTRUCTION
A PROCESSING_INSTRUCTION event is notified for a processing instruction node,
which may be either a top-level comment or one nested within an element or document node.
|
static int |
START_DOCUMENT
START_DOCUMENT is notified when a document node is encountered.
|
static int |
START_ELEMENT
START_ELEMENT is notified when an element node is encountered.
|
static int |
START_OF_INPUT
START_OF_INPUT is the initial state when the PullProvider is instantiated.
|
static int |
TEXT
A TEXT event is notified for a text node.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the event reader.
|
int |
current()
Get the event most recently returned by next(), or by other calls that change
the position, for example getStringValue() and skipToMatchingEnd().
|
AtomicValue |
getAtomicValue()
Get an atomic value.
|
AttributeCollection |
getAttributes()
Get the attributes associated with the current element.
|
NamespaceBinding[] |
getNamespaceDeclarations()
Get the namespace declarations associated with the current element.
|
NodeName |
getNodeName()
Get the NodeName identifying the name of the current node.
|
PipelineConfiguration |
getPipelineConfiguration()
Get configuration information.
|
SchemaType |
getSchemaType()
Get the type annotation of the current attribute or element node, or atomic value.
|
Location |
getSourceLocator()
Get the location of the current event.
|
CharSequence |
getStringValue()
Get the string value of the current element, text node, processing-instruction,
or top-level attribute or namespace node, or atomic value.
|
List<UnparsedEntity> |
getUnparsedEntities()
Get a list of unparsed entities.
|
int |
next()
Get the next event
|
void |
setPipelineConfiguration(PipelineConfiguration pipe)
Set configuration information.
|
int |
skipToMatchingEnd()
Skip the current subtree.
|
static final int START_OF_INPUT
static final int ATOMIC_VALUE
static final int START_DOCUMENT
static final int END_DOCUMENT
static final int START_ELEMENT
Following the notification of START_ELEMENT, the client may obtain information about the element node, such as its name and type annotation. The client may also call getAttributes() to obtain information about the attributes of the element node, and/or getNamespaceDeclarations() to get information about the namespace declarations. The client may then do one of the following:
static final int END_ELEMENT
static final int ATTRIBUTE
getAttributes()
method.static final int NAMESPACE
getNamespaceDeclarations()
method.static final int TEXT
static final int COMMENT
static final int PROCESSING_INSTRUCTION
static final int END_OF_INPUT
void setPipelineConfiguration(PipelineConfiguration pipe)
pipe
- the pipeline configurationPipelineConfiguration getPipelineConfiguration()
int next() throws XPathException
END_OF_INPUT
is returned at the end of the sequence.XPathException
- if a dynamic error occursint current()
AttributeCollection getAttributes() throws XPathException
Attributes may be read before or after reading the namespaces of an element, but must not be read after the first child node has been read, or after calling one of the methods skipToMatchingEnd(), getStringValue(), or getTypedValue().
XPathException
- if a dynamic error occursNamespaceBinding[] getNamespaceDeclarations() throws XPathException
It is permissible for this method to return namespace declarations that are redundant.
The NamespaceDeclarations object is guaranteed to remain unchanged until the next START_ELEMENT event, but may then be overwritten. The object should not be modified by the client.
Namespaces may be read before or after reading the attributes of an element, but must not be read after the first child node has been read, or after calling one of the methods skipToMatchingEnd(), getStringValue(), or getTypedValue().
XPathException
- if a dynamic error occursint skipToMatchingEnd() throws XPathException
IllegalStateException
- if the method is called at any time other than
immediately after a START_DOCUMENT or START_ELEMENT event.XPathException
- if a dynamic error occursvoid close()
END_OF_INPUT
has
been reported, but it is recommended to close it if reading terminates
prematurely. Once an event reader has been closed, the effect of further
calls on next() is undefined.NodeName getNodeName()
START_ELEMENT
, PROCESSING_INSTRUCTION
,
ATTRIBUTE
, or NAMESPACE
events. With some PullProvider implementations,
it can also be used after END_ELEMENT
, but this is not guaranteed: a client who
requires the information at that point (for example, to do serialization) should insert an
ElementNameTracker
into the pipeline.
If called at other times, the result is undefined and may result in an IllegalStateException.
If called when the current node is an unnamed namespace node (a node representing the default namespace)
the returned value is null.CharSequence getStringValue() throws XPathException
In other situations the result is undefined and may result in an IllegalStateException.
If the most recent event was a START_ELEMENT
, this method causes the content
of the element to be read. The current event on completion of this method will be the
corresponding END_ELEMENT
. The next call of next() will return the event following
the END_ELEMENT event.
XPathException
- if a dynamic error occursSchemaType getSchemaType()
AtomicValue getAtomicValue()
Location getSourceLocator()
List<UnparsedEntity> getUnparsedEntities()
UnparsedEntity
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.