Package org.gjt.xpp.x2impl.x2pullparser
Class X2PullParser
- java.lang.Object
-
- org.gjt.xpp.x2impl.x2pullparser.X2PullParser
-
- All Implemented Interfaces:
org.apache.xerces.xni.parser.XMLErrorHandler,org.apache.xerces.xni.XMLDocumentHandler,XmlPullParser,XmlPullParserBufferControl,XmlPullParserEventPosition
public class X2PullParser extends java.lang.Object implements XmlPullParser, XmlPullParserEventPosition, XmlPullParserBufferControl, org.apache.xerces.xni.parser.XMLErrorHandler, org.apache.xerces.xni.XMLDocumentHandler
This is Xerces 2 driver that uses XNI pull parsing capabilities to implement XML Pull Parser API. Advantages:- uses Xerces 2 and bases in stable and standard compliant parser
- uses Xerces 2 XNI in pull parser mode but hides complexity of working with XNI with simple PullParser API
- this is alpha version - may have still bugs :-)
- Author:
- Aleksander Slominski
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classX2PullParser.CumulativeReader
-
Field Summary
Fields Modifier and Type Field Description protected booleanallowedMixedContentprotected X2Attribute[]attrPostemporary array of current attributesprotected intattrPosEndindex for last attribute in attrPos arrayprotected intattrPosSizesize of attrPos arrayprotected org.apache.xerces.xni.QNameattrQNameprotected java.lang.StringBuffercontentBufContent of current element if in CONTENT stateprotected intcontentEventEndprotected intcontentEventStartprotected X2PullParser.CumulativeReadercumulativeReaderprotected booleandisableOffsetTrackingprotected X2ElementContent[]elStacktemprary array to keep ElementContent stackprotected intelStackDepthhow many elements are on elStackprotected intelStackSizesize of elStack arrayprotected booleanemptyElementHave we read empty element?protected inteventEndend position of current event in tokenizer bifferprotected inteventStartstart position of current event in tokenizer bifferprotected org.apache.xerces.xni.parser.XMLDocumentSourcefDocumentSourceDocument sourceprotected booleangotContentprotected org.apache.xerces.xni.parser.XMLInputSourceinputSourceprotected org.apache.xerces.xni.XMLLocatorlocatorprotected booleanmixInElementprotected static java.lang.StringNAMESPACE_PREFIXES_FEATURE_IDprotected static java.lang.StringNAMESPACES_FEATURE_IDprotected booleanneedToSetInputprotected bytenextStateprotected booleannonWhitespaceContentjava.lang.StringPOS_ABSOLUTE_ENDjava.lang.StringPOS_ABSOLUTE_STARTprotected java.util.Hashtableprefix2Nsmapping of names prefixes to urisprotected org.apache.xerces.xni.parser.XMLPullParserConfigurationpullParserConfigurationprotected booleanreportNsAttribsshould parser report namespace xmlns* attributes ?protected booleanseenContentprotected booleanseenCRprotected java.lang.ExceptionseenExceptionprotected booleanseenRootElementHave we seen root elementprotected booleanshrinkableprotected booleanstartTagInitializedprotected bytestatewhat is current event type as returned from next()?protected booleansupportNsshould parser support namespaces?-
Fields inherited from interface org.gjt.xpp.XmlPullParser
CONTENT, END_DOCUMENT, END_TAG, START_TAG
-
-
Constructor Summary
Constructors Constructor Description X2PullParser()Create instance of pull parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs)voidcomment(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs)voiddoctypeDecl(java.lang.String rootElement, java.lang.String publicId, java.lang.String systemId, org.apache.xerces.xni.Augmentations augs)voidemptyElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs)voidendCDATA(org.apache.xerces.xni.Augmentations augs)voidendDocument(org.apache.xerces.xni.Augmentations augs)voidendElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.Augmentations augs)voidendEntity(java.lang.String name, org.apache.xerces.xni.Augmentations augs)voidendGeneralEntity(java.lang.String name, org.apache.xerces.xni.Augmentations augs)voidendPrefixMapping(java.lang.String prefix, org.apache.xerces.xni.Augmentations augs)protected voidensureAttribs(int size)Make sure that in attributes temporary array is enough space.protected voidensureCapacity(int size)Make sure that we have enough space to keep element stack if passed size.voiderror(java.lang.String domain, java.lang.String key, org.apache.xerces.xni.parser.XMLParseException ex)Error.voidfatalError(java.lang.String domain, java.lang.String key, org.apache.xerces.xni.parser.XMLParseException ex)Fatal error.intgetBufferShrinkOffset()intgetColumnNumber()intgetContentLength()Return how big is content.intgetDepth()Returns the current depth of the element.org.apache.xerces.xni.parser.XMLDocumentSourcegetDocumentSource()Returns the document sourcechar[]getEventBuffer()NOTE: This may be internal buffer and is valud only until call to method next()- do NOT attempt modify !intgetEventEnd()intgetEventStart()bytegetEventType()Returns the type of the current element (START_TAG, END_TAG, CONTENT, etc)intgetHardLimit()intgetLineNumber()java.lang.StringgetLocalName()Returns the local name of the current element (current event must be START_TAG or END_TAG)intgetNamespacesLength(int depth)java.lang.StringgetNamespaceUri()Returns the namespace URI of the current element Returns null if not applicable (current event must be START_TAG or END_TAG)java.lang.StringgetPosDesc()Return string describing current position of parser in input stream as text 'at line %d (row) and column %d (colum) [seen %s...]'.java.lang.StringgetPrefix()Returns the prefix of the current element or null if elemet has no prefix.java.lang.StringgetQNameLocal(java.lang.String qName)Return local part of qname.java.lang.StringgetQNameUri(java.lang.String qName)Return uri part of qname.java.lang.StringgetRawName()Returns the raw name (prefix + ':' + localName) of the current element (current event must be START_TAG or END_TAG)intgetSoftLimit()voidignorableWhitespace(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs)booleanisAllowedMixedContent()Is mixed element context allowed?booleanisBufferShrinkable()booleanisNamespaceAttributesReporting()Is parser going to report namespace attributes (xmlns*) ?booleanisNamespaceAware()Is parser namespace aware?booleanisWhitespaceContent()Return true if just read CONTENT contained only white spaces.bytenext()This is a key method - translates XNI callbacks into XPP events (such as START_TAG, END_TAG, CONTENT).voidprocessingInstruction(java.lang.String target, org.apache.xerces.xni.XMLString data, org.apache.xerces.xni.Augmentations augs)java.lang.StringreadContent()Return String that contains just read CONTENT.voidreadEndTag(XmlEndTag etag)Read value of just read END_TAG into passed as argument EndTag.voidreadNamespacesPrefixes(int depth, java.lang.String[] prefixes, int off, int len)Return namespace prefixes for element at depthvoidreadNamespacesUris(int depth, java.lang.String[] uris, int off, int len)Return namespace URIs for element at depthbytereadNode(XmlNode node)Read subtree into node: call readNodeWithoutChildren and then parse subtree adding children (values obtained with readXontent or readNodeWithoutChildren).voidreadNodeWithoutChildren(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.voidreadStartTag(XmlStartTag stag)Read value of just read START_TAG into passed as argument StartTag.voidreset()Reset parser state so it can be used to parse newprotected voidresetState()voidsetAllowedMixedContent(boolean enable)Allow for mixed element content.voidsetBufferShrinkable(boolean shrinkable)voidsetDocumentSource(org.apache.xerces.xni.parser.XMLDocumentSource source)Sets the document sourcevoidsetHardLimit(int value)voidsetInput(char[] buf)Reset parser and set new input.voidsetInput(char[] buf, int off, int len)Set the input for parser.voidsetInput(java.io.Reader reader)Reset parser and set new input.voidsetNamespaceAttributesReporting(boolean enable)Make parser to report xmlns* attributes.voidsetNamespaceAware(boolean awareness)Set support of namespaces.voidsetSoftLimit(int value)byteskipNode()If parser has just read start tag it allows to skip whoole subtree contined in this element.voidstartCDATA(org.apache.xerces.xni.Augmentations augs)voidstartDocument(org.apache.xerces.xni.XMLLocator locator, java.lang.String encoding, org.apache.xerces.xni.Augmentations augs)voidstartDocument(org.apache.xerces.xni.XMLLocator locator, java.lang.String encoding, org.apache.xerces.xni.NamespaceContext namespaceContext, org.apache.xerces.xni.Augmentations augs)voidstartElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs)voidstartEntity(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)voidstartGeneralEntity(java.lang.String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, java.lang.String encoding, org.apache.xerces.xni.Augmentations augs)voidstartPrefixMapping(java.lang.String prefix, java.lang.String uri, org.apache.xerces.xni.Augmentations augs)voidtextDecl(java.lang.String version, java.lang.String encoding, org.apache.xerces.xni.Augmentations augs)voidwarning(java.lang.String domain, java.lang.String key, org.apache.xerces.xni.parser.XMLParseException ex)Warning.voidxmlDecl(java.lang.String version, java.lang.String encoding, java.lang.String standalone, org.apache.xerces.xni.Augmentations augs)
-
-
-
Field Detail
-
NAMESPACES_FEATURE_ID
protected static final java.lang.String NAMESPACES_FEATURE_ID
- See Also:
- Constant Field Values
-
NAMESPACE_PREFIXES_FEATURE_ID
protected static final java.lang.String NAMESPACE_PREFIXES_FEATURE_ID
- See Also:
- Constant Field Values
-
pullParserConfiguration
protected org.apache.xerces.xni.parser.XMLPullParserConfiguration pullParserConfiguration
-
locator
protected org.apache.xerces.xni.XMLLocator locator
-
attrQName
protected org.apache.xerces.xni.QName attrQName
-
needToSetInput
protected boolean needToSetInput
-
cumulativeReader
protected X2PullParser.CumulativeReader cumulativeReader
-
inputSource
protected org.apache.xerces.xni.parser.XMLInputSource inputSource
-
shrinkable
protected boolean shrinkable
-
emptyElement
protected boolean emptyElement
Have we read empty element?
-
supportNs
protected boolean supportNs
should parser support namespaces?
-
reportNsAttribs
protected boolean reportNsAttribs
should parser report namespace xmlns* attributes ?
-
allowedMixedContent
protected boolean allowedMixedContent
-
seenException
protected java.lang.Exception seenException
-
disableOffsetTracking
protected boolean disableOffsetTracking
-
contentEventStart
protected int contentEventStart
-
contentEventEnd
protected int contentEventEnd
-
eventStart
protected int eventStart
start position of current event in tokenizer biffer
-
eventEnd
protected int eventEnd
end position of current event in tokenizer biffer
-
seenRootElement
protected boolean seenRootElement
Have we seen root element
-
contentBuf
protected java.lang.StringBuffer contentBuf
Content of current element if in CONTENT state
-
state
protected byte state
what is current event type as returned from next()?
-
prefix2Ns
protected java.util.Hashtable prefix2Ns
mapping of names prefixes to uris
-
attrPosEnd
protected int attrPosEnd
index for last attribute in attrPos array
-
attrPosSize
protected int attrPosSize
size of attrPos array
-
attrPos
protected X2Attribute[] attrPos
temporary array of current attributes
-
elStackDepth
protected int elStackDepth
how many elements are on elStack
-
elStackSize
protected int elStackSize
size of elStack array
-
elStack
protected X2ElementContent[] elStack
temprary array to keep ElementContent stack
-
startTagInitialized
protected boolean startTagInitialized
-
seenContent
protected boolean seenContent
-
gotContent
protected boolean gotContent
-
nonWhitespaceContent
protected boolean nonWhitespaceContent
-
seenCR
protected boolean seenCR
-
mixInElement
protected boolean mixInElement
-
nextState
protected byte nextState
-
fDocumentSource
protected org.apache.xerces.xni.parser.XMLDocumentSource fDocumentSource
Document source
-
POS_ABSOLUTE_START
public final java.lang.String POS_ABSOLUTE_START
- See Also:
- Constant Field Values
-
POS_ABSOLUTE_END
public final java.lang.String POS_ABSOLUTE_END
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
X2PullParser
public X2PullParser() throws XmlPullParserExceptionCreate instance of pull parser.- Throws:
XmlPullParserException
-
-
Method Detail
-
warning
public void warning(java.lang.String domain, java.lang.String key, org.apache.xerces.xni.parser.XMLParseException ex) throws org.apache.xerces.xni.XNIExceptionWarning.- Specified by:
warningin interfaceorg.apache.xerces.xni.parser.XMLErrorHandler- Throws:
org.apache.xerces.xni.XNIException
-
error
public void error(java.lang.String domain, java.lang.String key, org.apache.xerces.xni.parser.XMLParseException ex) throws org.apache.xerces.xni.XNIExceptionError.- Specified by:
errorin interfaceorg.apache.xerces.xni.parser.XMLErrorHandler- Throws:
org.apache.xerces.xni.XNIException
-
fatalError
public void fatalError(java.lang.String domain, java.lang.String key, org.apache.xerces.xni.parser.XMLParseException ex) throws org.apache.xerces.xni.XNIExceptionFatal error.- Specified by:
fatalErrorin interfaceorg.apache.xerces.xni.parser.XMLErrorHandler- Throws:
org.apache.xerces.xni.XNIException
-
setDocumentSource
public void setDocumentSource(org.apache.xerces.xni.parser.XMLDocumentSource source)
Sets the document source- Specified by:
setDocumentSourcein interfaceorg.apache.xerces.xni.XMLDocumentHandler
-
getDocumentSource
public org.apache.xerces.xni.parser.XMLDocumentSource getDocumentSource()
Returns the document source- Specified by:
getDocumentSourcein interfaceorg.apache.xerces.xni.XMLDocumentHandler
-
startDocument
public 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- Specified by:
startDocumentin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
startDocument
public void startDocument(org.apache.xerces.xni.XMLLocator locator, java.lang.String encoding, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException- Throws:
org.apache.xerces.xni.XNIException
-
xmlDecl
public 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- Specified by:
xmlDeclin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
doctypeDecl
public 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- Specified by:
doctypeDeclin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
comment
public void comment(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException- Specified by:
commentin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
processingInstruction
public void processingInstruction(java.lang.String target, org.apache.xerces.xni.XMLString data, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException- Specified by:
processingInstructionin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
startGeneralEntity
public 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- Specified by:
startGeneralEntityin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
endGeneralEntity
public void endGeneralEntity(java.lang.String name, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException- Specified by:
endGeneralEntityin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
startPrefixMapping
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException- Throws:
org.apache.xerces.xni.XNIException
-
startElement
public 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- Specified by:
startElementin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
emptyElement
public 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- Specified by:
emptyElementin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
startEntity
public 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- Throws:
org.apache.xerces.xni.XNIException
-
textDecl
public void textDecl(java.lang.String version, java.lang.String encoding, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException- Specified by:
textDeclin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
endEntity
public void endEntity(java.lang.String name, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException- Throws:
org.apache.xerces.xni.XNIException
-
characters
public void characters(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException- Specified by:
charactersin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
ignorableWhitespace
public void ignorableWhitespace(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException- Specified by:
ignorableWhitespacein interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
endElement
public void endElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException- Specified by:
endElementin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
endPrefixMapping
public void endPrefixMapping(java.lang.String prefix, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException- Throws:
org.apache.xerces.xni.XNIException
-
startCDATA
public void startCDATA(org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException- Specified by:
startCDATAin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
endCDATA
public void endCDATA(org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException- Specified by:
endCDATAin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
endDocument
public void endDocument(org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException- Specified by:
endDocumentin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
next
public byte next() throws XmlPullParserException, java.io.IOExceptionThis is a key method - translates XNI callbacks into XPP events (such as START_TAG, END_TAG, CONTENT). or END_DOCUMENT if no more input.- Specified by:
nextin interfaceXmlPullParser- Throws:
XmlPullParserExceptionjava.io.IOException
-
setInput
public void setInput(java.io.Reader reader) throws XmlPullParserExceptionReset parser and set new input.- Specified by:
setInputin interfaceXmlPullParser- Throws:
XmlPullParserException
-
setInput
public void setInput(char[] buf) throws XmlPullParserExceptionReset parser and set new input.- Specified by:
setInputin interfaceXmlPullParser- Throws:
XmlPullParserException
-
setInput
public void setInput(char[] buf, int off, int len) throws XmlPullParserExceptionDescription copied from interface:XmlPullParserSet the input for parser.- Specified by:
setInputin interfaceXmlPullParser- Throws:
XmlPullParserException
-
reset
public void reset()
Reset parser state so it can be used to parse new- Specified by:
resetin interfaceXmlPullParser
-
isAllowedMixedContent
public boolean isAllowedMixedContent()
Description copied from interface:XmlPullParserIs mixed element context allowed?- Specified by:
isAllowedMixedContentin interfaceXmlPullParser
-
setAllowedMixedContent
public void setAllowedMixedContent(boolean enable) throws XmlPullParserExceptionAllow for mixed element content. Enabled by default. When disbaled element must containt either text or other elements.- Specified by:
setAllowedMixedContentin interfaceXmlPullParser- Throws:
XmlPullParserException
-
isNamespaceAware
public boolean isNamespaceAware()
Description copied from interface:XmlPullParserIs parser namespace aware?- Specified by:
isNamespaceAwarein interfaceXmlPullParser
-
setNamespaceAware
public void setNamespaceAware(boolean awareness) throws XmlPullParserExceptionSet support of namespaces. Disabled by default.- Specified by:
setNamespaceAwarein interfaceXmlPullParser- Throws:
XmlPullParserException
-
isNamespaceAttributesReporting
public boolean isNamespaceAttributesReporting()
Description copied from interface:XmlPullParserIs parser going to report namespace attributes (xmlns*) ?- Specified by:
isNamespaceAttributesReportingin interfaceXmlPullParser
-
setNamespaceAttributesReporting
public void setNamespaceAttributesReporting(boolean enable) throws XmlPullParserExceptionMake parser to report xmlns* attributes. Disabled by default. Only meaningful when namespaces are enabled (when namespaces are disabled all attributes are always reported).- Specified by:
setNamespaceAttributesReportingin interfaceXmlPullParser- Throws:
XmlPullParserException
-
getNamespaceUri
public java.lang.String getNamespaceUri()
Description copied from interface:XmlPullParserReturns the namespace URI of the current element Returns null if not applicable (current event must be START_TAG or END_TAG)- Specified by:
getNamespaceUriin interfaceXmlPullParser
-
getLocalName
public java.lang.String getLocalName()
Description copied from interface:XmlPullParserReturns the local name of the current element (current event must be START_TAG or END_TAG)- Specified by:
getLocalNamein interfaceXmlPullParser
-
getPrefix
public java.lang.String getPrefix()
Description copied from interface:XmlPullParserReturns the prefix of the current element or null if elemet has no prefix. (current event must be START_TAG or END_TAG)- Specified by:
getPrefixin interfaceXmlPullParser
-
getRawName
public java.lang.String getRawName()
Description copied from interface:XmlPullParserReturns the raw name (prefix + ':' + localName) of the current element (current event must be START_TAG or END_TAG)- Specified by:
getRawNamein interfaceXmlPullParser
-
getQNameLocal
public java.lang.String getQNameLocal(java.lang.String qName)
Description copied from interface:XmlPullParserReturn local part of qname. For example for 'xsi:type' it returns 'type'.- Specified by:
getQNameLocalin interfaceXmlPullParser
-
getQNameUri
public java.lang.String getQNameUri(java.lang.String qName) throws XmlPullParserExceptionDescription copied from interface:XmlPullParserReturn uri part of qname. It is depending on current state of parser to find what namespace uri is mapped from namespace prefix. For example for 'xsi:type' if xsi namespace prefix was declared to 'urn:foo' it will return 'urn:foo'.- Specified by:
getQNameUriin interfaceXmlPullParser- Throws:
XmlPullParserException
-
getDepth
public int getDepth()
Description copied from interface:XmlPullParserReturns the current depth of the element.- Specified by:
getDepthin interfaceXmlPullParser
-
getNamespacesLength
public int getNamespacesLength(int depth)
- Specified by:
getNamespacesLengthin interfaceXmlPullParser
-
readNamespacesPrefixes
public void readNamespacesPrefixes(int depth, java.lang.String[] prefixes, int off, int len) throws XmlPullParserExceptionReturn namespace prefixes for element at depth- Specified by:
readNamespacesPrefixesin interfaceXmlPullParser- Throws:
XmlPullParserException
-
readNamespacesUris
public void readNamespacesUris(int depth, java.lang.String[] uris, int off, int len) throws XmlPullParserExceptionReturn namespace URIs for element at depth- Specified by:
readNamespacesUrisin interfaceXmlPullParser- Throws:
XmlPullParserException
-
getPosDesc
public 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...]'.- Specified by:
getPosDescin interfaceXmlPullParser
-
getLineNumber
public int getLineNumber()
- Specified by:
getLineNumberin interfaceXmlPullParser
-
getColumnNumber
public int getColumnNumber()
- Specified by:
getColumnNumberin interfaceXmlPullParser
-
getEventType
public byte getEventType()
Description copied from interface:XmlPullParserReturns the type of the current element (START_TAG, END_TAG, CONTENT, etc)- Specified by:
getEventTypein interfaceXmlPullParser
-
isWhitespaceContent
public boolean isWhitespaceContent() throws XmlPullParserExceptionReturn true if just read CONTENT contained only white spaces.- Specified by:
isWhitespaceContentin interfaceXmlPullParser- Throws:
XmlPullParserException
-
getContentLength
public int getContentLength() throws XmlPullParserExceptionDescription copied from interface:XmlPullParserReturn how big is content.NOTE: parser must be on CONTENT event.
- Specified by:
getContentLengthin interfaceXmlPullParser- Throws:
XmlPullParserException
-
readContent
public java.lang.String readContent() throws XmlPullParserExceptionReturn String that contains just read CONTENT.- Specified by:
readContentin interfaceXmlPullParser- Throws:
XmlPullParserException
-
readEndTag
public void readEndTag(XmlEndTag etag) throws XmlPullParserException
Read value of just read END_TAG into passed as argument EndTag.- Specified by:
readEndTagin interfaceXmlPullParser- Throws:
XmlPullParserException
-
readStartTag
public void readStartTag(XmlStartTag stag) throws XmlPullParserException
Read value of just read START_TAG into passed as argument StartTag.- Specified by:
readStartTagin interfaceXmlPullParser- Throws:
XmlPullParserException
-
readNodeWithoutChildren
public void readNodeWithoutChildren(XmlNode node) throws XmlPullParserException
Description copied from interface:XmlPullParserRead node: it calls readStartTag and then if parser is namespaces aware currently declared nemaspeces will be added and defaultNamespace will be set.NOTE: parser must be on START_TAG event. and all events will written into node!
- Specified by:
readNodeWithoutChildrenin interfaceXmlPullParser- Throws:
XmlPullParserException
-
readNode
public byte readNode(XmlNode node) throws XmlPullParserException, java.io.IOException
Description copied from interface:XmlPullParserRead subtree into node: call readNodeWithoutChildren and then parse subtree adding children (values obtained with readXontent or readNodeWithoutChildren).NOTE: parser must be on START_TAG event. and all events will written into node!
- Specified by:
readNodein interfaceXmlPullParser- Throws:
XmlPullParserExceptionjava.io.IOException
-
skipNode
public byte skipNode() throws XmlPullParserException, java.io.IOExceptionIf parser has just read start tag it allows to skip whoole subtree contined in this element. Returns when encounters end tag matching the start tag.- Specified by:
skipNodein interfaceXmlPullParser- Throws:
XmlPullParserExceptionjava.io.IOException
-
getHardLimit
public int getHardLimit()
- Specified by:
getHardLimitin interfaceXmlPullParserBufferControl
-
setHardLimit
public void setHardLimit(int value) throws XmlPullParserException- Specified by:
setHardLimitin interfaceXmlPullParserBufferControl- Throws:
XmlPullParserException
-
getSoftLimit
public int getSoftLimit()
- Specified by:
getSoftLimitin interfaceXmlPullParserBufferControl
-
setSoftLimit
public void setSoftLimit(int value) throws XmlPullParserException- Specified by:
setSoftLimitin interfaceXmlPullParserBufferControl- Throws:
XmlPullParserException
-
getBufferShrinkOffset
public int getBufferShrinkOffset()
- Specified by:
getBufferShrinkOffsetin interfaceXmlPullParserBufferControl
-
setBufferShrinkable
public void setBufferShrinkable(boolean shrinkable) throws XmlPullParserException- Specified by:
setBufferShrinkablein interfaceXmlPullParserBufferControl- Throws:
XmlPullParserException
-
isBufferShrinkable
public boolean isBufferShrinkable()
- Specified by:
isBufferShrinkablein interfaceXmlPullParserBufferControl
-
getEventStart
public int getEventStart()
- Specified by:
getEventStartin interfaceXmlPullParserEventPosition
-
getEventEnd
public int getEventEnd()
- Specified by:
getEventEndin interfaceXmlPullParserEventPosition
-
getEventBuffer
public char[] getEventBuffer()
Description copied from interface:XmlPullParserEventPositionNOTE: This may be internal buffer and is valud only until call to method next()- do NOT attempt modify !
- Specified by:
getEventBufferin interfaceXmlPullParserEventPosition
-
ensureCapacity
protected void ensureCapacity(int size)
Make sure that we have enough space to keep element stack if passed size.
-
ensureAttribs
protected void ensureAttribs(int size)
Make sure that in attributes temporary array is enough space.
-
resetState
protected void resetState()
-
-