Package com.fasterxml.aalto.in
Class XmlScanner
- java.lang.Object
-
- com.fasterxml.aalto.in.XmlScanner
-
- All Implemented Interfaces:
XmlConsts
,javax.xml.namespace.NamespaceContext
,javax.xml.stream.XMLStreamConstants
- Direct Known Subclasses:
ByteBasedScanner
,ReaderScanner
public abstract class XmlScanner extends java.lang.Object implements XmlConsts, javax.xml.stream.XMLStreamConstants, javax.xml.namespace.NamespaceContext
This is the abstract base class for all scanner implementations, defining operations the actual parser requires from the low-level scanners. Scanners are encoding and input type (byte, char / stream, block) specific, so there are many implementations.
-
-
Field Summary
Fields Modifier and Type Field Description protected AttributeCollector
_attrCollector
protected int
_attrCount
protected boolean
_cfgCoalescing
protected boolean
_cfgLazyParsing
protected ReaderConfig
_config
protected ElementScope
_currElem
Information about the current element on the stackprotected int
_currNsCount
This is a temporary state variable, valid during START_ELEMENT event.protected int
_currRow
The row on which the character to read next is on.protected int
_currToken
protected NsBinding
_defaultNs
Default namespace binding is a per-document singleton, like explicit bindings, and used for elements (never for attributes).protected int
_depth
Number of START_ELEMENT events returned for which no END_ELEMENT has been returned; including current event.protected boolean
_entityPending
Flag set to indicate that an entity is pendingprotected boolean
_isEmptyTag
Flag that is used if the current state isSTART_ELEMENT
orEND_ELEMENT
, to indicate if the underlying physical tag is a so-called empty tag (one ending with "/>")protected FixedNsContext
_lastNsContext
Last returnedNamespaceContext
, created for a call togetNonTransientNamespaceContext()
, iff this would still be a valid context.protected NsDeclaration
_lastNsDecl
Pointer to the last namespace declaration encountered.protected char[]
_nameBuffer
Similarly, need a char buffer for actual String construction (in future, could perhaps use StringBuilder?).protected PName[]
_nsBindingCache
Although unbound pname instances can be easily and safely reused, bound ones are per-document.protected int
_nsBindingCount
protected NsBinding[]
_nsBindings
Array containing all prefix bindings needed within the current document, so far (if any).protected int
_nsBindMisses
protected long
_pastBytesOrChars
Number of bytes that were read and processed before the contents of the current buffer; used for calculating absolute offsets.protected java.lang.String
_publicId
Public id of the current event (DTD), if any.protected int
_rowStartOffset
Offset used to calculate the column value given current input buffer pointer.protected long
_startColumn
Current column at start of current (last returned) tokenprotected long
_startRawOffset
Offset (in chars or bytes) at start of current tokenprotected long
_startRow
Current row at start of current (last returned) tokenprotected java.lang.String
_systemId
System id of the current event (DTD), if any.protected TextBuilder
_textBuilder
Textual content of the current eventprotected boolean
_tokenIncomplete
protected PName
_tokenName
Current name associated with the token, if any.protected boolean
_xml11
Whether validity checks (wrt.private static int
BIND_CACHE_MASK
private static int
BIND_CACHE_SIZE
Size of the bind cache can be reasonably small, and should still get high enough hit rateprivate static int
BIND_MISSES_TO_ACTIVATE_CACHE
Let's activate cache quite soon, no need to wait for hundreds of misses; just try to avoid cache construction if all we get is soap envelope element or such.protected java.lang.String
CDATA_STR
String that identifies CDATA section (after "<![" prefix)protected static int
INT_0
protected static int
INT_9
protected static int
INT_a
protected static int
INT_A
protected static int
INT_AMP
protected static int
INT_APOS
protected static int
INT_COLON
protected static int
INT_CR
protected static int
INT_EQ
protected static int
INT_EXCL
protected static int
INT_f
protected static int
INT_F
protected static int
INT_GT
protected static int
INT_HYPHEN
protected static int
INT_LBRACKET
protected static int
INT_LF
protected static int
INT_LT
protected static int
INT_NULL
protected static int
INT_QMARK
protected static int
INT_QUOTE
protected static int
INT_RBRACKET
protected static int
INT_SLASH
protected static int
INT_SPACE
protected static int
INT_TAB
protected static int
INT_z
protected static int
MAX_UNICODE_CHAR
This constant defines the highest Unicode character allowed in XML content.static int
TOKEN_EOI
This token type signifies end-of-input, in cases where it can be returned.-
Fields inherited from interface com.fasterxml.aalto.util.XmlConsts
CHAR_CR, CHAR_LF, CHAR_NULL, CHAR_SPACE, STAX_DEFAULT_OUTPUT_ENCODING, STAX_DEFAULT_OUTPUT_VERSION, XML_DECL_KW_ENCODING, XML_DECL_KW_STANDALONE, XML_DECL_KW_VERSION, XML_SA_NO, XML_SA_YES, XML_V_10, XML_V_10_STR, XML_V_11, XML_V_11_STR, XML_V_UNKNOWN
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
XmlScanner(ReaderConfig cfg)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
_closeSource()
protected void
_releaseBuffers()
protected PName
bindName(PName name, java.lang.String prefix)
This method is called to find/create a fully qualified (bound) name (element / attribute), for a name with prefix.protected void
bindNs(PName name, java.lang.String uri)
Method called when we are ready to bind a declared namespace.protected void
checkImmutableBinding(java.lang.String prefix, java.lang.String uri)
Method called when an immutable ns prefix (xml, xmlns) is encountered.void
close(boolean forceCloseSource)
Method called at point when the parsing process has ended (either by encountering end of the input, or via explicit close), and buffers can and should be released.byte[]
decodeAttrBinaryValue(int index, org.codehaus.stax2.typed.Base64Variant v, org.codehaus.stax2.ri.typed.CharArrayBase64Decoder dec)
void
decodeAttrValue(int index, org.codehaus.stax2.typed.TypedValueDecoder tvd)
int
decodeAttrValues(int index, org.codehaus.stax2.typed.TypedArrayDecoder tad)
Method called to decode the attribute value that consists of zero or more space-separated tokens.int
decodeElements(org.codehaus.stax2.typed.TypedArrayDecoder tad, boolean reset)
Method called by the stream reader to decode space-separated tokens that are part of the current text event, using given decoder.int
findAttrIndex(java.lang.String nsURI, java.lang.String localName)
private NsDeclaration
findCurrNsDecl(int index)
protected NsBinding
findOrCreateBinding(java.lang.String prefix)
Method called when a namespace declaration needs to find the binding object (essentially a per-prefix-per-document canonical container object)protected abstract void
finishCData()
protected abstract void
finishCharacters()
protected abstract void
finishComment()
protected abstract void
finishDTD(boolean copyContents)
protected abstract void
finishPI()
protected abstract void
finishSpace()
protected abstract void
finishToken()
This method is called to ensure that the current token/event has been completely parsed, such that we have all the data needed to return it (textual content, PI data, comment text etc)void
fireSaxCharacterEvents(org.xml.sax.ContentHandler h)
void
fireSaxCommentEvent(org.xml.sax.ext.LexicalHandler h)
void
fireSaxEndElement(org.xml.sax.ContentHandler h)
void
fireSaxPIEvent(org.xml.sax.ContentHandler h)
void
fireSaxSpaceEvents(org.xml.sax.ContentHandler h)
void
fireSaxStartElement(org.xml.sax.ContentHandler h, org.xml.sax.Attributes attrs)
AttributeCollector
getAttrCollector()
int
getAttrCount()
java.lang.String
getAttrLocalName(int index)
java.lang.String
getAttrNsURI(int index)
java.lang.String
getAttrPrefix(int index)
java.lang.String
getAttrPrefixedName(int index)
javax.xml.namespace.QName
getAttrQName(int index)
java.lang.String
getAttrType(int index)
java.lang.String
getAttrValue(int index)
java.lang.String
getAttrValue(java.lang.String nsURI, java.lang.String localName)
ReaderConfig
getConfig()
abstract int
getCurrentColumnNr()
int
getCurrentLineNr()
abstract org.codehaus.stax2.XMLStreamLocation2
getCurrentLocation()
int
getDepth()
java.lang.String
getDTDPublicId()
java.lang.String
getDTDSystemId()
abstract long
getEndingByteOffset()
abstract long
getEndingCharOffset()
org.codehaus.stax2.XMLStreamLocation2
getEndLocation()
java.lang.String
getInputPublicId()
java.lang.String
getInputSystemId()
PName
getName()
java.lang.String
getNamespacePrefix(int index)
java.lang.String
getNamespaceURI()
java.lang.String
getNamespaceURI(int index)
java.lang.String
getNamespaceURI(java.lang.String prefix)
javax.xml.namespace.NamespaceContext
getNonTransientNamespaceContext()
int
getNsCount()
java.lang.String
getPrefix(java.lang.String nsURI)
java.util.Iterator<java.lang.String>
getPrefixes(java.lang.String nsURI)
javax.xml.namespace.QName
getQName()
abstract long
getStartingByteOffset()
abstract long
getStartingCharOffset()
org.codehaus.stax2.XMLStreamLocation2
getStartLocation()
java.lang.String
getText()
int
getText(java.io.Writer w, boolean preserveContents)
char[]
getTextCharacters()
int
getTextCharacters(int srcStart, char[] target, int targetStart, int len)
int
getTextLength()
protected char
handleInvalidXmlChar(int i)
boolean
hasEmptyStack()
boolean
isAttrSpecified(int index)
boolean
isEmptyTag()
boolean
isTextWhitespace()
protected abstract boolean
loadMore()
protected void
loadMoreGuaranteed()
Method that tries to load at least one more byte into buffer; and if that fails, throws an appropriate EOI exception.protected void
loadMoreGuaranteed(int tt)
abstract int
nextFromProlog(boolean isProlog)
abstract int
nextFromTree()
protected void
reportDoubleHyphenInComments()
protected void
reportDuplicateNsDecl(java.lang.String prefix)
protected void
reportEntityOverflow()
protected void
reportEofInName(char[] cbuf, int clen)
protected void
reportIllegalCDataEnd()
protected void
reportIllegalNsDecl(java.lang.String prefix)
protected void
reportIllegalNsDecl(java.lang.String prefix, java.lang.String uri)
protected void
reportInputProblem(java.lang.String msg)
protected void
reportInvalidNameChar(int ch, int index)
protected void
reportInvalidNsIndex(int index)
protected void
reportInvalidXmlChar(int ch)
protected void
reportMissingPISpace(int ch)
Called when there's an unexpected char after PI target (non-ws, not part of'?>'
end markerprotected void
reportMultipleColonsInName()
protected void
reportPrologProblem(boolean isProlog, java.lang.String msg)
protected void
reportPrologUnexpChar(boolean isProlog, int ch, java.lang.String msg)
protected void
reportPrologUnexpElement(boolean isProlog, int ch)
protected void
reportTreeUnexpChar(int ch, java.lang.String msg)
protected void
reportUnboundPrefix(PName name, boolean isAttr)
protected void
reportUnexpandedEntityInAttr(PName name, boolean isNsDecl)
Method called when a call to expand an entity within attribute value fails to expand it.protected void
reportUnexpectedEndTag(java.lang.String expName)
void
resetForDecoding(org.codehaus.stax2.typed.Base64Variant v, org.codehaus.stax2.ri.typed.CharArrayBase64Decoder dec, boolean firstChunk)
Method called by the stream reader to reset given base64 decoder with data from the current text event.protected abstract void
skipCData()
protected abstract boolean
skipCharacters()
protected abstract boolean
skipCoalescedText()
Secondary skip method called after primary text segment has been skipped, and we are in coalescing mode.protected abstract void
skipComment()
protected abstract void
skipPI()
protected abstract void
skipSpace()
protected boolean
skipToken()
This method is called to essentially skip remaining of the current token (data of PI etc)protected void
throwInvalidSpace(int i)
protected void
throwNullChar()
protected void
throwUnexpectedChar(int i, java.lang.String msg)
protected void
verifyXmlChar(int value)
-
-
-
Field Detail
-
CDATA_STR
protected final java.lang.String CDATA_STR
String that identifies CDATA section (after "<![" prefix)- See Also:
- Constant Field Values
-
TOKEN_EOI
public static final int TOKEN_EOI
This token type signifies end-of-input, in cases where it can be returned. In other cases, an exception may be thrown.- See Also:
- Constant Field Values
-
MAX_UNICODE_CHAR
protected static final int MAX_UNICODE_CHAR
This constant defines the highest Unicode character allowed in XML content.- See Also:
- Constant Field Values
-
INT_NULL
protected static final int INT_NULL
- See Also:
- Constant Field Values
-
INT_CR
protected static final int INT_CR
- See Also:
- Constant Field Values
-
INT_LF
protected static final int INT_LF
- See Also:
- Constant Field Values
-
INT_TAB
protected static final int INT_TAB
- See Also:
- Constant Field Values
-
INT_SPACE
protected static final int INT_SPACE
- See Also:
- Constant Field Values
-
INT_HYPHEN
protected static final int INT_HYPHEN
- See Also:
- Constant Field Values
-
INT_QMARK
protected static final int INT_QMARK
- See Also:
- Constant Field Values
-
INT_AMP
protected static final int INT_AMP
- See Also:
- Constant Field Values
-
INT_LT
protected static final int INT_LT
- See Also:
- Constant Field Values
-
INT_GT
protected static final int INT_GT
- See Also:
- Constant Field Values
-
INT_QUOTE
protected static final int INT_QUOTE
- See Also:
- Constant Field Values
-
INT_APOS
protected static final int INT_APOS
- See Also:
- Constant Field Values
-
INT_EXCL
protected static final int INT_EXCL
- See Also:
- Constant Field Values
-
INT_COLON
protected static final int INT_COLON
- See Also:
- Constant Field Values
-
INT_LBRACKET
protected static final int INT_LBRACKET
- See Also:
- Constant Field Values
-
INT_RBRACKET
protected static final int INT_RBRACKET
- See Also:
- Constant Field Values
-
INT_SLASH
protected static final int INT_SLASH
- See Also:
- Constant Field Values
-
INT_EQ
protected static final int INT_EQ
- See Also:
- Constant Field Values
-
INT_A
protected static final int INT_A
- See Also:
- Constant Field Values
-
INT_F
protected static final int INT_F
- See Also:
- Constant Field Values
-
INT_a
protected static final int INT_a
- See Also:
- Constant Field Values
-
INT_f
protected static final int INT_f
- See Also:
- Constant Field Values
-
INT_z
protected static final int INT_z
- See Also:
- Constant Field Values
-
INT_0
protected static final int INT_0
- See Also:
- Constant Field Values
-
INT_9
protected static final int INT_9
- See Also:
- Constant Field Values
-
BIND_MISSES_TO_ACTIVATE_CACHE
private static final int BIND_MISSES_TO_ACTIVATE_CACHE
Let's activate cache quite soon, no need to wait for hundreds of misses; just try to avoid cache construction if all we get is soap envelope element or such.- See Also:
- Constant Field Values
-
BIND_CACHE_SIZE
private static final int BIND_CACHE_SIZE
Size of the bind cache can be reasonably small, and should still get high enough hit rate- See Also:
- Constant Field Values
-
BIND_CACHE_MASK
private static final int BIND_CACHE_MASK
- See Also:
- Constant Field Values
-
_config
protected final ReaderConfig _config
-
_xml11
protected final boolean _xml11
Whether validity checks (wrt. name and text characters) and normalization (linefeeds) is to be done using xml 1.1 rules, or basic xml 1.0 rules. Default is 1.0.
-
_cfgCoalescing
protected final boolean _cfgCoalescing
-
_cfgLazyParsing
protected boolean _cfgLazyParsing
-
_currToken
protected int _currToken
-
_tokenIncomplete
protected boolean _tokenIncomplete
-
_depth
protected int _depth
Number of START_ELEMENT events returned for which no END_ELEMENT has been returned; including current event.
-
_textBuilder
protected final TextBuilder _textBuilder
Textual content of the current event
-
_entityPending
protected boolean _entityPending
Flag set to indicate that an entity is pending
-
_nameBuffer
protected char[] _nameBuffer
Similarly, need a char buffer for actual String construction (in future, could perhaps use StringBuilder?). It is used for holding things like names (element, attribute), and attribute values.
-
_tokenName
protected PName _tokenName
Current name associated with the token, if any. Name of the current element, target of processing instruction, or name of an unexpanded entity.
-
_isEmptyTag
protected boolean _isEmptyTag
Flag that is used if the current state isSTART_ELEMENT
orEND_ELEMENT
, to indicate if the underlying physical tag is a so-called empty tag (one ending with "/>")
-
_currElem
protected ElementScope _currElem
Information about the current element on the stack
-
_publicId
protected java.lang.String _publicId
Public id of the current event (DTD), if any.
-
_systemId
protected java.lang.String _systemId
System id of the current event (DTD), if any.
-
_lastNsDecl
protected NsDeclaration _lastNsDecl
Pointer to the last namespace declaration encountered. Because of backwards linking, it also serves as the head of the linked list of all active namespace declarations starting from the most recent one.
-
_currNsCount
protected int _currNsCount
This is a temporary state variable, valid during START_ELEMENT event. For those events, contains number of namespace declarations available. For END_ELEMENT, this count is computed on the fly.
-
_defaultNs
protected NsBinding _defaultNs
Default namespace binding is a per-document singleton, like explicit bindings, and used for elements (never for attributes).
-
_nsBindings
protected NsBinding[] _nsBindings
Array containing all prefix bindings needed within the current document, so far (if any). These bindings are not in a particular order, and they specifically do NOT represent actual namespace declarations parsed from xml content.
-
_nsBindingCount
protected int _nsBindingCount
-
_nsBindingCache
protected PName[] _nsBindingCache
Although unbound pname instances can be easily and safely reused, bound ones are per-document. However, it makes sense to try to reuse them too; at least using a minimal static cache, activate only after certain number of cache misses (to avoid overhead for tiny documents, or documents with few or no namespace prefixes).
-
_nsBindMisses
protected int _nsBindMisses
-
_lastNsContext
protected FixedNsContext _lastNsContext
Last returnedNamespaceContext
, created for a call togetNonTransientNamespaceContext()
, iff this would still be a valid context.
-
_attrCollector
protected final AttributeCollector _attrCollector
-
_attrCount
protected int _attrCount
-
_pastBytesOrChars
protected long _pastBytesOrChars
Number of bytes that were read and processed before the contents of the current buffer; used for calculating absolute offsets.
-
_currRow
protected int _currRow
The row on which the character to read next is on. Note that it is 0-based, so API will generally add one to it before returning the value
-
_rowStartOffset
protected int _rowStartOffset
Offset used to calculate the column value given current input buffer pointer. May be negative, if the first character of the row was contained within an earlier buffer.
-
_startRawOffset
protected long _startRawOffset
Offset (in chars or bytes) at start of current token
-
_startRow
protected long _startRow
Current row at start of current (last returned) token
-
_startColumn
protected long _startColumn
Current column at start of current (last returned) token
-
-
Constructor Detail
-
XmlScanner
protected XmlScanner(ReaderConfig cfg)
-
-
Method Detail
-
close
public final void close(boolean forceCloseSource) throws javax.xml.stream.XMLStreamException
Method called at point when the parsing process has ended (either by encountering end of the input, or via explicit close), and buffers can and should be released.- Parameters:
forceCloseSource
- True if the underlying input source is to be closed, independent of whether auto-close has been set to true via configuration (or if the scanner manages the input source)- Throws:
javax.xml.stream.XMLStreamException
-
_releaseBuffers
protected void _releaseBuffers()
-
_closeSource
protected abstract void _closeSource() throws java.io.IOException
- Throws:
java.io.IOException
-
getConfig
public ReaderConfig getConfig()
-
getAttrCollector
public AttributeCollector getAttrCollector()
-
nextFromProlog
public abstract int nextFromProlog(boolean isProlog) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
nextFromTree
public abstract int nextFromTree() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
finishToken
protected abstract void finishToken() throws javax.xml.stream.XMLStreamException
This method is called to ensure that the current token/event has been completely parsed, such that we have all the data needed to return it (textual content, PI data, comment text etc)- Throws:
javax.xml.stream.XMLStreamException
-
skipToken
protected final boolean skipToken() throws javax.xml.stream.XMLStreamException
This method is called to essentially skip remaining of the current token (data of PI etc)- Returns:
- True If by skipping we also figured out following event type (and assigned its type to _currToken); false if that remains to be done
- Throws:
javax.xml.stream.XMLStreamException
-
getCurrentLocation
public abstract org.codehaus.stax2.XMLStreamLocation2 getCurrentLocation()
- Returns:
- Current input location
-
getStartLocation
public final org.codehaus.stax2.XMLStreamLocation2 getStartLocation()
-
getStartingByteOffset
public abstract long getStartingByteOffset()
-
getStartingCharOffset
public abstract long getStartingCharOffset()
-
getEndingByteOffset
public abstract long getEndingByteOffset() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
getEndingCharOffset
public abstract long getEndingCharOffset() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
getEndLocation
public org.codehaus.stax2.XMLStreamLocation2 getEndLocation() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
getCurrentLineNr
public final int getCurrentLineNr()
-
getCurrentColumnNr
public abstract int getCurrentColumnNr()
-
getInputSystemId
public final java.lang.String getInputSystemId()
-
getInputPublicId
public final java.lang.String getInputPublicId()
-
hasEmptyStack
public final boolean hasEmptyStack()
-
getDepth
public final int getDepth()
-
isEmptyTag
public final boolean isEmptyTag()
-
getName
public final PName getName()
-
getQName
public final javax.xml.namespace.QName getQName()
-
getDTDPublicId
public final java.lang.String getDTDPublicId()
-
getDTDSystemId
public final java.lang.String getDTDSystemId()
-
getText
public final java.lang.String getText() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
getTextLength
public final int getTextLength() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
getTextCharacters
public final char[] getTextCharacters() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
getTextCharacters
public final int getTextCharacters(int srcStart, char[] target, int targetStart, int len) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
getText
public final int getText(java.io.Writer w, boolean preserveContents) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
isTextWhitespace
public final boolean isTextWhitespace() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
decodeElements
public final int decodeElements(org.codehaus.stax2.typed.TypedArrayDecoder tad, boolean reset) throws javax.xml.stream.XMLStreamException
Method called by the stream reader to decode space-separated tokens that are part of the current text event, using given decoder.- Parameters:
reset
- If true, need to tell text buffer to reset its decoding state; if false, shouldn't- Throws:
javax.xml.stream.XMLStreamException
-
resetForDecoding
public final void resetForDecoding(org.codehaus.stax2.typed.Base64Variant v, org.codehaus.stax2.ri.typed.CharArrayBase64Decoder dec, boolean firstChunk) throws javax.xml.stream.XMLStreamException
Method called by the stream reader to reset given base64 decoder with data from the current text event.- Throws:
javax.xml.stream.XMLStreamException
-
fireSaxStartElement
public void fireSaxStartElement(org.xml.sax.ContentHandler h, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
fireSaxEndElement
public void fireSaxEndElement(org.xml.sax.ContentHandler h) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
fireSaxCharacterEvents
public void fireSaxCharacterEvents(org.xml.sax.ContentHandler h) throws javax.xml.stream.XMLStreamException, org.xml.sax.SAXException
- Throws:
javax.xml.stream.XMLStreamException
org.xml.sax.SAXException
-
fireSaxSpaceEvents
public void fireSaxSpaceEvents(org.xml.sax.ContentHandler h) throws javax.xml.stream.XMLStreamException, org.xml.sax.SAXException
- Throws:
javax.xml.stream.XMLStreamException
org.xml.sax.SAXException
-
fireSaxCommentEvent
public void fireSaxCommentEvent(org.xml.sax.ext.LexicalHandler h) throws javax.xml.stream.XMLStreamException, org.xml.sax.SAXException
- Throws:
javax.xml.stream.XMLStreamException
org.xml.sax.SAXException
-
fireSaxPIEvent
public void fireSaxPIEvent(org.xml.sax.ContentHandler h) throws javax.xml.stream.XMLStreamException, org.xml.sax.SAXException
- Throws:
javax.xml.stream.XMLStreamException
org.xml.sax.SAXException
-
getAttrCount
public final int getAttrCount()
-
getAttrLocalName
public final java.lang.String getAttrLocalName(int index)
-
getAttrQName
public final javax.xml.namespace.QName getAttrQName(int index)
-
getAttrPrefixedName
public final java.lang.String getAttrPrefixedName(int index)
-
getAttrNsURI
public final java.lang.String getAttrNsURI(int index)
-
getAttrPrefix
public final java.lang.String getAttrPrefix(int index)
-
getAttrValue
public final java.lang.String getAttrValue(int index)
-
getAttrValue
public final java.lang.String getAttrValue(java.lang.String nsURI, java.lang.String localName)
-
decodeAttrValue
public final void decodeAttrValue(int index, org.codehaus.stax2.typed.TypedValueDecoder tvd) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
decodeAttrValues
public final int decodeAttrValues(int index, org.codehaus.stax2.typed.TypedArrayDecoder tad) throws javax.xml.stream.XMLStreamException
Method called to decode the attribute value that consists of zero or more space-separated tokens. Decoding is done using the decoder provided.- Returns:
- Number of tokens decoded
- Throws:
javax.xml.stream.XMLStreamException
-
decodeAttrBinaryValue
public final byte[] decodeAttrBinaryValue(int index, org.codehaus.stax2.typed.Base64Variant v, org.codehaus.stax2.ri.typed.CharArrayBase64Decoder dec) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
findAttrIndex
public final int findAttrIndex(java.lang.String nsURI, java.lang.String localName)
-
getAttrType
public final java.lang.String getAttrType(int index)
-
isAttrSpecified
public final boolean isAttrSpecified(int index)
-
getNsCount
public final int getNsCount()
-
getNamespacePrefix
public final java.lang.String getNamespacePrefix(int index)
-
getNamespaceURI
public final java.lang.String getNamespaceURI(int index)
-
findCurrNsDecl
private NsDeclaration findCurrNsDecl(int index)
-
getNamespaceURI
public final java.lang.String getNamespaceURI()
-
getNonTransientNamespaceContext
public final javax.xml.namespace.NamespaceContext getNonTransientNamespaceContext()
-
getNamespaceURI
public java.lang.String getNamespaceURI(java.lang.String prefix)
- Specified by:
getNamespaceURI
in interfacejavax.xml.namespace.NamespaceContext
-
getPrefix
public java.lang.String getPrefix(java.lang.String nsURI)
- Specified by:
getPrefix
in interfacejavax.xml.namespace.NamespaceContext
-
getPrefixes
public java.util.Iterator<java.lang.String> getPrefixes(java.lang.String nsURI)
- Specified by:
getPrefixes
in interfacejavax.xml.namespace.NamespaceContext
-
finishCharacters
protected abstract void finishCharacters() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
finishCData
protected abstract void finishCData() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
finishComment
protected abstract void finishComment() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
finishDTD
protected abstract void finishDTD(boolean copyContents) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
finishPI
protected abstract void finishPI() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
finishSpace
protected abstract void finishSpace() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
skipCharacters
protected abstract boolean skipCharacters() throws javax.xml.stream.XMLStreamException
- Returns:
- True, if an unexpanded entity was encountered (and is now pending)
- Throws:
javax.xml.stream.XMLStreamException
-
skipCData
protected abstract void skipCData() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
skipComment
protected abstract void skipComment() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
skipPI
protected abstract void skipPI() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
skipSpace
protected abstract void skipSpace() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
skipCoalescedText
protected abstract boolean skipCoalescedText() throws javax.xml.stream.XMLStreamException
Secondary skip method called after primary text segment has been skipped, and we are in coalescing mode.- Returns:
- True, if an unexpanded entity was encountered (and is now pending)
- Throws:
javax.xml.stream.XMLStreamException
-
loadMore
protected abstract boolean loadMore() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
bindName
protected final PName bindName(PName name, java.lang.String prefix)
This method is called to find/create a fully qualified (bound) name (element / attribute), for a name with prefix. For non-prefixed names this method will not get called
-
findOrCreateBinding
protected final NsBinding findOrCreateBinding(java.lang.String prefix) throws javax.xml.stream.XMLStreamException
Method called when a namespace declaration needs to find the binding object (essentially a per-prefix-per-document canonical container object)- Throws:
javax.xml.stream.XMLStreamException
-
bindNs
protected final void bindNs(PName name, java.lang.String uri) throws javax.xml.stream.XMLStreamException
Method called when we are ready to bind a declared namespace.- Throws:
javax.xml.stream.XMLStreamException
-
checkImmutableBinding
protected final void checkImmutableBinding(java.lang.String prefix, java.lang.String uri) throws javax.xml.stream.XMLStreamException
Method called when an immutable ns prefix (xml, xmlns) is encountered.- Throws:
javax.xml.stream.XMLStreamException
-
loadMoreGuaranteed
protected final void loadMoreGuaranteed() throws javax.xml.stream.XMLStreamException
Method that tries to load at least one more byte into buffer; and if that fails, throws an appropriate EOI exception.- Throws:
javax.xml.stream.XMLStreamException
-
loadMoreGuaranteed
protected final void loadMoreGuaranteed(int tt) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
verifyXmlChar
protected final void verifyXmlChar(int value) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
reportInputProblem
protected void reportInputProblem(java.lang.String msg) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
reportUnexpandedEntityInAttr
protected void reportUnexpandedEntityInAttr(PName name, boolean isNsDecl) throws javax.xml.stream.XMLStreamException
Method called when a call to expand an entity within attribute value fails to expand it.- Throws:
javax.xml.stream.XMLStreamException
-
reportPrologUnexpElement
protected void reportPrologUnexpElement(boolean isProlog, int ch) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
reportPrologUnexpChar
protected void reportPrologUnexpChar(boolean isProlog, int ch, java.lang.String msg) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
reportPrologProblem
protected void reportPrologProblem(boolean isProlog, java.lang.String msg) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
reportTreeUnexpChar
protected void reportTreeUnexpChar(int ch, java.lang.String msg) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
reportInvalidNameChar
protected void reportInvalidNameChar(int ch, int index) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
reportInvalidXmlChar
protected void reportInvalidXmlChar(int ch) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
reportEofInName
protected void reportEofInName(char[] cbuf, int clen) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
reportMissingPISpace
protected void reportMissingPISpace(int ch) throws javax.xml.stream.XMLStreamException
Called when there's an unexpected char after PI target (non-ws, not part of'?>'
end marker- Throws:
javax.xml.stream.XMLStreamException
-
reportDoubleHyphenInComments
protected void reportDoubleHyphenInComments() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
reportMultipleColonsInName
protected void reportMultipleColonsInName() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
reportEntityOverflow
protected void reportEntityOverflow() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
reportInvalidNsIndex
protected void reportInvalidNsIndex(int index)
-
reportUnboundPrefix
protected void reportUnboundPrefix(PName name, boolean isAttr) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
reportDuplicateNsDecl
protected void reportDuplicateNsDecl(java.lang.String prefix) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
reportIllegalNsDecl
protected void reportIllegalNsDecl(java.lang.String prefix) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
reportIllegalNsDecl
protected void reportIllegalNsDecl(java.lang.String prefix, java.lang.String uri) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
reportUnexpectedEndTag
protected void reportUnexpectedEndTag(java.lang.String expName) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
reportIllegalCDataEnd
protected void reportIllegalCDataEnd() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
throwUnexpectedChar
protected void throwUnexpectedChar(int i, java.lang.String msg) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
throwNullChar
protected void throwNullChar() throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
handleInvalidXmlChar
protected char handleInvalidXmlChar(int i) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
throwInvalidSpace
protected void throwInvalidSpace(int i) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
-