CHAR_UTF8_BOM
protected static final char CHAR_UTF8_BOM
ENCODING
protected static final char[] ENCODING
FEATURE_NAMES_INTERNED
protected static final String FEATURE_NAMES_INTERNED
FEATURE_PROCESS_DOCDECL
public static final String FEATURE_PROCESS_DOCDECL
FEATURE_PROCESS_NAMESPACES
public static final String FEATURE_PROCESS_NAMESPACES
FEATURE_STAX_ENTITIES
public static final String FEATURE_STAX_ENTITIES
FEATURE_STAX_NOTATIONS
public static final String FEATURE_STAX_NOTATIONS
FEATURE_XML_ROUNDTRIP
protected static final String FEATURE_XML_ROUNDTRIP
LOOKUP_MAX
protected static final int LOOKUP_MAX
LOOKUP_MAX_CHAR
protected static final char LOOKUP_MAX_CHAR
MAX_UNICODE_CHAR
protected static final int MAX_UNICODE_CHAR
NO
protected static final char[] NO
NO_NAMESPACE
public static final String NO_NAMESPACE
This constant defines URI used for "no namespace" (when the default
namespace not defined, for elements; when attribute has no prefix,
or for all URIs if namespace support is disabled).
READ_CHUNK_SIZE
protected static final int READ_CHUNK_SIZE
STANDALONE
protected static final char[] STANDALONE
TYPES
public static final String[] TYPES
These constants are used for diagnostics messages, and need to
match with ones from XMLStreamConstants
.
VERSION
protected static final char[] VERSION
YES
protected static final char[] YES
allStringsInterned
protected boolean allStringsInterned
Implementation notice:
the is instance variable that controls if newString() is interning.
NOTE: newStringIntern
always returns interned strings
and newString MAY return interned String depending on this variable.
NOTE: by default in this minimal implementation it is false!
attributeCount
protected int attributeCount
attributeName
protected String[] attributeName
attributeNameHash
protected int[] attributeNameHash
attributePrefix
protected String[] attributePrefix
attributeUri
protected String[] attributeUri
attributeValue
protected String[] attributeValue
buf
protected char[] buf
Logics for this should be clarified... but it looks like we use a
8k buffer if there's 1M of free memory or more, otherwise just
256 bytes?
bufAbsoluteStart
protected int bufAbsoluteStart
bufEnd
protected int bufEnd
bufLoadFactor
protected int bufLoadFactor
bufSoftLimit
protected int bufSoftLimit
bufStart
protected int bufStart
charEncodingScheme
protected String charEncodingScheme
charRefOneCharBuf
protected char[] charRefOneCharBuf
This buffer is used for expanding single character (non-surrogate)
character entity expansions.
charRefTwoCharBuf
protected char[] charRefTwoCharBuf
This buffer is used in cases where an entity expands to a surrogate
pair. Since this is a rare occurence, it's lazily created if needed.
columnNumber
protected int columnNumber
defaultAttributes
protected HashMap defaultAttributes
elName
protected String[] elName
elNamespaceCount
protected int[] elNamespaceCount
elPrefix
protected String[] elPrefix
elRawName
protected char[][] elRawName
elRawNameEnd
protected int[] elRawNameEnd
elUri
protected String[] elUri
emptyElementTag
protected boolean emptyElementTag
entityEnd
protected int entityEnd
entityName
protected String[] entityName
entityNameBuf
protected char[][] entityNameBuf
entityNameHash
protected int[] entityNameHash
entityRefName
protected String entityRefName
entityReplacement
protected String[] entityReplacement
entityReplacementBuf
protected char[][] entityReplacementBuf
entityValue
protected char[] entityValue
Replacement value for the current entity, when automatic entity
expansion is disabled. Will always refer to some other array;
either globally shared ones (for general entities), or the temp
buffer for char entities. As such, does not need to be cleared
by tokenizer: will get properly overwritten as needed
eventType
protected int eventType
inputEncoding
protected String inputEncoding
lineNumber
protected int lineNumber
localNamespaceEnd
protected int localNamespaceEnd
localNamespacePrefix
protected String[] localNamespacePrefix
localNamespacePrefixHash
protected int[] localNamespacePrefixHash
localNamespaceUri
protected String[] localNamespaceUri
lookupNameChar
protected static boolean[] lookupNameChar
lookupNameStartChar
protected static boolean[] lookupNameStartChar
mDtdIntSubset
protected com.wutka.dtd.DTD mDtdIntSubset
If the internal DTD subset was parsed, this object will be non-null,
and can be used for accessing entities, elements and notations
declared in the internal subset.
namespaceEnd
protected int namespaceEnd
namespacePrefix
protected String[] namespacePrefix
namespacePrefixHash
protected int[] namespacePrefixHash
namespaceUri
protected String[] namespaceUri
pastEndTag
protected boolean pastEndTag
pcStart
protected int pcStart
piData
protected String piData
piTarget
protected String piTarget
posEnd
protected int posEnd
posStart
protected int posStart
processNamespaces
protected boolean processNamespaces
reachedEnd
protected boolean reachedEnd
reader
protected Reader reader
roundtripSupported
protected boolean roundtripSupported
seenAmpersand
protected boolean seenAmpersand
seenDocdecl
protected boolean seenDocdecl
seenEndTag
protected boolean seenEndTag
seenMarkup
protected boolean seenMarkup
seenRoot
protected boolean seenRoot
seenStartTag
protected boolean seenStartTag
standalone
protected boolean standalone
Flag that indicates whether 'standalone="yes"' was found from
the xml declaration.
standaloneSet
protected boolean standaloneSet
text
protected String text
Lazily-constructed String that contains what getText() returns;
cleared by tokenizer before parsing new events
tokenize
protected boolean tokenize
usePC
protected boolean usePC
xmlVersion
protected String xmlVersion
XML version found from the xml declaration, if any.
addDefaultAttributes
protected void addDefaultAttributes(String elementName)
throws javax.xml.stream.XMLStreamException
checkCharValidity
protected void checkCharValidity(int ch,
boolean surrogatesOk)
throws javax.xml.stream.XMLStreamException
checkForXMLDecl
public boolean checkForXMLDecl()
throws javax.xml.stream.XMLStreamException
close
public void close()
throws javax.xml.stream.XMLStreamException
- close in interface javax.xml.stream.XMLStreamReader
defineEntityReplacementText
public void defineEntityReplacementText(String entityName,
String replacementText)
throws javax.xml.stream.XMLStreamException
ensureAttributesCapacity
protected void ensureAttributesCapacity(int size)
Make sure that in attributes temporary array is enough space.
ensureElementsCapacity
protected void ensureElementsCapacity()
Make sure that we have enough space to keep element stack if passed size.
It will always create one additional slot then current depth
ensureEntityCapacity
protected void ensureEntityCapacity()
ensureLocalNamespacesCapacity
protected void ensureLocalNamespacesCapacity(int size)
ensureNamespacesCapacity
protected void ensureNamespacesCapacity(int size)
ensurePC
protected void ensurePC(int end)
fastHash
protected static final int fastHash(ch[] ,
int off,
int len)
simplistic implementation of hash function that has constant
time to compute - so it also means diminishing hash quality for long strings
but for XML parsing it should be good enough ...
fillBuf
protected void fillBuf()
throws javax.xml.stream.XMLStreamException,
EOFException
getAttributeCount
public int getAttributeCount()
- getAttributeCount in interface javax.xml.stream.XMLStreamReader
getAttributeLocalName
public String getAttributeLocalName(int index)
- getAttributeLocalName in interface javax.xml.stream.XMLStreamReader
getAttributeName
public javax.xml.namespace.QName getAttributeName(int index)
- getAttributeName in interface javax.xml.stream.XMLStreamReader
getAttributeNamespace
public String getAttributeNamespace(int index)
- getAttributeNamespace in interface javax.xml.stream.XMLStreamReader
getAttributePrefix
public String getAttributePrefix(int index)
- getAttributePrefix in interface javax.xml.stream.XMLStreamReader
getAttributeType
public String getAttributeType(int index)
- getAttributeType in interface javax.xml.stream.XMLStreamReader
getAttributeValue
public String getAttributeValue(String namespace,
String name)
- getAttributeValue in interface javax.xml.stream.XMLStreamReader
getAttributeValue
public String getAttributeValue(int index)
- getAttributeValue in interface javax.xml.stream.XMLStreamReader
getAttributes
public Iterator getAttributes()
getCharacterEncodingScheme
public String getCharacterEncodingScheme()
- getCharacterEncodingScheme in interface javax.xml.stream.XMLStreamReader
getCharacterOffset
public int getCharacterOffset()
- getCharacterOffset in interface javax.xml.stream.Location
getColumnNumber
public int getColumnNumber()
- getColumnNumber in interface javax.xml.stream.Location
getDepth
public int getDepth()
getElementText
public String getElementText()
throws javax.xml.stream.XMLStreamException
- getElementText in interface javax.xml.stream.XMLStreamReader
getEncoding
public String getEncoding()
- getEncoding in interface javax.xml.stream.XMLStreamReader
getEventType
public int getEventType()
- getEventType in interface javax.xml.stream.XMLStreamReader
getFeature
public boolean getFeature(String name)
Unknown properties are always returned as false
getInputEncoding
public String getInputEncoding()
getLineNumber
public int getLineNumber()
- getLineNumber in interface javax.xml.stream.Location
getLocalName
public String getLocalName()
- getLocalName in interface javax.xml.stream.XMLStreamReader
getLocalNamespaceCount
public int getLocalNamespaceCount()
getLocation
public javax.xml.stream.Location getLocation()
- getLocation in interface javax.xml.stream.XMLStreamReader
getLocationURI
public String getLocationURI()
getName
public javax.xml.namespace.QName getName()
- getName in interface javax.xml.stream.XMLStreamReader
getNamespaceContext
public javax.xml.namespace.NamespaceContext getNamespaceContext()
- getNamespaceContext in interface javax.xml.stream.XMLStreamReader
getNamespaceCount
public int getNamespaceCount()
- getNamespaceCount in interface javax.xml.stream.XMLStreamReader
getNamespaceCount
public int getNamespaceCount(int depth)
getNamespacePrefix
public String getNamespacePrefix(int pos)
- getNamespacePrefix in interface javax.xml.stream.XMLStreamReader
getNamespaceURI
public String getNamespaceURI()
- getNamespaceURI in interface javax.xml.stream.XMLStreamReader
getNamespaceURI
public String getNamespaceURI(String prefix)
- getNamespaceURI in interface javax.xml.stream.XMLStreamReader
getNamespaceURI
public String getNamespaceURI(int pos)
- getNamespaceURI in interface javax.xml.stream.XMLStreamReader
getNamespaces
public Iterator getNamespaces()
getOutOfScopeNamespaces
public Iterator getOutOfScopeNamespaces()
getPIData
public String getPIData()
- getPIData in interface javax.xml.stream.XMLStreamReader
getPITarget
public String getPITarget()
- getPITarget in interface javax.xml.stream.XMLStreamReader
getPositionDescription
public String getPositionDescription()
Return string describing current position of parsers as
text 'STATE [seen %s...] @line:column'.
getPrefix
public String getPrefix()
- getPrefix in interface javax.xml.stream.XMLStreamReader
getProperty
public Object getProperty(String name)
getPublicId
public String getPublicId()
- getPublicId in interface javax.xml.stream.Location
getSystemId
public String getSystemId()
- getSystemId in interface javax.xml.stream.Location
getText
public String getText()
- getText in interface javax.xml.stream.XMLStreamReader
getTextCharacters
public char[] getTextCharacters()
- getTextCharacters in interface javax.xml.stream.XMLStreamReader
getTextCharacters
public int getTextCharacters(int sourceStart,
char[] target,
int targetStart,
int length)
throws javax.xml.stream.XMLStreamException
- getTextCharacters in interface javax.xml.stream.XMLStreamReader
getTextLength
public int getTextLength()
- getTextLength in interface javax.xml.stream.XMLStreamReader
getTextStart
public int getTextStart()
- getTextStart in interface javax.xml.stream.XMLStreamReader
getTextStream
public Reader getTextStream()
getValue
public String getValue()
getVersion
public String getVersion()
- getVersion in interface javax.xml.stream.XMLStreamReader
hasAttributes
public boolean hasAttributes()
hasName
public boolean hasName()
- hasName in interface javax.xml.stream.XMLStreamReader
hasNamespaces
public boolean hasNamespaces()
hasNext
public boolean hasNext()
throws javax.xml.stream.XMLStreamException
- hasNext in interface javax.xml.stream.XMLStreamReader
hasText
public boolean hasText()
- hasText in interface javax.xml.stream.XMLStreamReader
internalGetNamespaces
public Iterator internalGetNamespaces(int depth,
int namespaceCount)
isAttributeSpecified
public boolean isAttributeSpecified(int index)
- isAttributeSpecified in interface javax.xml.stream.XMLStreamReader
isCharacters
public boolean isCharacters()
- isCharacters in interface javax.xml.stream.XMLStreamReader
isEOF
public boolean isEOF()
isEmptyElementTag
public boolean isEmptyElementTag()
throws javax.xml.stream.XMLStreamException
isEndElement
public boolean isEndElement()
- isEndElement in interface javax.xml.stream.XMLStreamReader
isNameChar
protected boolean isNameChar(char ch)
isNameStartChar
protected boolean isNameStartChar(char ch)
isS
protected boolean isS(char ch)
isStandalone
public boolean isStandalone()
- isStandalone in interface javax.xml.stream.XMLStreamReader
isStartElement
public boolean isStartElement()
- isStartElement in interface javax.xml.stream.XMLStreamReader
isWhiteSpace
public boolean isWhiteSpace()
- isWhiteSpace in interface javax.xml.stream.XMLStreamReader
joinPC
protected void joinPC()
lookupEntityReplacement
protected char[] lookupEntityReplacement(int entitNameLen)
throws javax.xml.stream.XMLStreamException
- Character array that contains (unparsed) entity expansion
value; or null if no such entity has been declared
more
protected char more()
throws javax.xml.stream.XMLStreamException,
EOFException
moveToEndElement
public boolean moveToEndElement()
throws javax.xml.stream.XMLStreamException
moveToEndElement
public boolean moveToEndElement(String localName)
throws javax.xml.stream.XMLStreamException
moveToEndElement
public boolean moveToEndElement(String localName,
String namespaceUri)
throws javax.xml.stream.XMLStreamException
moveToStartElement
public boolean moveToStartElement()
throws javax.xml.stream.XMLStreamException
moveToStartElement
public boolean moveToStartElement(String localName)
throws javax.xml.stream.XMLStreamException
moveToStartElement
public boolean moveToStartElement(String localName,
String namespaceUri)
throws javax.xml.stream.XMLStreamException
newString
protected String newString(char[] cbuf,
int off,
int len)
newStringIntern
protected String newStringIntern(char[] cbuf,
int off,
int len)
next
public int next()
throws javax.xml.stream.XMLStreamException
- next in interface javax.xml.stream.XMLStreamReader
nextElement
public int nextElement()
throws javax.xml.stream.XMLStreamException
nextImpl
protected int nextImpl()
throws javax.xml.stream.XMLStreamException
nextTag
public int nextTag()
throws javax.xml.stream.XMLStreamException
- nextTag in interface javax.xml.stream.XMLStreamReader
nextText
public String nextText()
throws javax.xml.stream.XMLStreamException
nextToken
public int nextToken()
throws javax.xml.stream.XMLStreamException
parseAttribute
protected char parseAttribute()
throws javax.xml.stream.XMLStreamException
parseCDATA
protected void parseCDATA()
throws javax.xml.stream.XMLStreamException
parseComment
protected void parseComment()
throws javax.xml.stream.XMLStreamException
parseDocdecl
protected void parseDocdecl()
throws javax.xml.stream.XMLStreamException
parseEndTag
public int parseEndTag()
throws javax.xml.stream.XMLStreamException
parseEntityRef
protected char[] parseEntityRef(boolean replace)
throws javax.xml.stream.XMLStreamException
- Character array that contains value the reference expands
to.
parseEpilog
protected int parseEpilog()
throws javax.xml.stream.XMLStreamException
parsePI
protected boolean parsePI()
throws javax.xml.stream.XMLStreamException
- True if this was the xml declaration; false if a regular
processing instruction
parseProlog
protected int parseProlog()
throws javax.xml.stream.XMLStreamException
parseStartTag
public int parseStartTag()
throws javax.xml.stream.XMLStreamException
parseXmlDecl
protected void parseXmlDecl(char ch)
throws javax.xml.stream.XMLStreamException
parseXmlDeclWithVersion
protected void parseXmlDeclWithVersion(int versionStart,
int versionEnd)
throws javax.xml.stream.XMLStreamException
printable
protected String printable(String s)
printable
protected String printable(char ch)
processDTD
protected void processDTD()
throws javax.xml.stream.XMLStreamException
recycle
public void recycle()
throws javax.xml.stream.XMLStreamException
require
public void require(int type,
String namespace,
String name)
throws javax.xml.stream.XMLStreamException
- require in interface javax.xml.stream.XMLStreamReader
requireInput
protected char requireInput(char ch,
char[] input)
throws javax.xml.stream.XMLStreamException
requireNextS
protected char requireNextS()
throws javax.xml.stream.XMLStreamException
resetStringCache
protected void resetStringCache()
setFeature
public void setFeature(String name,
boolean state)
throws javax.xml.stream.XMLStreamException
Method setFeature
name
- a Stringstate
- a boolean
javax.xml.stream.XMLStreamException
-
setInput
public void setInput(InputStream in)
throws javax.xml.stream.XMLStreamException
setInput
public void setInput(InputStream inputStream,
String inputEncoding)
throws javax.xml.stream.XMLStreamException
setInput
public void setInput(Reader in)
throws javax.xml.stream.XMLStreamException
setProperty
public void setProperty(String name,
Object value)
throws javax.xml.stream.XMLStreamException
skip
public void skip()
throws javax.xml.stream.XMLStreamException
skipS
protected char skipS(char ch)
throws javax.xml.stream.XMLStreamException
standaloneSet
public boolean standaloneSet()
- standaloneSet in interface javax.xml.stream.XMLStreamReader
subReader
public javax.xml.stream.XMLStreamReader subReader()
throws javax.xml.stream.XMLStreamException