|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectorg.jibx.runtime.impl.XMLPullReaderFactory.XMLPullReader
private static class XMLPullReaderFactory.XMLPullReader
Wrapper for an XMLPull parser implementation. Since the internal parser API was originally based on XMLPull, this basically just delegates all the calls with minimal processing.
| Field Summary | |
|---|---|
private InByteBuffer |
m_byteBuffer
Byte buffer used when stream set directly (lazy create, null if not used). |
private java.lang.String |
m_docName
Document name. |
private java.lang.String |
m_encoding
Input document character encoding ( null if unknown) |
private org.xmlpull.v1.XmlPullParser |
m_parser
Actual parser. |
private InputStreamWrapper |
m_streamWrapper
Wrapper for supplied input stream (lazy create, null
if not used). |
| Fields inherited from interface org.jibx.runtime.IXMLReader |
|---|
CDSECT, COMMENT, DOCDECL, END_DOCUMENT, END_TAG, ENTITY_REF, IGNORABLE_WHITESPACE, PROCESSING_INSTRUCTION, START_DOCUMENT, START_TAG, TEXT |
| Constructor Summary | |
|---|---|
private |
XMLPullReaderFactory.XMLPullReader(org.xmlpull.v1.XmlPullParser parser)
Constructor used by factory. |
| Method Summary | |
|---|---|
java.lang.String |
buildPositionString()
Build current parse input position description. |
private java.lang.String |
describeException(java.lang.Exception e)
Format error message from exception. |
int |
getAttributeCount()
Get the number of attributes of the current start tag. |
java.lang.String |
getAttributeName(int index)
Get an attribute name from the current start tag. |
java.lang.String |
getAttributeNamespace(int index)
Get an attribute namespace from the current start tag. |
java.lang.String |
getAttributePrefix(int index)
Get an attribute prefix from the current start tag. |
java.lang.String |
getAttributeValue(int index)
Get an attribute value from the current start tag. |
java.lang.String |
getAttributeValue(java.lang.String ns,
java.lang.String name)
Get an attribute value from the current start tag. |
int |
getColumnNumber()
Get current source column number. |
java.lang.String |
getDocumentName()
Get document name. |
int |
getEventType()
Gets the current parse event type, without changing the current parse state. |
java.lang.String |
getInputEncoding()
Return the input encoding, if known. |
int |
getLineNumber()
Get current source line number. |
java.lang.String |
getName()
Get element name from the current start or end tag. |
java.lang.String |
getNamespace()
Get element namespace from the current start or end tag. |
java.lang.String |
getNamespace(java.lang.String prefix)
Get namespace URI associated with prefix. |
int |
getNamespaceCount(int depth)
Get number of namespace declarations active at depth. |
java.lang.String |
getNamespacePrefix(int index)
Get namespace prefix. |
java.lang.String |
getNamespaceUri(int index)
Get namespace URI. |
int |
getNestingDepth()
Get current element nesting depth. |
java.lang.String |
getPrefix()
Get element prefix from the current start or end tag. |
java.lang.String |
getText()
Get current text. |
void |
init()
Initialize reader. |
boolean |
isNamespaceAware()
Return namespace processing flag. |
int |
next()
Advance to next binding component of input document. |
int |
nextToken()
Advance to next parse event of input document. |
private void |
setDocument(java.io.InputStream is,
java.lang.String name,
java.lang.String enc)
Set document to be parsed from input stream. |
private void |
setDocument(java.io.Reader rdr,
java.lang.String name)
Set document to be parsed from reader. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final org.xmlpull.v1.XmlPullParser m_parser
private java.lang.String m_docName
private InByteBuffer m_byteBuffer
null if not used).
private InputStreamWrapper m_streamWrapper
null
if not used).
private java.lang.String m_encoding
null if unknown)
| Constructor Detail |
|---|
private XMLPullReaderFactory.XMLPullReader(org.xmlpull.v1.XmlPullParser parser)
parser - | Method Detail |
|---|
private void setDocument(java.io.InputStream is,
java.lang.String name,
java.lang.String enc)
throws JiBXException
is - document input streamname - document name (null if unknown)enc - document character encoding (null if unknown)
JiBXException - on parser configuration error
private void setDocument(java.io.Reader rdr,
java.lang.String name)
throws JiBXException
rdr - document readername - document name (null if unknown)
JiBXException - on parser configuration errorprivate java.lang.String describeException(java.lang.Exception e)
e - root cause exceptionpublic void init()
IXMLReader
init in interface IXMLReaderpublic java.lang.String buildPositionString()
IXMLReader
buildPositionString in interface IXMLReader
public int nextToken()
throws JiBXException
IXMLReader
nextToken in interface IXMLReaderJiBXException - if error reading or parsing document
public int next()
throws JiBXException
IXMLReaderIXMLReader.nextToken(), which consolidates text
content and ignores parse events for components such as comments and PIs.
next in interface IXMLReaderJiBXException - if error reading or parsing document
public int getEventType()
throws JiBXException
IXMLReader
getEventType in interface IXMLReaderJiBXException - if error parsing documentpublic java.lang.String getName()
IXMLReader
getName in interface IXMLReaderpublic java.lang.String getNamespace()
IXMLReader
getNamespace in interface IXMLReaderpublic java.lang.String getPrefix()
IXMLReader
getPrefix in interface IXMLReadernull if no prefix)public int getAttributeCount()
IXMLReader
getAttributeCount in interface IXMLReaderpublic java.lang.String getAttributeName(int index)
IXMLReader
getAttributeName in interface IXMLReaderindex - attribute index
public java.lang.String getAttributeNamespace(int index)
IXMLReader
getAttributeNamespace in interface IXMLReaderindex - attribute index
public java.lang.String getAttributePrefix(int index)
IXMLReader
getAttributePrefix in interface IXMLReaderindex - attribute index
null if no prefix present)public java.lang.String getAttributeValue(int index)
IXMLReader
getAttributeValue in interface IXMLReaderindex - attribute index
public java.lang.String getAttributeValue(java.lang.String ns,
java.lang.String name)
IXMLReader
getAttributeValue in interface IXMLReaderns - namespace URI for expected attribute (may be null
or the empty string for the empty namespace)name - attribute name expected
null if missingpublic java.lang.String getText()
IXMLReader
getText in interface IXMLReaderpublic int getNestingDepth()
IXMLReader
getNestingDepth in interface IXMLReaderpublic int getNamespaceCount(int depth)
IXMLReader
getNamespaceCount in interface IXMLReaderdepth - element nesting depth
public java.lang.String getNamespaceUri(int index)
IXMLReader
getNamespaceUri in interface IXMLReaderindex - declaration index
public java.lang.String getNamespacePrefix(int index)
IXMLReader
getNamespacePrefix in interface IXMLReaderindex - declaration index
null if a default namespacepublic java.lang.String getDocumentName()
IXMLReader
getDocumentName in interface IXMLReadernull if not knownpublic int getLineNumber()
IXMLReader
getLineNumber in interface IXMLReader-1 if line number
information not availablepublic int getColumnNumber()
IXMLReader
getColumnNumber in interface IXMLReader-1 if column
number information not availablepublic java.lang.String getNamespace(java.lang.String prefix)
IXMLReader
getNamespace in interface IXMLReaderprefix - to be found
null if prefix not defined)public java.lang.String getInputEncoding()
IXMLReader
getInputEncoding in interface IXMLReadernull if unknown)public boolean isNamespaceAware()
IXMLReader
isNamespaceAware in interface IXMLReadertrue if namespaces are
processed by reader, false if not)
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||