Package net.sf.saxon.pull
Class ElementNameTracker
java.lang.Object
net.sf.saxon.pull.PullFilter
net.sf.saxon.pull.ElementNameTracker
- All Implemented Interfaces:
PullProvider
This is a filter that can be added to a pull pipeline to remember element names so that
they are available immediately after the END_ELEMENT event is notified
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int
(package private) int
Fields inherited from class net.sf.saxon.pull.PullFilter
currentEvent
Fields inherited from interface net.sf.saxon.pull.PullProvider
ATOMIC_VALUE, ATTRIBUTE, COMMENT, END_DOCUMENT, END_ELEMENT, END_OF_INPUT, NAMESPACE, PROCESSING_INSTRUCTION, START_DOCUMENT, START_ELEMENT, START_OF_INPUT, TEXT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Get the nameCode identifying the name of the current node.int
next()
Get the next event.Methods inherited from class net.sf.saxon.pull.PullFilter
close, current, getAtomicValue, getAttributes, getFingerprint, getNamePool, getNamespaceDeclarations, getPipelineConfiguration, getSourceLocator, getStringValue, getTypeAnnotation, getUnderlyingProvider, getUnparsedEntities, setPipelineConfiguration, skipToMatchingEnd
-
Field Details
-
used
int used -
elementJustEnded
int elementJustEnded
-
-
Constructor Details
-
ElementNameTracker
-
-
Method Details
-
next
Get the next event.Note that a subclass that overrides this method is responsible for ensuring that current() works properly. This can be achieved by setting the field currentEvent to the event returned by any call on next().
- Specified by:
next
in interfacePullProvider
- Overrides:
next
in classPullFilter
- Returns:
- an integer code indicating the type of event. The code
PullProvider.END_OF_INPUT
is returned at the end of the sequence. - Throws:
XPathException
-
getNameCode
public int getNameCode()Get the nameCode identifying the name of the current node. This method can be used after thePullProvider.START_ELEMENT
,PullProvider.PROCESSING_INSTRUCTION
,PullProvider.ATTRIBUTE
, orPullProvider.NAMESPACE
events. With some PullProvider implementations, including this one, it can also be used afterPullProvider.END_ELEMENT
: in fact, that is the main purpose of this class. 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 -1.- Specified by:
getNameCode
in interfacePullProvider
- Overrides:
getNameCode
in classPullFilter
- Returns:
- the nameCode. The nameCode can be used to obtain the prefix, local name, and namespace URI from the name pool.
-