|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ctc.wstx.io.WstxInputData
com.ctc.wstx.sr.StreamScanner
com.ctc.wstx.sr.BasicStreamReader
com.ctc.wstx.sr.TypedStreamReader
public class TypedStreamReader
Complete implementation of XMLStreamReader2
,
including Typed Access API (Stax2 v3.0) implementation.
Only functionality missing is DTD validation, which is provided by a
specialized sub-class.
Field Summary | |
---|---|
protected org.codehaus.stax2.ri.typed.CharArrayBase64Decoder |
_base64Decoder
Lazily-constructed decoder object for decoding base64 encoded element binary content. |
protected org.codehaus.stax2.ri.typed.ValueDecoderFactory |
_decoderFactory
Factory used for constructing decoders we need for typed access |
protected static int |
MASK_TYPED_ACCESS_ARRAY
Mask of event types that are legal (starting) states to call Typed Access API from. |
protected static int |
MASK_TYPED_ACCESS_BINARY
|
Fields inherited from class com.ctc.wstx.sr.StreamScanner |
---|
CHAR_CR_LF_OR_NULL, CHAR_FIRST_PURE_TEXT, CHAR_LOWEST_LEGAL_LOCALNAME_CHAR, INT_CR_LF_OR_NULL, mCachedEntities, mCfgNsEnabled, mCfgReplaceEntities, mCfgTreatCharRefsAsEntities, mConfig, mCurrDepth, mCurrEntity, mCurrName, mDocXmlVersion, mInput, mInputTopDepth, mNameBuffer, mNormalizeLFs, mRootInput, mTokenInputCol, mTokenInputRow, mTokenInputTotal |
Fields inherited from class com.ctc.wstx.io.WstxInputData |
---|
CHAR_NULL, CHAR_SPACE, INT_NULL, INT_SPACE, MAX_UNICODE_CHAR, mCurrInputProcessed, mCurrInputRow, mCurrInputRowStart, mInputBuffer, mInputEnd, mInputPtr, mXml11 |
Fields inherited from interface org.codehaus.stax2.XMLStreamReader2 |
---|
FEATURE_DTD_OVERRIDE |
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 |
Constructor Summary | |
---|---|
protected |
TypedStreamReader(InputBootstrapper bs,
BranchingReaderSource input,
ReaderCreator owner,
ReaderConfig cfg,
InputElementStack elemStack,
boolean forER)
|
Method Summary | |
---|---|
protected org.codehaus.stax2.ri.typed.CharArrayBase64Decoder |
_base64Decoder()
|
protected org.codehaus.stax2.typed.TypedXMLStreamException |
_constructTypeException(IllegalArgumentException iae,
String lexicalValue)
Method called to wrap or convert given conversion-fail exception into a full TypedXMLStreamException , |
protected org.codehaus.stax2.ri.typed.ValueDecoderFactory |
_decoderFactory()
|
protected QName |
_verifyQName(QName n)
Method called to verify validity of the parsed QName element or attribute value. |
static TypedStreamReader |
createStreamReader(BranchingReaderSource input,
ReaderCreator owner,
ReaderConfig cfg,
InputBootstrapper bs,
boolean forER)
Factory method for constructing readers. |
void |
getAttributeAs(int index,
org.codehaus.stax2.typed.TypedValueDecoder tvd)
|
int |
getAttributeAsArray(int index,
org.codehaus.stax2.typed.TypedArrayDecoder tad)
Method that allows reading contents of an attribute as an array of whitespace-separate tokens, decoded using specified decoder. |
byte[] |
getAttributeAsBinary(int index)
|
byte[] |
getAttributeAsBinary(int index,
org.codehaus.stax2.typed.Base64Variant v)
|
boolean |
getAttributeAsBoolean(int index)
|
BigDecimal |
getAttributeAsDecimal(int index)
|
double |
getAttributeAsDouble(int index)
|
double[] |
getAttributeAsDoubleArray(int index)
|
float |
getAttributeAsFloat(int index)
|
float[] |
getAttributeAsFloatArray(int index)
|
int |
getAttributeAsInt(int index)
|
int[] |
getAttributeAsIntArray(int index)
|
BigInteger |
getAttributeAsInteger(int index)
|
long |
getAttributeAsLong(int index)
|
long[] |
getAttributeAsLongArray(int index)
|
QName |
getAttributeAsQName(int index)
|
int |
getAttributeIndex(String namespaceURI,
String localName)
|
void |
getElementAs(org.codehaus.stax2.typed.TypedValueDecoder tvd)
|
byte[] |
getElementAsBinary()
|
byte[] |
getElementAsBinary(org.codehaus.stax2.typed.Base64Variant v)
|
boolean |
getElementAsBoolean()
|
BigDecimal |
getElementAsDecimal()
|
double |
getElementAsDouble()
|
float |
getElementAsFloat()
|
int |
getElementAsInt()
|
BigInteger |
getElementAsInteger()
|
long |
getElementAsLong()
|
QName |
getElementAsQName()
|
int |
readElementAsArray(org.codehaus.stax2.typed.TypedArrayDecoder dec)
Method called to parse array of primitives. |
int |
readElementAsBinary(byte[] resultBuffer,
int offset,
int maxLength)
|
int |
readElementAsBinary(byte[] resultBuffer,
int offset,
int maxLength,
org.codehaus.stax2.typed.Base64Variant v)
|
int |
readElementAsDoubleArray(double[] value,
int from,
int length)
|
int |
readElementAsFloatArray(float[] value,
int from,
int length)
|
int |
readElementAsIntArray(int[] value,
int from,
int length)
|
int |
readElementAsLongArray(long[] value,
int from,
int length)
|
Methods inherited from class com.ctc.wstx.io.WstxInputData |
---|
copyBufferStateFrom, findIllegalNameChar, findIllegalNmtokenChar, getCharDesc, isNameChar, isNameChar, isNameStartChar, isNameStartChar, isSpaceChar |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.codehaus.stax2.LocationInfo |
---|
getCurrentLocation, getStartLocation |
Field Detail |
---|
protected static final int MASK_TYPED_ACCESS_ARRAY
protected static final int MASK_TYPED_ACCESS_BINARY
protected org.codehaus.stax2.ri.typed.ValueDecoderFactory _decoderFactory
protected org.codehaus.stax2.ri.typed.CharArrayBase64Decoder _base64Decoder
Constructor Detail |
---|
protected TypedStreamReader(InputBootstrapper bs, BranchingReaderSource input, ReaderCreator owner, ReaderConfig cfg, InputElementStack elemStack, boolean forER) throws XMLStreamException
XMLStreamException
Method Detail |
---|
public static TypedStreamReader createStreamReader(BranchingReaderSource input, ReaderCreator owner, ReaderConfig cfg, InputBootstrapper bs, boolean forER) throws XMLStreamException
owner
- "Owner" of this reader, factory that created the reader;
needed for returning updated symbol table information after parsing.input
- Input source used to read the XML document.cfg
- Object that contains reader configuration info.
XMLStreamException
public boolean getElementAsBoolean() throws XMLStreamException
XMLStreamException
public int getElementAsInt() throws XMLStreamException
XMLStreamException
public long getElementAsLong() throws XMLStreamException
XMLStreamException
public float getElementAsFloat() throws XMLStreamException
XMLStreamException
public double getElementAsDouble() throws XMLStreamException
XMLStreamException
public BigInteger getElementAsInteger() throws XMLStreamException
XMLStreamException
public BigDecimal getElementAsDecimal() throws XMLStreamException
XMLStreamException
public QName getElementAsQName() throws XMLStreamException
XMLStreamException
public final byte[] getElementAsBinary() throws XMLStreamException
XMLStreamException
public byte[] getElementAsBinary(org.codehaus.stax2.typed.Base64Variant v) throws XMLStreamException
XMLStreamException
public void getElementAs(org.codehaus.stax2.typed.TypedValueDecoder tvd) throws XMLStreamException
XMLStreamException
public int readElementAsIntArray(int[] value, int from, int length) throws XMLStreamException
XMLStreamException
public int readElementAsLongArray(long[] value, int from, int length) throws XMLStreamException
XMLStreamException
public int readElementAsFloatArray(float[] value, int from, int length) throws XMLStreamException
XMLStreamException
public int readElementAsDoubleArray(double[] value, int from, int length) throws XMLStreamException
XMLStreamException
public final int readElementAsArray(org.codehaus.stax2.typed.TypedArrayDecoder dec) throws XMLStreamException
!!! 05-Sep-2008, tatu: Current implementation is not optimal either performance-wise, or from getting accurate Location for decoding problems. But it works otherwise, and we need to get Woodstox 4.0 out by the end of the year... so it'll do, for now.
XMLStreamException
public final int readElementAsBinary(byte[] resultBuffer, int offset, int maxLength) throws XMLStreamException
XMLStreamException
public int readElementAsBinary(byte[] resultBuffer, int offset, int maxLength, org.codehaus.stax2.typed.Base64Variant v) throws XMLStreamException
XMLStreamException
public int getAttributeIndex(String namespaceURI, String localName)
public boolean getAttributeAsBoolean(int index) throws XMLStreamException
XMLStreamException
public int getAttributeAsInt(int index) throws XMLStreamException
XMLStreamException
public long getAttributeAsLong(int index) throws XMLStreamException
XMLStreamException
public float getAttributeAsFloat(int index) throws XMLStreamException
XMLStreamException
public double getAttributeAsDouble(int index) throws XMLStreamException
XMLStreamException
public BigInteger getAttributeAsInteger(int index) throws XMLStreamException
XMLStreamException
public BigDecimal getAttributeAsDecimal(int index) throws XMLStreamException
XMLStreamException
public QName getAttributeAsQName(int index) throws XMLStreamException
XMLStreamException
public void getAttributeAs(int index, org.codehaus.stax2.typed.TypedValueDecoder tvd) throws XMLStreamException
XMLStreamException
public int[] getAttributeAsIntArray(int index) throws XMLStreamException
XMLStreamException
public long[] getAttributeAsLongArray(int index) throws XMLStreamException
XMLStreamException
public float[] getAttributeAsFloatArray(int index) throws XMLStreamException
XMLStreamException
public double[] getAttributeAsDoubleArray(int index) throws XMLStreamException
XMLStreamException
public int getAttributeAsArray(int index, org.codehaus.stax2.typed.TypedArrayDecoder tad) throws XMLStreamException
XMLStreamException
public byte[] getAttributeAsBinary(int index) throws XMLStreamException
XMLStreamException
public byte[] getAttributeAsBinary(int index, org.codehaus.stax2.typed.Base64Variant v) throws XMLStreamException
XMLStreamException
protected QName _verifyQName(QName n) throws org.codehaus.stax2.typed.TypedXMLStreamException
org.codehaus.stax2.typed.TypedXMLStreamException
protected org.codehaus.stax2.ri.typed.ValueDecoderFactory _decoderFactory()
protected org.codehaus.stax2.ri.typed.CharArrayBase64Decoder _base64Decoder()
protected org.codehaus.stax2.typed.TypedXMLStreamException _constructTypeException(IllegalArgumentException iae, String lexicalValue)
TypedXMLStreamException
,
iae
- Problem as reported by converterlexicalValue
- Lexical value (element content, attribute value)
that could not be converted succesfully.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |