public interface XmlReader
Modifier and Type | Field and Description |
---|---|
static int |
CDSECT |
static int |
COMMENT |
static int |
DOCDECL |
static int |
END_DOCUMENT |
static int |
END_TAG |
static int |
ENTITY_REF |
static int |
IGNORABLE_WHITESPACE |
static int |
PROCESSING_INSTRUCTION |
static int |
START_DOCUMENT |
static int |
START_TAG |
static int |
TEXT |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
buildPositionString()
Build current parse input position description.
|
boolean |
checkStartTag(java.lang.String name)
Advance to a start or end tag, and check if it is the named start tag in the implicit namespace.
|
boolean |
checkStartTag(java.lang.String ns,
java.lang.String name)
Advance to a start or end tag, and verify it is the named start tag.
|
byte[] |
convertBase64()
Convert a
byte[] value from the current source selection using base64Binary encoding. |
java.io.InputStream |
convertBase64Stream()
Convert an
InputStream value from the current source selection using base64Binary encoding. |
java.math.BigDecimal |
convertBigDecimal()
Convert a
BigDecimal value from the current source selection. |
java.math.BigInteger |
convertBigInteger()
Convert a
BigInteger value from the current source selection. |
java.lang.Long |
convertBoolean()
Convert a
Boolean value from the current source selection. |
long |
convertBooleanPrimitive()
Convert a
boolean value from the current source selection. |
java.util.Date |
convertDateTime()
Convert a
Date value from the current source selection. |
java.lang.Long |
convertFloat()
Convert a
Float value from the current source selection. |
long |
convertFloatPrimitive()
Convert a
float value from the current source selection. |
java.lang.Integer |
convertInteger()
Convert an
Integer value from the current source selection. |
int |
convertIntPrimitive()
Convert an
int value from the current source selection. |
java.lang.Long |
convertLong()
Convert a
Long value from the current source selection. |
long |
convertLongPrimitive()
Convert a
long value from the current source selection. |
java.lang.String |
convertString()
Convert a
String value from the current source selection. |
java.lang.Object |
createElementInstance(java.lang.String root,
XmlReader rdr,
java.lang.Object inst)
Creat instance of class for element name.
|
java.lang.Object |
createTypeInstance(java.lang.String dflt,
XmlReader rdr,
java.lang.Object inst)
Validate instance of class for type name.
|
java.lang.String |
getAttributeCollapsed(int index)
Read a required text attribute value from the current start tag with whitespace collapsed.
|
int |
getAttributeCount()
Get the number of attributes of the current start tag.
|
int |
getAttributeIndex(java.lang.String name)
Get the index of a no-namespace attribute from the current start tag.
|
int |
getAttributeIndex(java.lang.String ns,
java.lang.String name)
Get the index of an attribute from 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 |
getAttributeText(int index)
Get a required text attribute value from the current start tag.
|
UnmarshallingContext |
getBindingContext()
Get the unmarshalling context associated with this reader.
|
int |
getColumnNumber()
Get current source column number.
|
java.lang.String |
getDocumentName()
Get document name.
|
java.lang.String |
getElementText()
Get current element text.
|
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 |
getOptionalAttributeText(java.lang.String name)
Read an optional text attribute value from the current start tag.
|
java.lang.String |
getOptionalAttributeText(java.lang.String ns,
java.lang.String name)
Read an optional text attribute value from the current start tag.
|
java.lang.String |
getPrefix()
Get element prefix from the current start or end tag.
|
java.lang.String |
getRequiredAttributeText(java.lang.String name)
Read a required text attribute value from the current start tag.
|
java.lang.String |
getRequiredAttributeText(java.lang.String ns,
java.lang.String name)
Read a required text attribute value from the current start tag.
|
java.lang.CharSequence |
getText()
Get current text.
|
ValidationContext |
getValidationContext()
Get the current validation context for this 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.
|
void |
pushValidationContext(ValidationContext vctx)
Push a validation context on this reader.
|
java.lang.String |
readText()
Read current element text.
|
void |
requireEndTag()
Advance to the next start or end tag, and verify it is the close tag for the current open element.
|
boolean |
requireStartTag(java.lang.String name)
Advance to a start or end tag, and verify it is the named start tag in the implicit namespace.
|
boolean |
requireStartTag(java.lang.String ns,
java.lang.String name)
Advance to a start or end tag, and verify it is the named start tag.
|
void |
selectAttribute(int index)
Select an attribute value from the current start tag as text for conversion.
|
boolean |
selectOptionalAttribute(java.lang.String name)
Select an optional no-namespace attribute value from the current start tag as text for conversion.
|
boolean |
selectOptionalAttribute(java.lang.String ns,
java.lang.String name)
Select an optional attribute value from the current start tag as text for conversion.
|
void |
selectRequiredAttribute(java.lang.String name)
Select a required no-namespace attribute value from the current start tag as text for conversion.
|
void |
selectRequiredAttribute(java.lang.String ns,
java.lang.String name)
Select a required attribute value from the current start tag as text for conversion.
|
void |
selectText()
Select the current text content for conversion.
|
java.lang.String |
setImplicitNamespace(java.lang.String ns)
Set the implicit namespace used for elements unless otherwise specified.
|
static final int START_DOCUMENT
static final int END_DOCUMENT
static final int START_TAG
static final int END_TAG
static final int TEXT
static final int CDSECT
static final int ENTITY_REF
static final int IGNORABLE_WHITESPACE
static final int PROCESSING_INSTRUCTION
static final int COMMENT
static final int DOCDECL
ValidationContext getValidationContext()
void pushValidationContext(ValidationContext vctx)
vctx
- contextUnmarshallingContext getBindingContext()
java.lang.String buildPositionString()
int nextToken() throws JiBXException
JiBXException
- if error reading or parsing documentint next() throws JiBXException
nextToken()
,
which consolidates text content and ignores parse events for components such as comments and PIs.JiBXException
- if error reading or parsing documentint getEventType() throws JiBXException
JiBXException
- if error parsing documentjava.lang.String getName()
java.lang.IllegalStateException
- if not at a start or end tag (optional)java.lang.String getNamespace()
java.lang.IllegalStateException
- if not at a start or end tag (optional)java.lang.String getPrefix()
null
if no prefix)java.lang.IllegalStateException
- if not at a start or end tagjava.lang.String setImplicitNamespace(java.lang.String ns)
ns
- namespace URI for element (may be the empty string for the no-namespace namespace)boolean requireStartTag(java.lang.String name) throws JiBXException
name
- element nametrue
if tag found, false
if not (recoverable error case)JiBXException
- on unrecoverable errorboolean requireStartTag(java.lang.String ns, java.lang.String name) throws JiBXException
ns
- namespace URI for element (may be the empty string for the no-namespace namespace)name
- element nametrue
if tag found, false
if not (exception not thrown)JiBXException
- on unrecoverable errorboolean checkStartTag(java.lang.String name) throws JiBXException
name
- element nametrue
if match, false
if notJiBXException
- on unrecoverable errorboolean checkStartTag(java.lang.String ns, java.lang.String name) throws JiBXException
ns
- namespace URI for element (may be the empty string for the no-namespace namespace)name
- element nametrue
if match, false
if notJiBXException
- on unrecoverable errorvoid requireEndTag() throws JiBXException
JiBXException
- on unrecoverable errorjava.lang.String getElementText() throws JiBXException
null
, in the case of a recoverable error)java.lang.IllegalStateException
- if not at a start tagJiBXException
- on unrecoverable errorjava.lang.CharSequence getText() throws JiBXException
null
, in the case of a recoverable error)JiBXException
- on unrecoverable errorint getAttributeCount()
java.lang.IllegalStateException
- if not at a start tag (optional)java.lang.String getAttributeName(int index)
index
- attribute indexjava.lang.IllegalStateException
- if not at a start tag or invalid indexjava.lang.String getAttributeNamespace(int index)
index
- attribute indexjava.lang.IllegalStateException
- if not at a start tag or invalid indexjava.lang.String getAttributePrefix(int index)
index
- attribute indexnull
if no prefix present)java.lang.IllegalStateException
- if not at a start tag or invalid indexint getAttributeIndex(java.lang.String name)
name
- attribute name-1
if not found)java.lang.IllegalStateException
- if not at a start tagint getAttributeIndex(java.lang.String ns, java.lang.String name)
ns
- namespace URI for attribute (may be the empty string for the no-namespace namespace)name
- attribute name-1
if not found)java.lang.IllegalStateException
- if not at a start tagjava.lang.String getAttributeText(int index) throws JiBXException
index
- attribute index (error if negative)null
, in the case of a recoverable error)java.lang.IllegalStateException
- if not at a start tag or invalid indexJiBXException
- on unrecoverable errorjava.lang.String getAttributeCollapsed(int index) throws JiBXException
index
- attribute index (error if negative)null
, in the case of a recoverable error)java.lang.IllegalStateException
- if not at a start tag or invalid indexJiBXException
- on unrecoverable errorjava.lang.String getOptionalAttributeText(java.lang.String name)
name
- attribute namenull
if attribute not presentjava.lang.IllegalStateException
- if not at a start tag or invalid indexjava.lang.String getOptionalAttributeText(java.lang.String ns, java.lang.String name)
ns
- namespace URI for attribute (may be the empty string for the no-namespace namespace)name
- attribute namenull
if attribute not presentjava.lang.IllegalStateException
- if not at a start tag or invalid indexjava.lang.String getRequiredAttributeText(java.lang.String name) throws JiBXException
name
- attribute namenull
if attribute not present and recoverable errorJiBXException
- if attribute not present and unrecoverable errorjava.lang.IllegalStateException
- if not at a start tag or invalid indexjava.lang.String getRequiredAttributeText(java.lang.String ns, java.lang.String name) throws JiBXException
ns
- namespace URI for attribute (may be the empty string for the no-namespace namespace)name
- attribute namenull
if attribute not present and recoverable errorJiBXException
- if attribute not present and unrecoverable errorjava.lang.IllegalStateException
- if not at a start tag or invalid indexvoid selectText() throws JiBXException
JiBXException
- on unrecoverable errorvoid selectAttribute(int index) throws JiBXException
index
- attribute index (error if negative)java.lang.IllegalStateException
- if not at a start tag or invalid indexJiBXException
- on unrecoverable errorboolean selectOptionalAttribute(java.lang.String name)
name
- attribute nametrue
if attribute present, false
if notjava.lang.IllegalStateException
- if not at a start tagvoid selectRequiredAttribute(java.lang.String name) throws JiBXException
name
- attribute namejava.lang.IllegalStateException
- if not at a start tagJiBXException
- on unrecoverable errorboolean selectOptionalAttribute(java.lang.String ns, java.lang.String name)
ns
- namespace URI for attribute (may be the empty string for the no-namespace namespace)name
- attribute nametrue
if attribute present, false
if notjava.lang.IllegalStateException
- if not at a start tagvoid selectRequiredAttribute(java.lang.String ns, java.lang.String name) throws JiBXException
ns
- namespace URI for attribute (may be the empty string for the no-namespace namespace)name
- attribute namejava.lang.IllegalStateException
- if not at a start tagJiBXException
- on unrecoverable errorjava.lang.String convertString() throws JiBXException
String
value from the current source selection. This is an empty conversion, which always
just returns the text.null
if selection missing)JiBXException
- if unrecoverable conversion errorint convertIntPrimitive() throws JiBXException
int
value from the current source selection. This always uses whitespace collapsed
processing.0
if selection missing or in error)JiBXException
- if unrecoverable conversion errorjava.lang.Integer convertInteger() throws JiBXException
Integer
value from the current source selection. This always uses whitespace collapsed
processing.null
if selection missing or in error)JiBXException
- if unrecoverable conversion errorlong convertLongPrimitive() throws JiBXException
long
value from the current source selection. This always uses whitespace collapsed
processing.0
if selection missing or in error)JiBXException
- if unrecoverable conversion errorjava.lang.Long convertLong() throws JiBXException
Long
value from the current source selection. This always uses whitespace collapsed
processing.null
if selection missing or in error)JiBXException
- if unrecoverable conversion errorlong convertFloatPrimitive() throws JiBXException
float
value from the current source selection. This always uses whitespace collapsed
processing.0
if selection missing or in error)JiBXException
- if unrecoverable conversion errorjava.lang.Long convertFloat() throws JiBXException
Float
value from the current source selection. This always uses whitespace collapsed
processing.null
if selection missing or in error)JiBXException
- if unrecoverable conversion errorlong convertBooleanPrimitive() throws JiBXException
boolean
value from the current source selection. This always uses whitespace collapsed
processing.false
if selection missing or in error)JiBXException
- if unrecoverable conversion errorjava.lang.Long convertBoolean() throws JiBXException
Boolean
value from the current source selection. This always uses whitespace collapsed
processing.null
if selection missing or in error)JiBXException
- if unrecoverable conversion errorbyte[] convertBase64() throws JiBXException
byte[]
value from the current source selection using base64Binary encoding. This always
uses whitespace collapsed processing.null
if selection missing or in error)JiBXException
- if unrecoverable conversion errorjava.io.InputStream convertBase64Stream() throws JiBXException
InputStream
value from the current source selection using base64Binary encoding. This
always uses whitespace collapsed processing. For transports supporting attachments, the data for the stream may
come from an attachment.null
if selection missing or in error)JiBXException
- if unrecoverable conversion errorjava.util.Date convertDateTime() throws JiBXException
Date
value from the current source selection. This always uses whitespace collapsed
processing.null
if selection missing or in error)JiBXException
- if unrecoverable conversion errorjava.math.BigDecimal convertBigDecimal() throws JiBXException
BigDecimal
value from the current source selection. This always uses whitespace
collapsed processing.null
if selection missing or in error)JiBXException
- if unrecoverable conversion errorjava.math.BigInteger convertBigInteger() throws JiBXException
BigInteger
value from the current source selection. This always uses whitespace
collapsed processing.null
if selection missing or in error)JiBXException
- if unrecoverable conversion errorjava.lang.String readText()
java.lang.IllegalStateException
- if not at a start tag or invalid indexjava.lang.Object createElementInstance(java.lang.String root, XmlReader rdr, java.lang.Object inst)
root
- global root element name, including namespace URI, in "lname{uri}" formrdr
- readerinst
- supplied instance of root element class or subclass (null
if none)java.lang.Object createTypeInstance(java.lang.String dflt, XmlReader rdr, java.lang.Object inst)
dflt
- global default complexType name, including namespace URI, in "lname{uri}" formrdr
- readerinst
- supplied instance of default type class or subclass (null
if none)int getNestingDepth()
int getNamespaceCount(int depth)
depth
- element nesting depthjava.lang.IllegalArgumentException
- if invalid depthjava.lang.String getNamespaceUri(int index)
index
- declaration indexjava.lang.IllegalArgumentException
- if invalid indexjava.lang.String getNamespacePrefix(int index)
index
- declaration indexnull
if a default namespacejava.lang.IllegalArgumentException
- if invalid indexjava.lang.String getDocumentName()
null
if not knownint getLineNumber()
-1
if line number information not availableint getColumnNumber()
-1
if column number information not availablejava.lang.String getNamespace(java.lang.String prefix)
prefix
- to be foundnull
if prefix not defined)java.lang.String getInputEncoding()
null
if unknown)boolean isNamespaceAware()
true
if namespaces are processed by reader, false
if not)