Top Description Inners Fields Constructors Methods
com.amazon.ion.impl

pack-priv Class IonReaderTextSystemX

extends IonReaderTextRawX
implements _Private_ReaderWriter
Class Inheritance
All Implemented Interfaces
com.amazon.ion.impl._Private_ReaderWriter
Known Direct Subclasses
com.amazon.ion.impl.IonReaderTextUserX
Static Imports
com.amazon.ion.impl._Private_ScalarConversions.getValueTypeName

References Deprecated

IonReaderTextRawX is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

This reader calls the IonReaderTextRawX for low level events. It surfaces the reader functions that construct instances of various sorts (numbers, java strings, etc). It also caches the fieldname and annotations of the current value. It does not understand symbol tables nor care about them the IonTextUserReader is responsible for that.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum

Field Summary

Modifier and TypeField and Description
pack-priv SymbolTable
private static int
Inherited from com.amazon.ion.impl.IonReaderTextRawX:
_annotation_count_annotations_container_is_struct_container_prohibits_commas_container_state_stack_container_state_top_current_value_buffer_current_value_buffer_loaded_current_value_save_point_current_value_save_point_loaded_debug_eof_field_name_field_name_sid_has_next_called_lob_actual_len_lob_bytes_lob_loaded_lob_token_lob_value_position_lob_value_set_nesting_parent_null_type_scanner_state_v_value_keyword_value_start_column_value_start_line_value_start_offset_value_typeACTION_countACTION_EAT_COMMAACTION_EOFACTION_FINISH_CONTAINERACTION_FINISH_DATAGRAMACTION_FINISH_LOBACTION_LOAD_ANNOTATIONACTION_LOAD_FIELD_NAMEACTION_LOAD_SCALARACTION_MINUS_INFACTION_NOT_DEFINEDACTION_PLUS_INFACTION_START_LISTACTION_START_LOBACTION_START_SEXPACTION_START_STRUCTSTATE_AFTER_VALUE_CONTENTSSTATE_BEFORE_ANNOTATION_CONTAINEDSTATE_BEFORE_ANNOTATION_DATAGRAMSTATE_BEFORE_ANNOTATION_SEXPSTATE_BEFORE_FIELD_NAMESTATE_BEFORE_VALUE_CONTENTSTATE_BEFORE_VALUE_CONTENT_SEXPSTATE_EOFSTATE_IN_BLOB_CONTENTSTATE_IN_CLOB_DOUBLE_QUOTED_CONTENTSTATE_IN_CLOB_TRIPLE_QUOTED_CONTENTSTATE_IN_LONG_STRINGSTATE_MAXTransitionActionsTransitionActions2UNKNOWN_SIZE

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public BigDecimal
bigDecimalValue()

Implements com.amazon.ion.IonReader.bigDecimalValue.

Returns the current value as a BigDecimal.

public BigInteger
public boolean
booleanValue()

Implements com.amazon.ion.IonReader.booleanValue.

Returns the current value as an boolean.

public int
byteSize()

Implements com.amazon.ion.IonReader.byteSize.

Gets the size in bytes of the current lob value.

private final void
cast_cached_value(int new_type)

private void
private void
public Date
dateValue()

Implements com.amazon.ion.IonReader.dateValue.

Returns the current value as a java.util.Date.

public Decimal
decimalValue()

Implements com.amazon.ion.IonReader.decimalValue.

Returns the current value as a Decimal, which extends BigDecimal with support for negative zeros.

public double
doubleValue()

Implements com.amazon.ion.IonReader.doubleValue.

Returns the current value as a double.

private void
ensureLob(String apiName)

private final void
private final void
public int
getBytes(byte[]
destination to copy the value into, this must not be null.
buffer
,
int
the first position to copy into, this must be non null and less than the length of buffer.
offset
,
int
the number of bytes available in the buffer to copy into, this must be long enough to hold the whole value and not extend outside of buffer.
len
)

Implements com.amazon.ion.IonReader.getBytes.

Copies the current value into the passed in a byte array.

public final int
getFieldId()

Overrides com.amazon.ion.impl.IonReaderTextRawX.getFieldId.

Implements com.amazon.ion.IonReader.getFieldId.

/** Gets the symbol ID of the field name attached to the current value.

public final String
getFieldName()

Overrides com.amazon.ion.impl.IonReaderTextRawX.getFieldName.

Implements com.amazon.ion.IonReader.getFieldName.

Return the field name of the current value.

public SymbolToken
getFieldNameSymbol()

Overrides com.amazon.ion.impl.IonReaderTextRawX.getFieldNameSymbol.

Implements com.amazon.ion.IonReader.getFieldNameSymbol.

Gets the current value's field name as a symbol token (text + ID).

public IntegerSize
getIntegerSize()

Implements com.amazon.ion.IonReader.getIntegerSize.

Returns an IntegerSize representing the smallest-possible Java type of the Ion int at the current value.

public IonValue
public SymbolTable

Returns:

not null.
getSymbolTable
()

Overrides com.amazon.ion.impl.IonReaderTextRawX.getSymbolTable.

Implements com.amazon.ion.IonReader.getSymbolTable.

Horrible temporary hack.

public String[]
getTypeAnnotations()

Implements com.amazon.ion.IonReader.getTypeAnnotations.

Return the annotations of the current value as an array of strings.

public SymbolToken[]
getTypeAnnotationSymbols()

Implements com.amazon.ion.IonReader.getTypeAnnotationSymbols.

Gets the current value's annotations as symbol tokens (text + ID).

public int
intValue()

Implements com.amazon.ion.IonReader.intValue.

Returns the current value as an int.

public boolean
isNullValue()

Implements com.amazon.ion.IonReader.isNullValue.

Determines whether the current value is a null Ion value of any type (for example, null or null.int).

private int
private final void
private final long
private void
private final void
load_or_cast_cached_value(int
desired value type (in local type terms)
value_type
)

this checks the state of the raw reader to make sure this is valid.

private final void
public long
longValue()

Implements com.amazon.ion.IonReader.longValue.

Returns the current value as a long.

public byte[]
newBytes()

Implements com.amazon.ion.IonReader.newBytes.

Returns the current value as a newly-allocated byte array.

public SymbolTable
private int
readBytes(byte[] buffer, int offset, int len)

private void
resolveAnnotationSymbols(int count)

Resolve annotations with the current symbol table.

public final String
stringValue()

Implements com.amazon.ion.IonReader.stringValue.

Returns the current value as a Java String.

public SymbolToken
symbolValue()

Implements com.amazon.ion.IonReader.symbolValue.

Returns the current value as a symbol token (text + ID).

public Timestamp
timestampValue()

Implements com.amazon.ion.IonReader.timestampValue.

Returns the current value as a Timestamp.

Inherited from com.amazon.ion.impl.IonReaderTextRawX:
asFacetclear_current_value_bufferclosegetContainerTypegetDepthgetRawFieldNamegetTypehas_next_raw_valuehasNextinitinitinit_onceisInStructiterateTypeAnnotationsmakeTransition2ActionArraymakeTransitionActionArraynextparse_errorparse_errorparse_to_next_valuere_initstepInstepOuttoken_contents_loadtokenValueIsFinished

Field Detail

_system_symtabback to summary
pack-priv SymbolTable _system_symtab
UNSIGNED_BYTE_MAX_VALUEback to summary
private static int UNSIGNED_BYTE_MAX_VALUE

Constructor Detail

IonReaderTextSystemXback to summary
protected IonReaderTextSystemX(UnifiedInputStreamX iis)

Method Detail

bigDecimalValueback to summary
public BigDecimal bigDecimalValue()

Implements com.amazon.ion.IonReader.bigDecimalValue.

Doc from com.amazon.ion.IonReader.bigDecimalValue.

Returns the current value as a BigDecimal. This method should not return a Decimal, so it lacks support for negative zeros.

This method is only valid when getType() returns IonType#DECIMAL.

Returns:BigDecimal

the current value as a BigDecimal, or null if the current value is null.decimal.

bigIntegerValueback to summary
public BigInteger bigIntegerValue()

Implements abstract com.amazon.ion.impl.IonReaderTextRawX.bigIntegerValue.

Implements com.amazon.ion.IonReader.bigIntegerValue.

Doc from com.amazon.ion.IonReader.bigIntegerValue.

Returns the current value as a BigInteger. This is only valid if there is an underlying value and the value is of type int or float.

Annotations
@Override
booleanValueback to summary
public boolean booleanValue()

Implements com.amazon.ion.IonReader.booleanValue.

Doc from com.amazon.ion.IonReader.booleanValue.

Returns the current value as an boolean. This is only valid when getType() returns IonType#BOOL.

byteSizeback to summary
public int byteSize()

Implements com.amazon.ion.IonReader.byteSize.

Doc from com.amazon.ion.IonReader.byteSize.

Gets the size in bytes of the current lob value. This is only valid when getType() returns IonType#BLOB or IonType#CLOB.

Returns:int

the lob's size in bytes.

cast_cached_valueback to summary
private final void cast_cached_value(int new_type)
checkIsBigIntegerApplicableTypeback to summary
private void checkIsBigIntegerApplicableType()
checkIsIntApplicableTypeback to summary
private void checkIsIntApplicableType()
dateValueback to summary
public Date dateValue()

Implements com.amazon.ion.IonReader.dateValue.

Doc from com.amazon.ion.IonReader.dateValue.

Returns the current value as a java.util.Date. This is only valid when getType() returns IonType#TIMESTAMP.

Returns:Date

the current value as a Date, or null if the current value is null.timestamp.

decimalValueback to summary
public Decimal decimalValue()

Implements com.amazon.ion.IonReader.decimalValue.

Doc from com.amazon.ion.IonReader.decimalValue.

Returns the current value as a Decimal, which extends BigDecimal with support for negative zeros. This is only valid when getType() returns IonType#DECIMAL.

Returns:Decimal

the current value as a Decimal, or null if the current value is null.decimal.

doubleValueback to summary
public double doubleValue()

Implements com.amazon.ion.IonReader.doubleValue.

Doc from com.amazon.ion.IonReader.doubleValue.

Returns the current value as a double. This is only valid if there is an underlying value and the value is either float, or decimal.

ensureLobback to summary
private void ensureLob(String apiName)
fillContainerListback to summary
private final void fillContainerList(IonSystem sys, IonSequence list)
fillContainerStructback to summary
private final void fillContainerStruct(IonSystem sys, IonStruct struct)
getBytesback to summary
public int getBytes(byte[] buffer, int offset, int len)

Implements com.amazon.ion.IonReader.getBytes.

Doc from com.amazon.ion.IonReader.getBytes.

Copies the current value into the passed in a byte array. This is only valid when getType() returns IonType#BLOB or IonType#CLOB.

Parameters
buffer:byte[]

destination to copy the value into, this must not be null.

offset:int

the first position to copy into, this must be non null and less than the length of buffer.

len:int

the number of bytes available in the buffer to copy into, this must be long enough to hold the whole value and not extend outside of buffer.

getFieldIdback to summary
public final int getFieldId()

Overrides com.amazon.ion.impl.IonReaderTextRawX.getFieldId.

Implements com.amazon.ion.IonReader.getFieldId.

Doc from com.amazon.ion.IonReader.getFieldId.

/** Gets the symbol ID of the field name attached to the current value.

This is an "expert method": correct use requires deep understanding of the Ion binary format. You almost certainly don't want to use it.

Returns:int

the symbol ID of the field name, if the current value is a field within a struct. If the current value is not a field, or if the symbol ID cannot be determined, this method returns a value less than one.

Annotations
@Override
getFieldNameback to summary
public final String getFieldName()

Overrides com.amazon.ion.impl.IonReaderTextRawX.getFieldName.

Implements com.amazon.ion.IonReader.getFieldName.

Doc from com.amazon.ion.IonReader.getFieldName.

Return the field name of the current value. Or null if there is no valid current value or if the current value is not a field of a struct.

Annotations
@Override
getFieldNameSymbolback to summary
public SymbolToken getFieldNameSymbol()

Overrides com.amazon.ion.impl.IonReaderTextRawX.getFieldNameSymbol.

Implements com.amazon.ion.IonReader.getFieldNameSymbol.

Doc from com.amazon.ion.IonReader.getFieldNameSymbol.

Gets the current value's field name as a symbol token (text + ID). If the text of the token isn't known, the result's SymbolToken#getText() will be null. If the symbol ID of the token isn't known, the result's SymbolToken#getSid() will be SymbolTable#UNKNOWN_SYMBOL_ID. At least one of the two fields will be defined.

Returns:SymbolToken

null if there is no current value or if the current value is not a field of a struct.

Annotations
@Override
getIntegerSizeback to summary
public IntegerSize getIntegerSize()

Implements com.amazon.ion.IonReader.getIntegerSize.

Doc from com.amazon.ion.IonReader.getIntegerSize.

Returns an IntegerSize representing the smallest-possible Java type of the Ion int at the current value. If the current value is null.int or is not an Ion int, or if there is no current value, null will be returned.

getIonValueback to summary
public IonValue getIonValue(IonSystem sys)
getSymbolTableback to summary
public SymbolTable getSymbolTable()

Overrides com.amazon.ion.impl.IonReaderTextRawX.getSymbolTable.

Implements com.amazon.ion.IonReader.getSymbolTable.

Horrible temporary hack.

Returns:SymbolTable

not null.

Annotations
@Override
getTypeAnnotationsback to summary
public String[] getTypeAnnotations()

Implements com.amazon.ion.IonReader.getTypeAnnotations.

Doc from com.amazon.ion.IonReader.getTypeAnnotations.

Return the annotations of the current value as an array of strings.

Returns:String[]

the (ordered) annotations on the current value, or an empty array (not null) if there are none.

getTypeAnnotationSymbolsback to summary
public SymbolToken[] getTypeAnnotationSymbols()

Implements com.amazon.ion.IonReader.getTypeAnnotationSymbols.

Doc from com.amazon.ion.IonReader.getTypeAnnotationSymbols.

Gets the current value's annotations as symbol tokens (text + ID).

Returns:SymbolToken[]

the (ordered) annotations on the current value, or an empty array (not null) if there are none.

intValueback to summary
public int intValue()

Implements com.amazon.ion.IonReader.intValue.

Doc from com.amazon.ion.IonReader.intValue.

Returns the current value as an int. This is only valid if there is an underlying value and the value is of a numeric type (int, float, or decimal).

isNullValueback to summary
public boolean isNullValue()

Implements com.amazon.ion.IonReader.isNullValue.

Doc from com.amazon.ion.IonReader.isNullValue.

Determines whether the current value is a null Ion value of any type (for example, null or null.int). It should be called before calling getters that return value types (int, long, boolean, double).

load_lob_contentsback to summary
private int load_lob_contents() throws IOException
load_lob_length_overflow_errorback to summary
private final void load_lob_length_overflow_error(long len)
load_lob_save_pointback to summary
private final long load_lob_save_point() throws IOException
load_onceback to summary
private void load_once()
load_or_cast_cached_valueback to summary
private final void load_or_cast_cached_value(int value_type)

this checks the state of the raw reader to make sure this is valid. It also checks for an existing cached value of the correct type. It will either cast the current value from an existing type to the type desired or it will construct the desired type from the raw input in the raw reader

Parameters
value_type:int

desired value type (in local type terms)

load_scalar_valueback to summary
private final void load_scalar_value() throws IOException
longValueback to summary
public long longValue()

Implements com.amazon.ion.IonReader.longValue.

Doc from com.amazon.ion.IonReader.longValue.

Returns the current value as a long. This is only valid if there is an underlying value and the value is of a numeric type (int, float, or decimal).

newBytesback to summary
public byte[] newBytes()

Implements com.amazon.ion.IonReader.newBytes.

Doc from com.amazon.ion.IonReader.newBytes.

Returns the current value as a newly-allocated byte array. This is only valid when getType() returns IonType#BLOB or IonType#CLOB.

pop_passed_symbol_tableback to summary
public SymbolTable pop_passed_symbol_table()

Implements com.amazon.ion.impl._Private_ReaderWriter.pop_passed_symbol_table.

readBytesback to summary
private int readBytes(byte[] buffer, int offset, int len) throws IOException
resolveAnnotationSymbolsback to summary
private void resolveAnnotationSymbols(int count)

Resolve annotations with the current symbol table.

stringValueback to summary
public final String stringValue()

Implements com.amazon.ion.IonReader.stringValue.

Doc from com.amazon.ion.IonReader.stringValue.

Returns the current value as a Java String. This is only valid when getType() returns IonType#STRING or IonType#SYMBOL.

symbolValueback to summary
public SymbolToken symbolValue()

Implements com.amazon.ion.IonReader.symbolValue.

Doc from com.amazon.ion.IonReader.symbolValue.

Returns the current value as a symbol token (text + ID). This is only valid when getType() returns IonType#SYMBOL.

Returns:SymbolToken

null if isNullValue()

timestampValueback to summary
public Timestamp timestampValue()

Implements com.amazon.ion.IonReader.timestampValue.

Doc from com.amazon.ion.IonReader.timestampValue.

Returns the current value as a Timestamp. This is only valid when getType() returns IonType#TIMESTAMP.

Returns:Timestamp

the current value as a Timestamp, or null if the current value is null.timestamp.

com.amazon.ion.impl back to summary

pack-priv sealed Enum IonReaderTextSystemX.Radix

extends Enum<IonReaderTextSystemX.Radix>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final IonReaderTextSystemX.Radix
public static final IonReaderTextSystemX.Radix
public static final IonReaderTextSystemX.Radix
private static final char[]
private static final char[]
private static final char[]
private static final char[]
private static final char[]
private static final char[]
private static final char[]
private static final char[]
private static final char[]
private static final char[]
private static final char[]
private static final char[]

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv abstract boolean
isInt(String image, int len)

pack-priv abstract boolean
isLong(String image, int len)

private static boolean
magnitudeLessThanOrEqualTo(String lhs, int lhsLen, char[] rhs)

public static IonReaderTextSystemX.Radix
public static IonReaderTextSystemX.Radix[]
private static boolean
valueWithinBounds(String value, int len, char[] minImage, char[] maxImage)

Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BINARYback to summary
public static final IonReaderTextSystemX.Radix BINARY
DECIMALback to summary
public static final IonReaderTextSystemX.Radix DECIMAL
HEXback to summary
public static final IonReaderTextSystemX.Radix HEX
MAX_BINARY_INT_IMAGEback to summary
private static final char[] MAX_BINARY_INT_IMAGE
MAX_BINARY_LONG_IMAGEback to summary
private static final char[] MAX_BINARY_LONG_IMAGE
MAX_HEX_INT_IMAGEback to summary
private static final char[] MAX_HEX_INT_IMAGE
MAX_HEX_LONG_IMAGEback to summary
private static final char[] MAX_HEX_LONG_IMAGE
MAX_INT_IMAGEback to summary
private static final char[] MAX_INT_IMAGE
MAX_LONG_IMAGEback to summary
private static final char[] MAX_LONG_IMAGE
MIN_BINARY_INT_IMAGEback to summary
private static final char[] MIN_BINARY_INT_IMAGE
MIN_BINARY_LONG_IMAGEback to summary
private static final char[] MIN_BINARY_LONG_IMAGE
MIN_HEX_INT_IMAGEback to summary
private static final char[] MIN_HEX_INT_IMAGE
MIN_HEX_LONG_IMAGEback to summary
private static final char[] MIN_HEX_LONG_IMAGE
MIN_INT_IMAGEback to summary
private static final char[] MIN_INT_IMAGE
MIN_LONG_IMAGEback to summary
private static final char[] MIN_LONG_IMAGE

Constructor Detail

Radixback to summary
private Radix()

Method Detail

isIntback to summary
pack-priv abstract boolean isInt(String image, int len)
isLongback to summary
pack-priv abstract boolean isLong(String image, int len)
magnitudeLessThanOrEqualToback to summary
private static boolean magnitudeLessThanOrEqualTo(String lhs, int lhsLen, char[] rhs)
valueOfback to summary
public static IonReaderTextSystemX.Radix valueOf(String name)
valuesback to summary
public static IonReaderTextSystemX.Radix[] values()
valueWithinBoundsback to summary
private static boolean valueWithinBounds(String value, int len, char[] minImage, char[] maxImage)