Top Inners Constructors Methods
org.codehaus.stax2.ri

public final Class Stax2Util

extends Object
implements XMLStreamConstants
Class Inheritance
All Implemented Interfaces
javax.xml.stream.XMLStreamConstants
Imports
javax.xml.stream.XMLStreamConstants

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Stax2Util.ByteAggregator

Helper class for efficiently reading and aggregating variable length byte content.

public static class
Stax2Util.TextBuffer

Helper class used to simplify text gathering while keeping at as efficient as possible.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static final boolean
_isSpace(char c)

Note that it is assumed that any "weird" white space (xml 1.1 LSEP and NEL) have been replaced by canonical alternatives (linefeed for element content, regular space for attributes)

public static String
eventTypeDesc(int type)

Method that converts given standard Stax event type into textual representation.

public static String

Returns:

Trimmed value if lexical had at least one non-space character; null otherwise
trimSpaces
(String lexical)

Method called to trim leading and/or trailing space that given lexical value has.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Stax2Utilback to summary
private Stax2Util()

Method Detail

_isSpaceback to summary
private static final boolean _isSpace(char c)

Note that it is assumed that any "weird" white space (xml 1.1 LSEP and NEL) have been replaced by canonical alternatives (linefeed for element content, regular space for attributes)

eventTypeDescback to summary
public static String eventTypeDesc(int type)

Method that converts given standard Stax event type into textual representation.

trimSpacesback to summary
public static String trimSpaces(String lexical)

Method called to trim leading and/or trailing space that given lexical value has.

Returns:String

Trimmed value if lexical had at least one non-space character; null otherwise

org.codehaus.stax2.ri back to summary

public final Class Stax2Util.ByteAggregator

extends Object
Class Inheritance

Helper class for efficiently reading and aggregating variable length byte content.

Field Summary

Modifier and TypeField and Description
pack-priv static final int
DEFAULT_BLOCK_ARRAY_SIZE

Maximum block size we will use for individual non-aggregated blocks.

private static final int
INITIAL_BLOCK_SIZE

Size of the first block we will allocate.

private int
private byte[][]
private byte[]
mSpareBlock

Reusable byte buffer block; we retain biggest one from mBlocks after aggregation.

private int
private static final byte[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

Buffer in which to read additional data
addFullBlock
(byte[] block)

Method used to add bufferful of data to the aggregator, and get another buffer to read more data into.

public byte[]
aggregateAll(byte[] lastBlock, int lastLen)

Method called when results are finalized and we can get the full aggregated result buffer to return to the caller

public byte[]

Returns:

Block that can be used to read in content
startAggregation
()

Method called to initialize aggregation process.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_BLOCK_ARRAY_SIZEback to summary
pack-priv static final int DEFAULT_BLOCK_ARRAY_SIZE

Maximum block size we will use for individual non-aggregated blocks. Let's limit to using 256k chunks.

INITIAL_BLOCK_SIZEback to summary
private static final int INITIAL_BLOCK_SIZE

Size of the first block we will allocate.

mBlockCountback to summary
private int mBlockCount
mBlocksback to summary
private byte[][] mBlocks
mSpareBlockback to summary
private byte[] mSpareBlock

Reusable byte buffer block; we retain biggest one from mBlocks after aggregation.

mTotalLenback to summary
private int mTotalLen
NO_BYTESback to summary
private static final byte[] NO_BYTES

Constructor Detail

ByteAggregatorback to summary
public ByteAggregator()

Method Detail

addFullBlockback to summary
public byte[] addFullBlock(byte[] block)

Method used to add bufferful of data to the aggregator, and get another buffer to read more data into. Returned buffer is generally as big as or bigger than the given buffer, to try to improve performance for larger aggregations.

Returns:byte[]

Buffer in which to read additional data

aggregateAllback to summary
public byte[] aggregateAll(byte[] lastBlock, int lastLen)

Method called when results are finalized and we can get the full aggregated result buffer to return to the caller

startAggregationback to summary
public byte[] startAggregation()

Method called to initialize aggregation process.

Returns:byte[]

Block that can be used to read in content

org.codehaus.stax2.ri back to summary

public final Class Stax2Util.TextBuffer

extends Object
Class Inheritance

Helper class used to simplify text gathering while keeping at as efficient as possible.

Field Summary

Modifier and TypeField and Description
private StringBuffer
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
append(String text)

public String
get()

public boolean
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mBuilderback to summary
private StringBuffer mBuilder
mTextback to summary
private String mText

Constructor Detail

TextBufferback to summary
public TextBuffer()

Method Detail

appendback to summary
public void append(String text)
getback to summary
public String get()
isEmptyback to summary
public boolean isEmpty()
resetback to summary
public void reset()