public class X2PullParser extends java.lang.Object implements XmlPullParser, XmlPullParserEventPosition, XmlPullParserBufferControl, org.apache.xerces.xni.parser.XMLErrorHandler, org.apache.xerces.xni.XMLDocumentHandler
| Modifier and Type | Class and Description |
|---|---|
protected class |
X2PullParser.CumulativeReader |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allowedMixedContent |
protected X2Attribute[] |
attrPos
temporary array of current attributes
|
protected int |
attrPosEnd
index for last attribute in attrPos array
|
protected int |
attrPosSize
size of attrPos array
|
protected org.apache.xerces.xni.QName |
attrQName |
protected java.lang.StringBuffer |
contentBuf
Content of current element if in CONTENT state
|
protected int |
contentEventEnd |
protected int |
contentEventStart |
protected X2PullParser.CumulativeReader |
cumulativeReader |
protected boolean |
disableOffsetTracking |
protected X2ElementContent[] |
elStack
temprary array to keep ElementContent stack
|
protected int |
elStackDepth
how many elements are on elStack
|
protected int |
elStackSize
size of elStack array
|
protected boolean |
emptyElement
Have we read empty element?
|
protected int |
eventEnd
end position of current event in tokenizer biffer
|
protected int |
eventStart
start position of current event in tokenizer biffer
|
protected org.apache.xerces.xni.parser.XMLDocumentSource |
fDocumentSource
Document source
|
protected boolean |
gotContent |
protected org.apache.xerces.xni.parser.XMLInputSource |
inputSource |
protected org.apache.xerces.xni.XMLLocator |
locator |
protected boolean |
mixInElement |
protected static java.lang.String |
NAMESPACE_PREFIXES_FEATURE_ID |
protected static java.lang.String |
NAMESPACES_FEATURE_ID |
protected boolean |
needToSetInput |
protected byte |
nextState |
protected boolean |
nonWhitespaceContent |
java.lang.String |
POS_ABSOLUTE_END |
java.lang.String |
POS_ABSOLUTE_START |
protected java.util.Hashtable |
prefix2Ns
mapping of names prefixes to uris
|
protected org.apache.xerces.xni.parser.XMLPullParserConfiguration |
pullParserConfiguration |
protected boolean |
reportNsAttribs
should parser report namespace xmlns* attributes ?
|
protected boolean |
seenContent |
protected boolean |
seenCR |
protected java.lang.Exception |
seenException |
protected boolean |
seenRootElement
Have we seen root element
|
protected boolean |
shrinkable |
protected boolean |
startTagInitialized |
protected byte |
state
what is current event type as returned from next()?
|
protected boolean |
supportNs
should parser support namespaces?
|
CONTENT, END_DOCUMENT, END_TAG, START_TAG| Constructor and Description |
|---|
X2PullParser()
Create instance of pull parser.
|
| Modifier and Type | Method and Description |
|---|---|
void |
characters(org.apache.xerces.xni.XMLString text,
org.apache.xerces.xni.Augmentations augs) |
void |
comment(org.apache.xerces.xni.XMLString text,
org.apache.xerces.xni.Augmentations augs) |
void |
doctypeDecl(java.lang.String rootElement,
java.lang.String publicId,
java.lang.String systemId,
org.apache.xerces.xni.Augmentations augs) |
void |
emptyElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.XMLAttributes attributes,
org.apache.xerces.xni.Augmentations augs) |
void |
endCDATA(org.apache.xerces.xni.Augmentations augs) |
void |
endDocument(org.apache.xerces.xni.Augmentations augs) |
void |
endElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.Augmentations augs) |
void |
endEntity(java.lang.String name,
org.apache.xerces.xni.Augmentations augs) |
void |
endGeneralEntity(java.lang.String name,
org.apache.xerces.xni.Augmentations augs) |
void |
endPrefixMapping(java.lang.String prefix,
org.apache.xerces.xni.Augmentations augs) |
protected void |
ensureAttribs(int size)
Make sure that in attributes temporary array is enough space.
|
protected void |
ensureCapacity(int size)
Make sure that we have enough space to keep element stack if passed size.
|
void |
error(java.lang.String domain,
java.lang.String key,
org.apache.xerces.xni.parser.XMLParseException ex)
Error.
|
void |
fatalError(java.lang.String domain,
java.lang.String key,
org.apache.xerces.xni.parser.XMLParseException ex)
Fatal error.
|
int |
getBufferShrinkOffset() |
int |
getColumnNumber() |
int |
getContentLength()
Return how big is content.
|
int |
getDepth()
Returns the current depth of the element.
|
org.apache.xerces.xni.parser.XMLDocumentSource |
getDocumentSource()
Returns the document source
|
char[] |
getEventBuffer()
NOTE: This may be internal buffer and is valud
only until call to method next()- do NOT attempt modify !
|
int |
getEventEnd() |
int |
getEventStart() |
byte |
getEventType()
Returns the type of the current element (START_TAG, END_TAG, CONTENT, etc)
|
int |
getHardLimit() |
int |
getLineNumber() |
java.lang.String |
getLocalName()
Returns the local name of the current element
(current event must be START_TAG or END_TAG)
|
int |
getNamespacesLength(int depth) |
java.lang.String |
getNamespaceUri()
Returns the namespace URI of the current element
Returns null if not applicable
(current event must be START_TAG or END_TAG)
|
java.lang.String |
getPosDesc()
Return string describing current position of parser in input stream as
text 'at line %d (row) and column %d (colum) [seen %s...]'.
|
java.lang.String |
getPrefix()
Returns the prefix of the current element
or null if elemet has no prefix.
|
java.lang.String |
getQNameLocal(java.lang.String qName)
Return local part of qname.
|
java.lang.String |
getQNameUri(java.lang.String qName)
Return uri part of qname.
|
java.lang.String |
getRawName()
Returns the raw name (prefix + ':' + localName) of the current element
(current event must be START_TAG or END_TAG)
|
int |
getSoftLimit() |
void |
ignorableWhitespace(org.apache.xerces.xni.XMLString text,
org.apache.xerces.xni.Augmentations augs) |
boolean |
isAllowedMixedContent()
Is mixed element context allowed?
|
boolean |
isBufferShrinkable() |
boolean |
isNamespaceAttributesReporting()
Is parser going to report namespace attributes (xmlns*) ?
|
boolean |
isNamespaceAware()
Is parser namespace aware?
|
boolean |
isWhitespaceContent()
Return true if just read CONTENT contained only white spaces.
|
byte |
next()
This is a key method - translates XNI callbacks
into XPP events
(such as START_TAG, END_TAG, CONTENT).
|
void |
processingInstruction(java.lang.String target,
org.apache.xerces.xni.XMLString data,
org.apache.xerces.xni.Augmentations augs) |
java.lang.String |
readContent()
Return String that contains just read CONTENT.
|
void |
readEndTag(XmlEndTag etag)
Read value of just read END_TAG into passed as argument EndTag.
|
void |
readNamespacesPrefixes(int depth,
java.lang.String[] prefixes,
int off,
int len)
Return namespace prefixes for element at depth
|
void |
readNamespacesUris(int depth,
java.lang.String[] uris,
int off,
int len)
Return namespace URIs for element at depth
|
byte |
readNode(XmlNode node)
Read subtree into node: call readNodeWithoutChildren
and then parse subtree adding children
(values obtained with readXontent or readNodeWithoutChildren).
|
void |
readNodeWithoutChildren(XmlNode node)
Read node: it calls readStartTag and then if parser is namespaces
aware currently declared nemaspeces will be added
and defaultNamespace will be set.
|
void |
readStartTag(XmlStartTag stag)
Read value of just read START_TAG into passed as argument StartTag.
|
void |
reset()
Reset parser state so it can be used to parse new
|
protected void |
resetState() |
void |
setAllowedMixedContent(boolean enable)
Allow for mixed element content.
|
void |
setBufferShrinkable(boolean shrinkable) |
void |
setDocumentSource(org.apache.xerces.xni.parser.XMLDocumentSource source)
Sets the document source
|
void |
setHardLimit(int value) |
void |
setInput(char[] buf)
Reset parser and set new input.
|
void |
setInput(char[] buf,
int off,
int len)
Set the input for parser.
|
void |
setInput(java.io.Reader reader)
Reset parser and set new input.
|
void |
setNamespaceAttributesReporting(boolean enable)
Make parser to report xmlns* attributes.
|
void |
setNamespaceAware(boolean awareness)
Set support of namespaces.
|
void |
setSoftLimit(int value) |
byte |
skipNode()
If parser has just read start tag it allows to skip whoole
subtree contined in this element.
|
void |
startCDATA(org.apache.xerces.xni.Augmentations augs) |
void |
startDocument(org.apache.xerces.xni.XMLLocator locator,
java.lang.String encoding,
org.apache.xerces.xni.Augmentations augs) |
void |
startDocument(org.apache.xerces.xni.XMLLocator locator,
java.lang.String encoding,
org.apache.xerces.xni.NamespaceContext namespaceContext,
org.apache.xerces.xni.Augmentations augs) |
void |
startElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.XMLAttributes attributes,
org.apache.xerces.xni.Augmentations augs) |
void |
startEntity(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId,
java.lang.String baseSystemId,
java.lang.String encoding,
org.apache.xerces.xni.Augmentations augs) |
void |
startGeneralEntity(java.lang.String name,
org.apache.xerces.xni.XMLResourceIdentifier identifier,
java.lang.String encoding,
org.apache.xerces.xni.Augmentations augs) |
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri,
org.apache.xerces.xni.Augmentations augs) |
void |
textDecl(java.lang.String version,
java.lang.String encoding,
org.apache.xerces.xni.Augmentations augs) |
void |
warning(java.lang.String domain,
java.lang.String key,
org.apache.xerces.xni.parser.XMLParseException ex)
Warning.
|
void |
xmlDecl(java.lang.String version,
java.lang.String encoding,
java.lang.String standalone,
org.apache.xerces.xni.Augmentations augs) |
protected static final java.lang.String NAMESPACES_FEATURE_ID
protected static final java.lang.String NAMESPACE_PREFIXES_FEATURE_ID
protected org.apache.xerces.xni.parser.XMLPullParserConfiguration pullParserConfiguration
protected org.apache.xerces.xni.XMLLocator locator
protected org.apache.xerces.xni.QName attrQName
protected boolean needToSetInput
protected X2PullParser.CumulativeReader cumulativeReader
protected org.apache.xerces.xni.parser.XMLInputSource inputSource
protected boolean shrinkable
protected boolean emptyElement
protected boolean supportNs
protected boolean reportNsAttribs
protected boolean allowedMixedContent
protected java.lang.Exception seenException
protected boolean disableOffsetTracking
protected int contentEventStart
protected int contentEventEnd
protected int eventStart
protected int eventEnd
protected boolean seenRootElement
protected java.lang.StringBuffer contentBuf
protected byte state
protected java.util.Hashtable prefix2Ns
protected int attrPosEnd
protected int attrPosSize
protected X2Attribute[] attrPos
protected int elStackDepth
protected int elStackSize
protected X2ElementContent[] elStack
protected boolean startTagInitialized
protected boolean seenContent
protected boolean gotContent
protected boolean nonWhitespaceContent
protected boolean seenCR
protected boolean mixInElement
protected byte nextState
protected org.apache.xerces.xni.parser.XMLDocumentSource fDocumentSource
public final java.lang.String POS_ABSOLUTE_START
public final java.lang.String POS_ABSOLUTE_END
public X2PullParser()
throws XmlPullParserException
XmlPullParserExceptionpublic void warning(java.lang.String domain,
java.lang.String key,
org.apache.xerces.xni.parser.XMLParseException ex)
throws org.apache.xerces.xni.XNIException
warning in interface org.apache.xerces.xni.parser.XMLErrorHandlerorg.apache.xerces.xni.XNIExceptionpublic void error(java.lang.String domain,
java.lang.String key,
org.apache.xerces.xni.parser.XMLParseException ex)
throws org.apache.xerces.xni.XNIException
error in interface org.apache.xerces.xni.parser.XMLErrorHandlerorg.apache.xerces.xni.XNIExceptionpublic void fatalError(java.lang.String domain,
java.lang.String key,
org.apache.xerces.xni.parser.XMLParseException ex)
throws org.apache.xerces.xni.XNIException
fatalError in interface org.apache.xerces.xni.parser.XMLErrorHandlerorg.apache.xerces.xni.XNIExceptionpublic void setDocumentSource(org.apache.xerces.xni.parser.XMLDocumentSource source)
setDocumentSource in interface org.apache.xerces.xni.XMLDocumentHandlerpublic org.apache.xerces.xni.parser.XMLDocumentSource getDocumentSource()
getDocumentSource in interface org.apache.xerces.xni.XMLDocumentHandlerpublic void startDocument(org.apache.xerces.xni.XMLLocator locator,
java.lang.String encoding,
org.apache.xerces.xni.NamespaceContext namespaceContext,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
startDocument in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void startDocument(org.apache.xerces.xni.XMLLocator locator,
java.lang.String encoding,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
org.apache.xerces.xni.XNIExceptionpublic void xmlDecl(java.lang.String version,
java.lang.String encoding,
java.lang.String standalone,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
xmlDecl in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void doctypeDecl(java.lang.String rootElement,
java.lang.String publicId,
java.lang.String systemId,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
doctypeDecl in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void comment(org.apache.xerces.xni.XMLString text,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
comment in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void processingInstruction(java.lang.String target,
org.apache.xerces.xni.XMLString data,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
processingInstruction in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void startGeneralEntity(java.lang.String name,
org.apache.xerces.xni.XMLResourceIdentifier identifier,
java.lang.String encoding,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
startGeneralEntity in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void endGeneralEntity(java.lang.String name,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
endGeneralEntity in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void startPrefixMapping(java.lang.String prefix,
java.lang.String uri,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
org.apache.xerces.xni.XNIExceptionpublic void startElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.XMLAttributes attributes,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
startElement in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void emptyElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.XMLAttributes attributes,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
emptyElement in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void startEntity(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId,
java.lang.String baseSystemId,
java.lang.String encoding,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
org.apache.xerces.xni.XNIExceptionpublic void textDecl(java.lang.String version,
java.lang.String encoding,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
textDecl in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void endEntity(java.lang.String name,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
org.apache.xerces.xni.XNIExceptionpublic void characters(org.apache.xerces.xni.XMLString text,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
characters in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void ignorableWhitespace(org.apache.xerces.xni.XMLString text,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
ignorableWhitespace in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void endElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
endElement in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void endPrefixMapping(java.lang.String prefix,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
org.apache.xerces.xni.XNIExceptionpublic void startCDATA(org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
startCDATA in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void endCDATA(org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
endCDATA in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic void endDocument(org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
endDocument in interface org.apache.xerces.xni.XMLDocumentHandlerorg.apache.xerces.xni.XNIExceptionpublic byte next()
throws XmlPullParserException,
java.io.IOException
next in interface XmlPullParserXmlPullParserExceptionjava.io.IOExceptionpublic void setInput(java.io.Reader reader)
throws XmlPullParserException
setInput in interface XmlPullParserXmlPullParserExceptionpublic void setInput(char[] buf)
throws XmlPullParserException
setInput in interface XmlPullParserXmlPullParserExceptionpublic void setInput(char[] buf,
int off,
int len)
throws XmlPullParserException
XmlPullParsersetInput in interface XmlPullParserXmlPullParserExceptionpublic void reset()
reset in interface XmlPullParserpublic boolean isAllowedMixedContent()
XmlPullParserisAllowedMixedContent in interface XmlPullParserpublic void setAllowedMixedContent(boolean enable)
throws XmlPullParserException
setAllowedMixedContent in interface XmlPullParserXmlPullParserExceptionpublic boolean isNamespaceAware()
XmlPullParserisNamespaceAware in interface XmlPullParserpublic void setNamespaceAware(boolean awareness)
throws XmlPullParserException
setNamespaceAware in interface XmlPullParserXmlPullParserExceptionpublic boolean isNamespaceAttributesReporting()
XmlPullParserisNamespaceAttributesReporting in interface XmlPullParserpublic void setNamespaceAttributesReporting(boolean enable)
throws XmlPullParserException
setNamespaceAttributesReporting in interface XmlPullParserXmlPullParserExceptionpublic java.lang.String getNamespaceUri()
XmlPullParsergetNamespaceUri in interface XmlPullParserpublic java.lang.String getLocalName()
XmlPullParsergetLocalName in interface XmlPullParserpublic java.lang.String getPrefix()
XmlPullParsergetPrefix in interface XmlPullParserpublic java.lang.String getRawName()
XmlPullParsergetRawName in interface XmlPullParserpublic java.lang.String getQNameLocal(java.lang.String qName)
XmlPullParsergetQNameLocal in interface XmlPullParserpublic java.lang.String getQNameUri(java.lang.String qName)
throws XmlPullParserException
XmlPullParsergetQNameUri in interface XmlPullParserXmlPullParserExceptionpublic int getDepth()
XmlPullParsergetDepth in interface XmlPullParserpublic int getNamespacesLength(int depth)
getNamespacesLength in interface XmlPullParserpublic void readNamespacesPrefixes(int depth,
java.lang.String[] prefixes,
int off,
int len)
throws XmlPullParserException
readNamespacesPrefixes in interface XmlPullParserXmlPullParserExceptionpublic void readNamespacesUris(int depth,
java.lang.String[] uris,
int off,
int len)
throws XmlPullParserException
readNamespacesUris in interface XmlPullParserXmlPullParserExceptionpublic java.lang.String getPosDesc()
getPosDesc in interface XmlPullParserpublic int getLineNumber()
getLineNumber in interface XmlPullParserpublic int getColumnNumber()
getColumnNumber in interface XmlPullParserpublic byte getEventType()
XmlPullParsergetEventType in interface XmlPullParserpublic boolean isWhitespaceContent()
throws XmlPullParserException
isWhitespaceContent in interface XmlPullParserXmlPullParserExceptionpublic int getContentLength()
throws XmlPullParserException
XmlPullParserNOTE: parser must be on CONTENT event.
getContentLength in interface XmlPullParserXmlPullParserExceptionpublic java.lang.String readContent()
throws XmlPullParserException
readContent in interface XmlPullParserXmlPullParserExceptionpublic void readEndTag(XmlEndTag etag) throws XmlPullParserException
readEndTag in interface XmlPullParserXmlPullParserExceptionpublic void readStartTag(XmlStartTag stag) throws XmlPullParserException
readStartTag in interface XmlPullParserXmlPullParserExceptionpublic void readNodeWithoutChildren(XmlNode node) throws XmlPullParserException
XmlPullParserNOTE: parser must be on START_TAG event. and all events will written into node!
readNodeWithoutChildren in interface XmlPullParserXmlPullParserExceptionpublic byte readNode(XmlNode node) throws XmlPullParserException, java.io.IOException
XmlPullParserNOTE: parser must be on START_TAG event. and all events will written into node!
readNode in interface XmlPullParserXmlPullParserExceptionjava.io.IOExceptionpublic byte skipNode()
throws XmlPullParserException,
java.io.IOException
skipNode in interface XmlPullParserXmlPullParserExceptionjava.io.IOExceptionpublic int getHardLimit()
getHardLimit in interface XmlPullParserBufferControlpublic void setHardLimit(int value)
throws XmlPullParserException
setHardLimit in interface XmlPullParserBufferControlXmlPullParserExceptionpublic int getSoftLimit()
getSoftLimit in interface XmlPullParserBufferControlpublic void setSoftLimit(int value)
throws XmlPullParserException
setSoftLimit in interface XmlPullParserBufferControlXmlPullParserExceptionpublic int getBufferShrinkOffset()
getBufferShrinkOffset in interface XmlPullParserBufferControlpublic void setBufferShrinkable(boolean shrinkable)
throws XmlPullParserException
setBufferShrinkable in interface XmlPullParserBufferControlXmlPullParserExceptionpublic boolean isBufferShrinkable()
isBufferShrinkable in interface XmlPullParserBufferControlpublic int getEventStart()
getEventStart in interface XmlPullParserEventPositionpublic int getEventEnd()
getEventEnd in interface XmlPullParserEventPositionpublic char[] getEventBuffer()
XmlPullParserEventPositionNOTE: This may be internal buffer and is valud only until call to method next()- do NOT attempt modify !
getEventBuffer in interface XmlPullParserEventPositionprotected void ensureCapacity(int size)
protected void ensureAttribs(int size)
protected void resetState()
Copyright (c) 2003 IU Extreme! Lab http://www.extreme.indiana.edu/ All Rights Reserved.
Note this package is deprecated by XPP3 that implements XmlPull API