Interface XMLStreamReaderExt
- All Superinterfaces:
XMLStreamConstants
,XMLStreamReader
- All Known Implementing Classes:
XMLStreamReaderExtImpl
This interface extends the simple XMLStreamReader interface adding
methods to get java objects asociated with schemas simple types like:
ints, long, BigIntegers, Dates etc
Note: Given the fact that an implemetation of this interface will not
run validation in the stream, we will not include support for lists,
enumeration and unions. They might be possible to introduce but the
user has to push the corect schema type. Because usualy the backends
are not list/union aware, there would be not performance win from this.
If interest rises for this, support should be added.
Author: Cezar Andrei (cezar.andrei at bea.com)
Date: Nov 14, 2003
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
-
Method Summary
Modifier and TypeMethodDescriptiongetAttributeBase64Value
(int index) Returns the decoded base64 value as anInputStream.getAttributeBase64Value
(String uri, String local) Returns the decoded base64 value as anInputStream.getAttributeBigDecimalValue
(int index) Returns the value as aBigDecimal
.getAttributeBigDecimalValue
(String uri, String local) Returns the value as aBigDecimal
.getAttributeBigIntegerValue
(int index) Returns the value as aBigInteger
.getAttributeBigIntegerValue
(String uri, String local) Returns the value as aBigInteger
.boolean
getAttributeBooleanValue
(int index) Returns the value as a boolean.boolean
getAttributeBooleanValue
(String uri, String local) Returns the value as a boolean.byte
getAttributeByteValue
(int index) Returns the value as a byte.byte
getAttributeByteValue
(String uri, String local) Returns the value as a byte.getAttributeCalendarValue
(int index) Returns the value as an XmlCalendar which extendsCalendar
.getAttributeCalendarValue
(String uri, String local) Returns the value as an XmlCalendar which extendsCalendar
.getAttributeDateValue
(int index) Returns the value as aDate
.getAttributeDateValue
(String uri, String local) Returns the value as aDate
.double
getAttributeDoubleValue
(int index) Returns the value as a double.double
getAttributeDoubleValue
(String uri, String local) Returns the value as a double.float
getAttributeFloatValue
(int index) Returns the value as a float.float
getAttributeFloatValue
(String uri, String local) Returns the value as a float.getAttributeGDateValue
(int index) Returns the value as aGDate
.getAttributeGDateValue
(String uri, String local) Returns the value as aGDate
.getAttributeGDurationValue
(int index) Returns the value as aGDuration
.getAttributeGDurationValue
(String uri, String local) Returns the value as aGDuration
.getAttributeHexBinaryValue
(int index) Returns the decoded hexbinary value as an InputStream.getAttributeHexBinaryValue
(String uri, String local) Returns the decoded hexbinary value as an InputStream.int
getAttributeIntValue
(int index) Returns the value as an int.int
getAttributeIntValue
(String uri, String local) Returns the value as an int.long
getAttributeLongValue
(int index) Returns the value as a long.long
getAttributeLongValue
(String uri, String local) Returns the value as a long.getAttributeQNameValue
(int index) Returns the value as aQName
.getAttributeQNameValue
(String uri, String local) Returns the value as aQName
.short
getAttributeShortValue
(int index) Returns the value as a short.short
getAttributeShortValue
(String uri, String local) Returns the value as a short.getAttributeStringValue
(int index) Returns the value as aString
.getAttributeStringValue
(int index, int wsStyle) Returns the value as aString
, with wsStyle applied.getAttributeStringValue
(String uri, String local) Returns the value as aString
.getAttributeStringValue
(String uri, String local, int wsStyle) Returns the value as aString
, with wsStyle applied.Returns the decoded base64 value as anInputStream.Returns the value as aBigDecimal
.Returns the value as aBigInteger
.boolean
Returns the value as a boolean.byte
Returns the value as a byte.Returns the value as an XmlCalendar which extendsCalendar
.Returns the value as aDate
.double
Returns the value as a double.float
Returns the value as a float.Returns the value as aGDate
.Returns the value as aGDuration
.Returns the decoded hexbinary value as an InputStream.int
Returns the value as an int.long
Returns the value as a long.Returns the value as aQName
.short
Returns the value as a short.Returns the value as aString
.getStringValue
(int wsStyle) Returns the value as aString
, with wsStyle applied.void
setDefaultValue
(String defaultValue) Sets the default value for the next getXXXValue() call.Methods inherited from interface javax.xml.stream.XMLStreamReader
close, getAttributeCount, getAttributeLocalName, getAttributeName, getAttributeNamespace, getAttributePrefix, getAttributeType, getAttributeValue, getAttributeValue, getCharacterEncodingScheme, getElementText, getEncoding, getEventType, getLocalName, getLocation, getName, getNamespaceContext, getNamespaceCount, getNamespacePrefix, getNamespaceURI, getNamespaceURI, getNamespaceURI, getPIData, getPITarget, getPrefix, getProperty, getText, getTextCharacters, getTextCharacters, getTextLength, getTextStart, getVersion, hasName, hasNext, hasText, isAttributeSpecified, isCharacters, isEndElement, isStandalone, isStartElement, isWhiteSpace, next, nextTag, require, standaloneSet
-
Field Details
-
WS_PRESERVE
static final int WS_PRESERVE- See Also:
-
WS_REPLACE
static final int WS_REPLACE- See Also:
-
WS_COLLAPSE
static final int WS_COLLAPSE- See Also:
-
-
Method Details
-
getStringValue
Returns the value as aString
.- Throws:
XMLStreamException
-
getStringValue
Returns the value as aString
, with wsStyle applied.- Throws:
XMLStreamException
-
getBooleanValue
Returns the value as a boolean.- Throws:
XMLStreamException
-
getByteValue
Returns the value as a byte.- Throws:
XMLStreamException
-
getShortValue
Returns the value as a short.- Throws:
XMLStreamException
-
getIntValue
Returns the value as an int.- Throws:
XMLStreamException
-
getLongValue
Returns the value as a long.- Throws:
XMLStreamException
-
getBigIntegerValue
Returns the value as aBigInteger
.- Throws:
XMLStreamException
-
getBigDecimalValue
Returns the value as aBigDecimal
.- Throws:
XMLStreamException
-
getFloatValue
Returns the value as a float.- Throws:
XMLStreamException
-
getDoubleValue
Returns the value as a double.- Throws:
XMLStreamException
-
getHexBinaryValue
Returns the decoded hexbinary value as an InputStream.- Throws:
XMLStreamException
-
getBase64Value
Returns the decoded base64 value as anInputStream.- Throws:
XMLStreamException
-
getCalendarValue
Returns the value as an XmlCalendar which extendsCalendar
.- Throws:
XMLStreamException
-
getDateValue
Returns the value as aDate
.- Throws:
XMLStreamException
-
getGDateValue
Returns the value as aGDate
.- Throws:
XMLStreamException
-
getGDurationValue
Returns the value as aGDuration
.- Throws:
XMLStreamException
-
getQNameValue
Returns the value as aQName
.- Throws:
XMLStreamException
-
getAttributeStringValue
Returns the value as aString
.- Throws:
XMLStreamException
-
getAttributeStringValue
Returns the value as aString
, with wsStyle applied.- Throws:
XMLStreamException
-
getAttributeBooleanValue
Returns the value as a boolean.- Throws:
XMLStreamException
-
getAttributeByteValue
Returns the value as a byte.- Throws:
XMLStreamException
-
getAttributeShortValue
Returns the value as a short.- Throws:
XMLStreamException
-
getAttributeIntValue
Returns the value as an int.- Throws:
XMLStreamException
-
getAttributeLongValue
Returns the value as a long.- Throws:
XMLStreamException
-
getAttributeBigIntegerValue
Returns the value as aBigInteger
.- Throws:
XMLStreamException
-
getAttributeBigDecimalValue
Returns the value as aBigDecimal
.- Throws:
XMLStreamException
-
getAttributeFloatValue
Returns the value as a float.- Throws:
XMLStreamException
-
getAttributeDoubleValue
Returns the value as a double.- Throws:
XMLStreamException
-
getAttributeHexBinaryValue
Returns the decoded hexbinary value as an InputStream.- Throws:
XMLStreamException
-
getAttributeBase64Value
Returns the decoded base64 value as anInputStream.- Throws:
XMLStreamException
-
getAttributeCalendarValue
Returns the value as an XmlCalendar which extendsCalendar
.- Throws:
XMLStreamException
-
getAttributeDateValue
Returns the value as aDate
.- Throws:
XMLStreamException
-
getAttributeGDateValue
Returns the value as aGDate
.- Throws:
XMLStreamException
-
getAttributeGDurationValue
Returns the value as aGDuration
.- Throws:
XMLStreamException
-
getAttributeQNameValue
Returns the value as aQName
.- Throws:
XMLStreamException
-
getAttributeStringValue
Returns the value as aString
.- Throws:
XMLStreamException
-
getAttributeStringValue
Returns the value as aString
, with wsStyle applied.- Throws:
XMLStreamException
-
getAttributeBooleanValue
Returns the value as a boolean.- Throws:
XMLStreamException
-
getAttributeByteValue
Returns the value as a byte.- Throws:
XMLStreamException
-
getAttributeShortValue
Returns the value as a short.- Throws:
XMLStreamException
-
getAttributeIntValue
Returns the value as an int.- Throws:
XMLStreamException
-
getAttributeLongValue
Returns the value as a long.- Throws:
XMLStreamException
-
getAttributeBigIntegerValue
Returns the value as aBigInteger
.- Throws:
XMLStreamException
-
getAttributeBigDecimalValue
Returns the value as aBigDecimal
.- Throws:
XMLStreamException
-
getAttributeFloatValue
Returns the value as a float.- Throws:
XMLStreamException
-
getAttributeDoubleValue
Returns the value as a double.- Throws:
XMLStreamException
-
getAttributeHexBinaryValue
Returns the decoded hexbinary value as an InputStream.- Throws:
XMLStreamException
-
getAttributeBase64Value
Returns the decoded base64 value as anInputStream.- Throws:
XMLStreamException
-
getAttributeCalendarValue
Returns the value as an XmlCalendar which extendsCalendar
.- Throws:
XMLStreamException
-
getAttributeDateValue
Returns the value as aDate
.- Throws:
XMLStreamException
-
getAttributeGDateValue
Returns the value as aGDate
.- Throws:
XMLStreamException
-
getAttributeGDurationValue
Returns the value as aGDuration
.- Throws:
XMLStreamException
-
getAttributeQNameValue
Returns the value as aQName
.- Throws:
XMLStreamException
-
setDefaultValue
Sets the default value for the next getXXXValue() call. For example: setDefaultValue("7"); //the xml looks like:<int> </int>
int i = getIntValue(); // returns 7 // from now on the default value will not apply anymore Note: Works for getAttributeXXXValue(...) too.- Throws:
XMLStreamException
-