|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
public interface XmlReader
XML reader interface used for input to the unmarshalling code. This interface allows easy substitution of different parsers or other input sources.
| Field Summary | |
|---|---|
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
|
| Method Summary | |
|---|---|
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.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.String |
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. |
| Field Detail |
|---|
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
| Method Detail |
|---|
ValidationContext getValidationContext()
void pushValidationContext(ValidationContext vctx)
vctx - contextUnmarshallingContext getBindingContext()
java.lang.String buildPositionString()
int nextToken()
throws JiBXException
JiBXException - if error reading or parsing document
int 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 document
int 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 name
true if tag found, false if not (recoverable error case)
JiBXException - on unrecoverable error
boolean 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 name
true if tag found, false if not (exception not thrown)
JiBXException - on unrecoverable error
boolean checkStartTag(java.lang.String name)
throws JiBXException
name - element name
true if match, false if not
JiBXException - on unrecoverable error
boolean 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 name
true if match, false if not
JiBXException - on unrecoverable error
void requireEndTag()
throws JiBXException
JiBXException - on unrecoverable error
java.lang.String getElementText()
throws JiBXException
null, in the case of a recoverable error)
java.lang.IllegalStateException - if not at a start tag
JiBXException - on unrecoverable error
java.lang.String 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 index
java.lang.IllegalStateException - if not at a start tag or invalid indexjava.lang.String getAttributeNamespace(int index)
index - attribute index
java.lang.IllegalStateException - if not at a start tag or invalid indexjava.lang.String getAttributePrefix(int index)
index - attribute index
null 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 tag
int 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 tag
java.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 index
JiBXException - on unrecoverable error
java.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 index
JiBXException - on unrecoverable errorjava.lang.String getOptionalAttributeText(java.lang.String name)
name - attribute name
null if attribute not present
java.lang.IllegalStateException - if not at a start tag or invalid index
java.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 name
null if attribute not present
java.lang.IllegalStateException - if not at a start tag or invalid index
java.lang.String getRequiredAttributeText(java.lang.String name)
throws JiBXException
name - attribute name
null if attribute not present and recoverable error
JiBXException - if attribute not present and unrecoverable error
java.lang.IllegalStateException - if not at a start tag or invalid index
java.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 name
null if attribute not present and recoverable error
JiBXException - if attribute not present and unrecoverable error
java.lang.IllegalStateException - if not at a start tag or invalid index
void selectText()
throws JiBXException
JiBXException - on unrecoverable error
void selectAttribute(int index)
throws JiBXException
index - attribute index (error if negative)
java.lang.IllegalStateException - if not at a start tag or invalid index
JiBXException - on unrecoverable errorboolean selectOptionalAttribute(java.lang.String name)
name - attribute name
true if attribute present, false if not
java.lang.IllegalStateException - if not at a start tag
void selectRequiredAttribute(java.lang.String name)
throws JiBXException
name - attribute name
java.lang.IllegalStateException - if not at a start tag
JiBXException - on unrecoverable error
boolean 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 name
true if attribute present, false if not
java.lang.IllegalStateException - if not at a start tag
void 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 name
java.lang.IllegalStateException - if not at a start tag
JiBXException - on unrecoverable error
java.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 error
int 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 error
java.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 error
long 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 error
java.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 error
long 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 error
java.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 error
long 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 error
java.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 error
byte[] 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 error
java.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 error
java.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 error
java.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 index
java.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 depth
java.lang.IllegalArgumentException - if invalid depthjava.lang.String getNamespaceUri(int index)
index - declaration index
java.lang.IllegalArgumentException - if invalid indexjava.lang.String getNamespacePrefix(int index)
index - declaration index
null if a default namespace
java.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 found
null if prefix not defined)java.lang.String getInputEncoding()
null if unknown)boolean isNamespaceAware()
true 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 | |||||