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_attrCollectorprotected int_attrCountprotected boolean_cfgCoalescingprotected boolean_cfgLazyParsingprotected ReaderConfig_configprotected ElementScope_currElemInformation about the current element on the stackprotected int_currNsCountThis is a temporary state variable, valid during START_ELEMENT event.protected int_currRowThe row on which the character to read next is on.protected int_currTokenprotected NsBinding_defaultNsDefault namespace binding is a per-document singleton, like explicit bindings, and used for elements (never for attributes).protected int_depthNumber of START_ELEMENT events returned for which no END_ELEMENT has been returned; including current event.protected boolean_entityPendingFlag set to indicate that an entity is pendingprotected boolean_isEmptyTagFlag that is used if the current state isSTART_ELEMENTorEND_ELEMENT, to indicate if the underlying physical tag is a so-called empty tag (one ending with "/>")protected FixedNsContext_lastNsContextLast returnedNamespaceContext, created for a call togetNonTransientNamespaceContext(), iff this would still be a valid context.protected NsDeclaration_lastNsDeclPointer to the last namespace declaration encountered.protected char[]_nameBufferSimilarly, need a char buffer for actual String construction (in future, could perhaps use StringBuilder?).protected PName[]_nsBindingCacheAlthough unbound pname instances can be easily and safely reused, bound ones are per-document.protected int_nsBindingCountprotected NsBinding[]_nsBindingsArray containing all prefix bindings needed within the current document, so far (if any).protected int_nsBindMissesprotected long_pastBytesOrCharsNumber of bytes that were read and processed before the contents of the current buffer; used for calculating absolute offsets.protected java.lang.String_publicIdPublic id of the current event (DTD), if any.protected int_rowStartOffsetOffset used to calculate the column value given current input buffer pointer.protected long_startColumnCurrent column at start of current (last returned) tokenprotected long_startRawOffsetOffset (in chars or bytes) at start of current tokenprotected long_startRowCurrent row at start of current (last returned) tokenprotected java.lang.String_systemIdSystem id of the current event (DTD), if any.protected TextBuilder_textBuilderTextual content of the current eventprotected boolean_tokenIncompleteprotected PName_tokenNameCurrent name associated with the token, if any.protected boolean_xml11Whether validity checks (wrt.private static intBIND_CACHE_MASKprivate static intBIND_CACHE_SIZESize of the bind cache can be reasonably small, and should still get high enough hit rateprivate static intBIND_MISSES_TO_ACTIVATE_CACHELet'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.StringCDATA_STRString that identifies CDATA section (after "<![" prefix)protected static intINT_0protected static intINT_9protected static intINT_aprotected static intINT_Aprotected static intINT_AMPprotected static intINT_APOSprotected static intINT_COLONprotected static intINT_CRprotected static intINT_EQprotected static intINT_EXCLprotected static intINT_fprotected static intINT_Fprotected static intINT_GTprotected static intINT_HYPHENprotected static intINT_LBRACKETprotected static intINT_LFprotected static intINT_LTprotected static intINT_NULLprotected static intINT_QMARKprotected static intINT_QUOTEprotected static intINT_RBRACKETprotected static intINT_SLASHprotected static intINT_SPACEprotected static intINT_TABprotected static intINT_zprotected static intMAX_UNICODE_CHARThis constant defines the highest Unicode character allowed in XML content.static intTOKEN_EOIThis 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 protectedXmlScanner(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 PNamebindName(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 voidbindNs(PName name, java.lang.String uri)Method called when we are ready to bind a declared namespace.protected voidcheckImmutableBinding(java.lang.String prefix, java.lang.String uri)Method called when an immutable ns prefix (xml, xmlns) is encountered.voidclose(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)voiddecodeAttrValue(int index, org.codehaus.stax2.typed.TypedValueDecoder tvd)intdecodeAttrValues(int index, org.codehaus.stax2.typed.TypedArrayDecoder tad)Method called to decode the attribute value that consists of zero or more space-separated tokens.intdecodeElements(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.intfindAttrIndex(java.lang.String nsURI, java.lang.String localName)private NsDeclarationfindCurrNsDecl(int index)protected NsBindingfindOrCreateBinding(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 voidfinishCData()protected abstract voidfinishCharacters()protected abstract voidfinishComment()protected abstract voidfinishDTD(boolean copyContents)protected abstract voidfinishPI()protected abstract voidfinishSpace()protected abstract voidfinishToken()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)voidfireSaxCharacterEvents(org.xml.sax.ContentHandler h)voidfireSaxCommentEvent(org.xml.sax.ext.LexicalHandler h)voidfireSaxEndElement(org.xml.sax.ContentHandler h)voidfireSaxPIEvent(org.xml.sax.ContentHandler h)voidfireSaxSpaceEvents(org.xml.sax.ContentHandler h)voidfireSaxStartElement(org.xml.sax.ContentHandler h, org.xml.sax.Attributes attrs)AttributeCollectorgetAttrCollector()intgetAttrCount()java.lang.StringgetAttrLocalName(int index)java.lang.StringgetAttrNsURI(int index)java.lang.StringgetAttrPrefix(int index)java.lang.StringgetAttrPrefixedName(int index)javax.xml.namespace.QNamegetAttrQName(int index)java.lang.StringgetAttrType(int index)java.lang.StringgetAttrValue(int index)java.lang.StringgetAttrValue(java.lang.String nsURI, java.lang.String localName)ReaderConfiggetConfig()abstract intgetCurrentColumnNr()intgetCurrentLineNr()abstract org.codehaus.stax2.XMLStreamLocation2getCurrentLocation()intgetDepth()java.lang.StringgetDTDPublicId()java.lang.StringgetDTDSystemId()abstract longgetEndingByteOffset()abstract longgetEndingCharOffset()org.codehaus.stax2.XMLStreamLocation2getEndLocation()java.lang.StringgetInputPublicId()java.lang.StringgetInputSystemId()PNamegetName()java.lang.StringgetNamespacePrefix(int index)java.lang.StringgetNamespaceURI()java.lang.StringgetNamespaceURI(int index)java.lang.StringgetNamespaceURI(java.lang.String prefix)javax.xml.namespace.NamespaceContextgetNonTransientNamespaceContext()intgetNsCount()java.lang.StringgetPrefix(java.lang.String nsURI)java.util.Iterator<java.lang.String>getPrefixes(java.lang.String nsURI)javax.xml.namespace.QNamegetQName()abstract longgetStartingByteOffset()abstract longgetStartingCharOffset()org.codehaus.stax2.XMLStreamLocation2getStartLocation()java.lang.StringgetText()intgetText(java.io.Writer w, boolean preserveContents)char[]getTextCharacters()intgetTextCharacters(int srcStart, char[] target, int targetStart, int len)intgetTextLength()protected charhandleInvalidXmlChar(int i)booleanhasEmptyStack()booleanisAttrSpecified(int index)booleanisEmptyTag()booleanisTextWhitespace()protected abstract booleanloadMore()protected voidloadMoreGuaranteed()Method that tries to load at least one more byte into buffer; and if that fails, throws an appropriate EOI exception.protected voidloadMoreGuaranteed(int tt)abstract intnextFromProlog(boolean isProlog)abstract intnextFromTree()protected voidreportDoubleHyphenInComments()protected voidreportDuplicateNsDecl(java.lang.String prefix)protected voidreportEntityOverflow()protected voidreportEofInName(char[] cbuf, int clen)protected voidreportIllegalCDataEnd()protected voidreportIllegalNsDecl(java.lang.String prefix)protected voidreportIllegalNsDecl(java.lang.String prefix, java.lang.String uri)protected voidreportInputProblem(java.lang.String msg)protected voidreportInvalidNameChar(int ch, int index)protected voidreportInvalidNsIndex(int index)protected voidreportInvalidXmlChar(int ch)protected voidreportMissingPISpace(int ch)Called when there's an unexpected char after PI target (non-ws, not part of'?>'end markerprotected voidreportMultipleColonsInName()protected voidreportPrologProblem(boolean isProlog, java.lang.String msg)protected voidreportPrologUnexpChar(boolean isProlog, int ch, java.lang.String msg)protected voidreportPrologUnexpElement(boolean isProlog, int ch)protected voidreportTreeUnexpChar(int ch, java.lang.String msg)protected voidreportUnboundPrefix(PName name, boolean isAttr)protected voidreportUnexpandedEntityInAttr(PName name, boolean isNsDecl)Method called when a call to expand an entity within attribute value fails to expand it.protected voidreportUnexpectedEndTag(java.lang.String expName)voidresetForDecoding(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 voidskipCData()protected abstract booleanskipCharacters()protected abstract booleanskipCoalescedText()Secondary skip method called after primary text segment has been skipped, and we are in coalescing mode.protected abstract voidskipComment()protected abstract voidskipPI()protected abstract voidskipSpace()protected booleanskipToken()This method is called to essentially skip remaining of the current token (data of PI etc)protected voidthrowInvalidSpace(int i)protected voidthrowNullChar()protected voidthrowUnexpectedChar(int i, java.lang.String msg)protected voidverifyXmlChar(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_ELEMENTorEND_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.XMLStreamExceptionMethod 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.XMLStreamExceptionThis 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.XMLStreamExceptionThis 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.XMLStreamExceptionMethod 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.XMLStreamExceptionMethod 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.XMLStreamExceptionorg.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.XMLStreamExceptionorg.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.XMLStreamExceptionorg.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.XMLStreamExceptionorg.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.XMLStreamExceptionMethod 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:
getNamespaceURIin interfacejavax.xml.namespace.NamespaceContext
-
getPrefix
public java.lang.String getPrefix(java.lang.String nsURI)
- Specified by:
getPrefixin interfacejavax.xml.namespace.NamespaceContext
-
getPrefixes
public java.util.Iterator<java.lang.String> getPrefixes(java.lang.String nsURI)
- Specified by:
getPrefixesin 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.XMLStreamExceptionSecondary 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.XMLStreamExceptionMethod called when an immutable ns prefix (xml, xmlns) is encountered.- Throws:
javax.xml.stream.XMLStreamException
-
loadMoreGuaranteed
protected final void loadMoreGuaranteed() throws javax.xml.stream.XMLStreamExceptionMethod 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.XMLStreamExceptionCalled 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
-
-