public class StAXReaderWrapper extends Object implements IXMLReader
CDSECT, COMMENT, DOCDECL, END_DOCUMENT, END_TAG, ENTITY_REF, IGNORABLE_WHITESPACE, PROCESSING_INSTRUCTION, START_DOCUMENT, START_TAG, TEXT| Constructor and Description |
|---|
StAXReaderWrapper(javax.xml.stream.XMLStreamReader rdr,
String name,
boolean nsa)
Constructor used by factory.
|
| Modifier and Type | Method and Description |
|---|---|
String |
buildPositionString()
Build current parse input position description.
|
int |
getAttributeCount()
Get the number of attributes of the current start tag.
|
String |
getAttributeName(int index)
Get an attribute name from the current start tag.
|
String |
getAttributeNamespace(int index)
Get an attribute namespace from the current start tag.
|
String |
getAttributePrefix(int index)
Get an attribute prefix from the current start tag.
|
String |
getAttributeValue(int index)
Get an attribute value from the current start tag.
|
String |
getAttributeValue(String ns,
String name)
Get an attribute value from the current start tag.
|
int |
getColumnNumber()
Get current source column number.
|
String |
getDocumentName()
Get document name.
|
int |
getEventType()
Gets the current parse event type, without changing the current parse
state.
|
String |
getInputEncoding()
Return the input encoding, if known.
|
int |
getLineNumber()
Get current source line number.
|
String |
getName()
Get element name from the current start or end tag.
|
String |
getNamespace()
Get element namespace from the current start or end tag.
|
String |
getNamespace(String prefix)
Get namespace URI associated with prefix.
|
int |
getNamespaceCount(int depth)
Get number of namespace declarations active at depth.
|
String |
getNamespacePrefix(int index)
Get namespace prefix.
|
String |
getNamespaceUri(int index)
Get namespace URI.
|
int |
getNestingDepth()
Get current element nesting depth.
|
String |
getPrefix()
Get element prefix from the current start or end tag.
|
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.
|
public StAXReaderWrapper(javax.xml.stream.XMLStreamReader rdr, String name, boolean nsa)
rdr - event readername - document namensa - namespace aware flagpublic void init()
init in interface IXMLReaderpublic String buildPositionString()
buildPositionString in interface IXMLReaderpublic int nextToken()
throws JiBXException
IXMLReadernextToken in interface IXMLReaderJiBXException - if error reading or parsing documentpublic 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 documentpublic int getEventType()
throws JiBXException
IXMLReadergetEventType in interface IXMLReaderJiBXException - if error parsing documentpublic String getName()
IXMLReadergetName in interface IXMLReaderpublic String getNamespace()
IXMLReadergetNamespace in interface IXMLReaderpublic String getPrefix()
IXMLReadergetPrefix in interface IXMLReadernull if no prefix)public int getAttributeCount()
IXMLReadergetAttributeCount in interface IXMLReaderpublic String getAttributeName(int index)
IXMLReadergetAttributeName in interface IXMLReaderindex - attribute indexpublic String getAttributeNamespace(int index)
IXMLReadergetAttributeNamespace in interface IXMLReaderindex - attribute indexpublic String getAttributePrefix(int index)
IXMLReadergetAttributePrefix in interface IXMLReaderindex - attribute indexnull if no prefix present)public String getAttributeValue(int index)
IXMLReadergetAttributeValue in interface IXMLReaderindex - attribute indexpublic String getAttributeValue(String ns, String name)
IXMLReadergetAttributeValue in interface IXMLReaderns - namespace URI for expected attribute (may be null
or the empty string for the empty namespace)name - attribute name expectednull if missingpublic String getText()
IXMLReadergetText in interface IXMLReaderpublic int getNestingDepth()
IXMLReadergetNestingDepth in interface IXMLReaderpublic int getNamespaceCount(int depth)
IXMLReadergetNamespaceCount in interface IXMLReaderdepth - element nesting depthpublic String getNamespaceUri(int index)
IXMLReadergetNamespaceUri in interface IXMLReaderindex - declaration indexpublic String getNamespacePrefix(int index)
IXMLReadergetNamespacePrefix in interface IXMLReaderindex - declaration indexnull if a default namespacepublic String getDocumentName()
IXMLReadergetDocumentName in interface IXMLReadernull if not knownpublic int getLineNumber()
IXMLReadergetLineNumber in interface IXMLReader-1 if line number
information not availablepublic int getColumnNumber()
IXMLReadergetColumnNumber in interface IXMLReader-1 if column
number information not availablepublic String getNamespace(String prefix)
IXMLReadergetNamespace in interface IXMLReaderprefix - namespace prefix to be matched (null for
default namespace)null if prefix not defined)public String getInputEncoding()
IXMLReadergetInputEncoding in interface IXMLReadernull if unknown)public boolean isNamespaceAware()
IXMLReaderisNamespaceAware in interface IXMLReadertrue if namespaces are
processed by reader, false if not)Copyright © 2005-2014 jibx.org. All Rights Reserved.