org.gjt.xpp.x2impl.x2pullparser
Class X2PullParser

java.lang.Object
  extended byorg.gjt.xpp.x2impl.x2pullparser.X2PullParser
All Implemented Interfaces:
org.apache.xerces.xni.XMLDocumentHandler, org.apache.xerces.xni.parser.XMLErrorHandler, 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:

Limitations:

Author:
Aleksander Slominski

Nested Class Summary
protected  class X2PullParser.CumulativeReader
           
 
Field Summary
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?
 
Fields inherited from interface org.gjt.xpp.XmlPullParser
CONTENT, END_DOCUMENT, END_TAG, START_TAG
 
Constructor Summary
X2PullParser()
          Create instance of pull parser.
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 XmlPullParserException
Create instance of pull parser.

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.XNIException
Warning.

Specified by:
warning in interface org.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.XNIException
Error.

Specified by:
error in interface org.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.XNIException
Fatal error.

Specified by:
fatalError in interface org.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:
setDocumentSource in interface org.apache.xerces.xni.XMLDocumentHandler

getDocumentSource

public org.apache.xerces.xni.parser.XMLDocumentSource getDocumentSource()
Returns the document source

Specified by:
getDocumentSource in interface org.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:
startDocument in interface org.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:
xmlDecl in interface org.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:
doctypeDecl in interface org.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:
comment in interface org.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:
processingInstruction in interface org.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:
startGeneralEntity in interface org.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:
endGeneralEntity in interface org.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:
startElement in interface org.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:
emptyElement in interface org.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:
textDecl in interface org.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:
characters in interface org.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:
ignorableWhitespace in interface org.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:
endElement in interface org.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:
startCDATA in interface org.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:
endCDATA in interface org.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:
endDocument in interface org.apache.xerces.xni.XMLDocumentHandler
Throws:
org.apache.xerces.xni.XNIException

next

public byte next()
          throws XmlPullParserException,
                 java.io.IOException
This 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:
next in interface XmlPullParser
Throws:
XmlPullParserException
java.io.IOException

setInput

public void setInput(java.io.Reader reader)
              throws XmlPullParserException
Reset parser and set new input.

Specified by:
setInput in interface XmlPullParser
Throws:
XmlPullParserException

setInput

public void setInput(char[] buf)
              throws XmlPullParserException
Reset parser and set new input.

Specified by:
setInput in interface XmlPullParser
Throws:
XmlPullParserException

setInput

public void setInput(char[] buf,
                     int off,
                     int len)
              throws XmlPullParserException
Description copied from interface: XmlPullParser
Set the input for parser.

Specified by:
setInput in interface XmlPullParser
Throws:
XmlPullParserException

reset

public void reset()
Reset parser state so it can be used to parse new

Specified by:
reset in interface XmlPullParser

isAllowedMixedContent

public boolean isAllowedMixedContent()
Description copied from interface: XmlPullParser
Is mixed element context allowed?

Specified by:
isAllowedMixedContent in interface XmlPullParser

setAllowedMixedContent

public void setAllowedMixedContent(boolean enable)
                            throws XmlPullParserException
Allow for mixed element content. Enabled by default. When disbaled element must containt either text or other elements.

Specified by:
setAllowedMixedContent in interface XmlPullParser
Throws:
XmlPullParserException

isNamespaceAware

public boolean isNamespaceAware()
Description copied from interface: XmlPullParser
Is parser namespace aware?

Specified by:
isNamespaceAware in interface XmlPullParser

setNamespaceAware

public void setNamespaceAware(boolean awareness)
                       throws XmlPullParserException
Set support of namespaces. Disabled by default.

Specified by:
setNamespaceAware in interface XmlPullParser
Throws:
XmlPullParserException

isNamespaceAttributesReporting

public boolean isNamespaceAttributesReporting()
Description copied from interface: XmlPullParser
Is parser going to report namespace attributes (xmlns*) ?

Specified by:
isNamespaceAttributesReporting in interface XmlPullParser

setNamespaceAttributesReporting

public void setNamespaceAttributesReporting(boolean enable)
                                     throws XmlPullParserException
Make 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:
setNamespaceAttributesReporting in interface XmlPullParser
Throws:
XmlPullParserException

getNamespaceUri

public java.lang.String getNamespaceUri()
Description copied from interface: XmlPullParser
Returns the namespace URI of the current element Returns null if not applicable (current event must be START_TAG or END_TAG)

Specified by:
getNamespaceUri in interface XmlPullParser

getLocalName

public java.lang.String getLocalName()
Description copied from interface: XmlPullParser
Returns the local name of the current element (current event must be START_TAG or END_TAG)

Specified by:
getLocalName in interface XmlPullParser

getPrefix

public java.lang.String getPrefix()
Description copied from interface: XmlPullParser
Returns the prefix of the current element or null if elemet has no prefix. (current event must be START_TAG or END_TAG)

Specified by:
getPrefix in interface XmlPullParser

getRawName

public java.lang.String getRawName()
Description copied from interface: XmlPullParser
Returns the raw name (prefix + ':' + localName) of the current element (current event must be START_TAG or END_TAG)

Specified by:
getRawName in interface XmlPullParser

getQNameLocal

public java.lang.String getQNameLocal(java.lang.String qName)
Description copied from interface: XmlPullParser
Return local part of qname. For example for 'xsi:type' it returns 'type'.

Specified by:
getQNameLocal in interface XmlPullParser

getQNameUri

public java.lang.String getQNameUri(java.lang.String qName)
                             throws XmlPullParserException
Description copied from interface: XmlPullParser
Return 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:
getQNameUri in interface XmlPullParser
Throws:
XmlPullParserException

getDepth

public int getDepth()
Description copied from interface: XmlPullParser
Returns the current depth of the element.

Specified by:
getDepth in interface XmlPullParser

getNamespacesLength

public int getNamespacesLength(int depth)
Specified by:
getNamespacesLength in interface XmlPullParser

readNamespacesPrefixes

public void readNamespacesPrefixes(int depth,
                                   java.lang.String[] prefixes,
                                   int off,
                                   int len)
                            throws XmlPullParserException
Return namespace prefixes for element at depth

Specified by:
readNamespacesPrefixes in interface XmlPullParser
Throws:
XmlPullParserException

readNamespacesUris

public void readNamespacesUris(int depth,
                               java.lang.String[] uris,
                               int off,
                               int len)
                        throws XmlPullParserException
Return namespace URIs for element at depth

Specified by:
readNamespacesUris in interface XmlPullParser
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:
getPosDesc in interface XmlPullParser

getLineNumber

public int getLineNumber()
Specified by:
getLineNumber in interface XmlPullParser

getColumnNumber

public int getColumnNumber()
Specified by:
getColumnNumber in interface XmlPullParser

getEventType

public byte getEventType()
Description copied from interface: XmlPullParser
Returns the type of the current element (START_TAG, END_TAG, CONTENT, etc)

Specified by:
getEventType in interface XmlPullParser

isWhitespaceContent

public boolean isWhitespaceContent()
                            throws XmlPullParserException
Return true if just read CONTENT contained only white spaces.

Specified by:
isWhitespaceContent in interface XmlPullParser
Throws:
XmlPullParserException

getContentLength

public int getContentLength()
                     throws XmlPullParserException
Description copied from interface: XmlPullParser
Return how big is content.

NOTE: parser must be on CONTENT event.

Specified by:
getContentLength in interface XmlPullParser
Throws:
XmlPullParserException

readContent

public java.lang.String readContent()
                             throws XmlPullParserException
Return String that contains just read CONTENT.

Specified by:
readContent in interface XmlPullParser
Throws:
XmlPullParserException

readEndTag

public void readEndTag(XmlEndTag etag)
                throws XmlPullParserException
Read value of just read END_TAG into passed as argument EndTag.

Specified by:
readEndTag in interface XmlPullParser
Throws:
XmlPullParserException

readStartTag

public void readStartTag(XmlStartTag stag)
                  throws XmlPullParserException
Read value of just read START_TAG into passed as argument StartTag.

Specified by:
readStartTag in interface XmlPullParser
Throws:
XmlPullParserException

readNodeWithoutChildren

public void readNodeWithoutChildren(XmlNode node)
                             throws XmlPullParserException
Description copied from interface: XmlPullParser
Read 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:
readNodeWithoutChildren in interface XmlPullParser
Throws:
XmlPullParserException

readNode

public byte readNode(XmlNode node)
              throws XmlPullParserException,
                     java.io.IOException
Description copied from interface: XmlPullParser
Read 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:
readNode in interface XmlPullParser
Throws:
XmlPullParserException
java.io.IOException

skipNode

public byte skipNode()
              throws XmlPullParserException,
                     java.io.IOException
If 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:
skipNode in interface XmlPullParser
Throws:
XmlPullParserException
java.io.IOException

getHardLimit

public int getHardLimit()
Specified by:
getHardLimit in interface XmlPullParserBufferControl

setHardLimit

public void setHardLimit(int value)
                  throws XmlPullParserException
Specified by:
setHardLimit in interface XmlPullParserBufferControl
Throws:
XmlPullParserException

getSoftLimit

public int getSoftLimit()
Specified by:
getSoftLimit in interface XmlPullParserBufferControl

setSoftLimit

public void setSoftLimit(int value)
                  throws XmlPullParserException
Specified by:
setSoftLimit in interface XmlPullParserBufferControl
Throws:
XmlPullParserException

getBufferShrinkOffset

public int getBufferShrinkOffset()
Specified by:
getBufferShrinkOffset in interface XmlPullParserBufferControl

setBufferShrinkable

public void setBufferShrinkable(boolean shrinkable)
                         throws XmlPullParserException
Specified by:
setBufferShrinkable in interface XmlPullParserBufferControl
Throws:
XmlPullParserException

isBufferShrinkable

public boolean isBufferShrinkable()
Specified by:
isBufferShrinkable in interface XmlPullParserBufferControl

getEventStart

public int getEventStart()
Specified by:
getEventStart in interface XmlPullParserEventPosition

getEventEnd

public int getEventEnd()
Specified by:
getEventEnd in interface XmlPullParserEventPosition

getEventBuffer

public char[] getEventBuffer()
Description copied from interface: XmlPullParserEventPosition

NOTE: This may be internal buffer and is valud only until call to method next()- do NOT attempt modify !

Specified by:
getEventBuffer in interface XmlPullParserEventPosition

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()


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