com.bea.xml.stream

Class MXParser

Implemented Interfaces:
javax.xml.stream.Location, javax.xml.stream.XMLStreamReader

public class MXParser
extends java.lang.Object
implements javax.xml.stream.XMLStreamReader, javax.xml.stream.Location

XML Streaming Parser.
Author:
Aleksander Slominski

Field Summary

protected static char[]
ENCODING
protected static String
FEATURE_NAMES_INTERNED
static String
FEATURE_PROCESS_DOCDECL
static String
FEATURE_PROCESS_NAMESPACES
protected static String
FEATURE_XML_ROUNDTRIP
protected static int
LOOKUP_MAX
protected static char
LOOKUP_MAX_CHAR
protected static char[]
NO
static String
NO_NAMESPACE
protected static int
READ_CHUNK_SIZE
protected static char[]
STANDALONE
static String[]
TYPES
These constants are used for diagnostics messages, and need to match with ones from XMLStreamConstants.
protected static char[]
VERSION
protected static char[]
YES
protected boolean
allStringsInterned
Implementation notice: the is instance variable that controls if newString() is interning.
protected int
attributeCount
protected String[]
attributeName
protected int[]
attributeNameHash
protected String[]
attributePrefix
protected String[]
attributeUri
protected String[]
attributeValue
protected char[]
buf
protected int
bufAbsoluteStart
protected int
bufEnd
protected int
bufLoadFactor
protected int
bufSoftLimit
protected int
bufStart
protected String
charEncodingScheme
protected char[]
charRefOneCharBuf
protected int
columnNumber
protected HashMap
defaultAttributes
protected int
depth
protected String[]
elName
protected int[]
elNamespaceCount
protected String[]
elPrefix
protected char[][]
elRawName
protected int[]
elRawNameEnd
protected String[]
elUri
protected boolean
emptyElementTag
protected int
entityEnd
protected String[]
entityName
protected char[][]
entityNameBuf
protected int[]
entityNameHash
protected String
entityRefName
protected String[]
entityReplacement
protected char[][]
entityReplacementBuf
protected char[]
entityValue
Replacement value for the current entity, when automatic entity expansion is disabled.
protected int
eventType
protected String
inputEncoding
protected int
lineNumber
protected int
localNamespaceEnd
protected String[]
localNamespacePrefix
protected int[]
localNamespacePrefixHash
protected String[]
localNamespaceUri
protected static boolean[]
lookupNameChar
protected static boolean[]
lookupNameStartChar
protected int
namespaceEnd
protected String[]
namespacePrefix
protected int[]
namespacePrefixHash
protected String[]
namespaceUri
protected boolean
pastEndTag
protected char[]
pc
protected int
pcEnd
protected int
pcStart
protected String
piData
protected String
piTarget
protected int
pos
protected int
posEnd
protected int
posStart
protected boolean
processNamespaces
protected boolean
reachedEnd
protected Reader
reader
protected boolean
roundtripSupported
protected boolean
seenAmpersand
protected boolean
seenDocdecl
protected boolean
seenEndTag
protected boolean
seenMarkup
protected boolean
seenRoot
protected boolean
seenStartTag
protected boolean
standalone
protected boolean
standaloneSet
protected String
text
Lazily-constructed String that contains what getText() returns; cleared by tokenizer before parsing new events
protected boolean
tokenize
protected boolean
usePC
protected String
xmlVersion

Constructor Summary

MXParser()

Method Summary

protected void
addDefaultAttributes(String elementName)
boolean
checkForXMLDecl()
void
close()
void
defineEntityReplacementText(String entityName, String replacementText)
protected void
ensureAttributesCapacity(int size)
Make sure that in attributes temporary array is enough space.
protected void
ensureElementsCapacity()
Make sure that we have enough space to keep element stack if passed size.
protected void
ensureEntityCapacity()
protected void
ensureLocalNamespacesCapacity(int size)
protected void
ensureNamespacesCapacity(int size)
protected void
ensurePC(int end)
protected static 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 ...
protected void
fillBuf()
int
getAttributeCount()
String
getAttributeLocalName(int index)
QName
getAttributeName(int index)
String
getAttributeNamespace(int index)
String
getAttributePrefix(int index)
String
getAttributeType(int index)
String
getAttributeValue(String namespace, String name)
String
getAttributeValue(int index)
Iterator
getAttributes()
String
getCharacterEncodingScheme()
int
getCharacterOffset()
int
getColumnNumber()
ConfigurationContextBase
getConfigurationContext()
int
getDepth()
String
getElementText()
String
getEncoding()
int
getEventType()
boolean
getFeature(String name)
Unknown properties are always returned as false
String
getInputEncoding()
int
getLineNumber()
String
getLocalName()
int
getLocalNamespaceCount()
javax.xml.stream.Location
getLocation()
String
getLocationURI()
QName
getName()
javax.xml.namespace.NamespaceContext
getNamespaceContext()
int
getNamespaceCount()
int
getNamespaceCount(int depth)
String
getNamespacePrefix(int pos)
String
getNamespaceURI()
String
getNamespaceURI(String prefix)
String
getNamespaceURI(int pos)
Iterator
getNamespaces()
Iterator
getOutOfScopeNamespaces()
String
getPIData()
String
getPITarget()
String
getPositionDescription()
Return string describing current position of parsers as text 'STATE [seen %s...] @line:column'.
String
getPrefix()
Object
getProperty(String name)
String
getPublicId()
String
getSystemId()
String
getText()
char[]
getTextCharacters()
int
getTextCharacters(int sourceStart, char[] target, int targetStart, int length)
int
getTextLength()
int
getTextStart()
Reader
getTextStream()
String
getValue()
String
getVersion()
boolean
hasAttributes()
boolean
hasName()
boolean
hasNamespaces()
boolean
hasNext()
boolean
hasText()
Iterator
internalGetNamespaces(int depth, int namespaceCount)
boolean
isAttributeSpecified(int index)
boolean
isCharacters()
boolean
isEOF()
boolean
isEmptyElementTag()
boolean
isEndElement()
protected boolean
isNameChar(char ch)
protected boolean
isNameStartChar(char ch)
protected boolean
isS(char ch)
boolean
isStandalone()
boolean
isStartElement()
boolean
isWhiteSpace()
protected void
joinPC()
protected char[]
lookupEntityReplacement(int entitNameLen)
protected char
more()
boolean
moveToEndElement()
boolean
moveToEndElement(String localName)
boolean
moveToEndElement(String localName, String namespaceUri)
boolean
moveToStartElement()
boolean
moveToStartElement(String localName)
boolean
moveToStartElement(String localName, String namespaceUri)
protected String
newString(char[] cbuf, int off, int len)
protected String
newStringIntern(char[] cbuf, int off, int len)
int
next()
int
nextElement()
protected int
nextImpl()
int
nextTag()
String
nextText()
int
nextToken()
protected char
parseAttribute()
protected void
parseCDATA()
protected void
parseComment()
protected void
parseDocdecl()
int
parseEndTag()
protected char[]
parseEntityRef()
protected int
parseEpilog()
protected boolean
parsePI()
protected int
parseProlog()
int
parseStartTag()
protected void