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

pack-priv Class IonReaderTextUserX

extends IonReaderTextSystemX
implements _Private_ReaderWriter
Class Inheritance
All Implemented Interfaces
com.amazon.ion.impl._Private_ReaderWriter
Static Imports
com.amazon.ion.SystemSymbols.ION_1_0, .SystemSymbols.ION_SYMBOL_TABLE

References Deprecated

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

See corresponding docs for further information.

The text user reader add support for symbols and recognizes, and consumes (and processes), the system values $ion_1_0 and local symbol tables (tagged with $ion_symbol_table). Should this materialize and "symbolate" all the symbol values as they come through? - No. Probably if we want the symbol id's to be the same for this reader as it is for other variants. Hmmm, that's expensive when you don't need it (which is most of the time). This will not auto-populate a symbol table. In the event a symbol is a '$' symbol id symbol this will return that value. If the string is present in the current symbol table it will return the id, which would be true if the symbol is a system symbol or if there is a local symbol table in the input stream. Otherwise it return the undefined symbol value.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private class
private class

Field Summary

Modifier and TypeField and Description
pack-priv IonCatalog
private final _Private_LocalSymbolTableFactory
private final int
_physical_start_offset

This is the physical start-of-stream offset when this reader was created.

private SymbolTable[]
private int
pack-priv SymbolTable
private static final Pattern
Inherited from com.amazon.ion.impl.IonReaderTextSystemX:
_system_symtab

Constructor Summary

AccessConstructor and Description
protected
IonReaderTextUserX(IonCatalog catalog, _Private_LocalSymbolTableFactory lstFactory, UnifiedInputStreamX uis, int physicalStartOffset)

protected

Method Summary

Modifier and TypeMethod and Description
public <T> T
asFacet(Class<T>
The type token of the requested facet type.
facetType
)

Overrides com.amazon.ion.impl.IonReaderTextRawX.asFacet.

Implements com.amazon.ion.facet.Faceted.asFacet.

Returns a facet of this subject if supported.

private void
public Span
public final SymbolToken
getFieldNameSymbol()

Overrides com.amazon.ion.impl.IonReaderTextSystemX.getFieldNameSymbol.

Implements com.amazon.ion.IonReader.getFieldNameSymbol.

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

public SymbolTable
public SymbolToken[]
getTypeAnnotationSymbols()

Overrides com.amazon.ion.impl.IonReaderTextSystemX.getTypeAnnotationSymbols.

Implements com.amazon.ion.IonReader.getTypeAnnotationSymbols.

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

private final boolean
public boolean

Returns:

true if more data remains, false on eof
hasNext
()

Overrides com.amazon.ion.impl.IonReaderTextRawX.hasNext.

Implements com.amazon.ion.IonReader.hasNext.

this looks forward to see if there is an upcoming value and if there is it returns true.

private void
private static boolean
public SymbolTable
private void
private final void
public final SymbolToken
symbolValue()

Overrides com.amazon.ion.impl.IonReaderTextSystemX.symbolValue.

Implements com.amazon.ion.IonReader.symbolValue.

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

private void
Inherited from com.amazon.ion.impl.IonReaderTextSystemX:
bigDecimalValuebigIntegerValuebooleanValuebyteSizedateValuedecimalValuedoubleValuegetBytesgetFieldIdgetFieldNamegetIntegerSizegetIonValuegetTypeAnnotationsintValueisNullValuelongValuenewBytesstringValuetimestampValue

Field Detail

_catalogback to summary
pack-priv IonCatalog _catalog
_lstFactoryback to summary
private final _Private_LocalSymbolTableFactory _lstFactory
_physical_start_offsetback to summary
private final int _physical_start_offset

This is the physical start-of-stream offset when this reader was created. It must be subtracted from the logical offsets exposed by OffsetSpans.

_symbol_table_stackback to summary
private SymbolTable[] _symbol_table_stack
_symbol_table_topback to summary
private int _symbol_table_top
_symbolsback to summary
pack-priv SymbolTable _symbols
ION_VERSION_MARKER_REGEXback to summary
private static final Pattern ION_VERSION_MARKER_REGEX

Constructor Detail

IonReaderTextUserXback to summary
protected IonReaderTextUserX(IonCatalog catalog, _Private_LocalSymbolTableFactory lstFactory, UnifiedInputStreamX uis, int physicalStartOffset)
IonReaderTextUserXback to summary
protected IonReaderTextUserX(IonCatalog catalog, _Private_LocalSymbolTableFactory lstFactory, UnifiedInputStreamX uis)

Method Detail

asFacetback to summary
public <T> T asFacet(Class<T> facetType)

Overrides com.amazon.ion.impl.IonReaderTextRawX.asFacet.

Implements com.amazon.ion.facet.Faceted.asFacet.

Doc from com.amazon.ion.facet.Faceted.asFacet.

Returns a facet of this subject if supported.

Parameters
<T>
The requested facet type.
facetType:Class<T>

The type token of the requested facet type.

Returns:T

Doc from com.amazon.ion.impl.IonReaderTextRawX.asFacet.

This implementation always returns null.

Annotations
@Override
clear_system_value_stackback to summary
private void clear_system_value_stack()
currentSpanImplback to summary
public Span currentSpanImpl()
getFieldNameSymbolback to summary
public final SymbolToken getFieldNameSymbol()

Overrides com.amazon.ion.impl.IonReaderTextSystemX.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
getSymbolTableback to summary
public SymbolTable getSymbolTable()

Overrides com.amazon.ion.impl.IonReaderTextSystemX.getSymbolTable.

Implements com.amazon.ion.IonReader.getSymbolTable.

Doc from com.amazon.ion.impl.IonReaderTextSystemX.getSymbolTable.

Horrible temporary hack.

Returns:SymbolTable

not null.

Annotations
@Override
getTypeAnnotationSymbolsback to summary
public SymbolToken[] getTypeAnnotationSymbols()

Overrides com.amazon.ion.impl.IonReaderTextSystemX.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.

Annotations
@Override
has_next_user_valueback to summary
private final boolean has_next_user_value()
hasNextback to summary
public boolean hasNext()

Overrides com.amazon.ion.impl.IonReaderTextRawX.hasNext.

Implements com.amazon.ion.IonReader.hasNext.

this looks forward to see if there is an upcoming value and if there is it returns true. It may have to clean up any value that's partially complete (for example a collection whose annotation has been read and loaded but the use has chosen not to step into the collection). The user reader variant of hasNext also looks for system values to process. System values are the Ion version marker ($ion_1_0) and local symbol tables. If either of these is encountered the symbol table processing will be handled and the value will be "skipped".

Returns:boolean

true if more data remains, false on eof

Annotations
@Override
hoistImplback to summary
private void hoistImpl(Span span)
isIonVersionMarkerback to summary
private static boolean isIonVersionMarker(String text)
pop_passed_symbol_tableback to summary
public SymbolTable pop_passed_symbol_table()

Overrides com.amazon.ion.impl.IonReaderTextSystemX.pop_passed_symbol_table.

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

Annotations
@Override
push_symbol_tableback to summary
private void push_symbol_table(SymbolTable symbols)
symbol_table_resetback to summary
private final void symbol_table_reset()
symbolValueback to summary
public final SymbolToken symbolValue()

Overrides com.amazon.ion.impl.IonReaderTextSystemX.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()

Annotations
@Override
validateSymbolTokenback to summary
private void validateSymbolToken(SymbolToken symbol)
com.amazon.ion.impl back to summary

private final Class IonReaderTextUserX.IonReaderTextSpan

extends DowncastingFaceted
implements Span, TextSpan, OffsetSpan
Class Inheritance
All Implemented Interfaces
com.amazon.ion.OffsetSpan, com.amazon.ion.TextSpan, com.amazon.ion.Span, com.amazon.ion.facet.Faceted

Field Summary

Modifier and TypeField and Description
private final IonType
private final UnifiedDataPageX
private final long
private final long
private final long

Constructor Summary

AccessConstructor and Description
pack-priv
IonReaderTextSpan(IonReaderTextUserX reader)
References Deprecated IonReaderTextUserX is deprecated or references (maybe indirectly) at least one deprecated element.

Method Summary

Modifier and TypeMethod and Description
pack-priv IonType
pack-priv UnifiedDataPageX
public long
getFinishColumn()

Implements com.amazon.ion.TextSpan.getFinishColumn.

Returns the column number of this span's finish position, counting from one.

public long
getFinishLine()

Implements com.amazon.ion.TextSpan.getFinishLine.

Returns the line number of this span's finish position, counting from one.

public long
getFinishOffset()

Implements com.amazon.ion.OffsetSpan.getFinishOffset.

Returns this span's finish position as a zero-based offset within the source.

public long
getStartColumn()

Implements com.amazon.ion.TextSpan.getStartColumn.

Returns the column number of this span's start position, counting from one.

public long
getStartLine()

Implements com.amazon.ion.TextSpan.getStartLine.

Returns the line number of this span's start position, counting from one.

public long
getStartOffset()

Implements com.amazon.ion.OffsetSpan.getStartOffset.

Returns this span's start position as a zero-based offset within the source.

Inherited from com.amazon.ion.impl.DowncastingFaceted:
asFacet

Field Detail

_container_typeback to summary
private final IonType _container_type
_data_pageback to summary
private final UnifiedDataPageX _data_page
_start_columnback to summary
private final long _start_column
_start_lineback to summary
private final long _start_line
_start_offsetback to summary
private final long _start_offset

Constructor Detail

IonReaderTextSpanback to summary
pack-priv IonReaderTextSpan(IonReaderTextUserX reader)

References Deprecated

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

See corresponding docs for further information.

Method Detail

getContainerTypeback to summary
pack-priv IonType getContainerType()
getDataPageback to summary
pack-priv UnifiedDataPageX getDataPage()
getFinishColumnback to summary
public long getFinishColumn()

Implements com.amazon.ion.TextSpan.getFinishColumn.

Doc from com.amazon.ion.TextSpan.getFinishColumn.

Returns the column number of this span's finish position, counting from one. In most cases, the finish position is implicit and this method returns -1. That's since in general (notably for containers) the finish offset can't be determined without significant effort to parse to the end of the value.

getFinishLineback to summary
public long getFinishLine()

Implements com.amazon.ion.TextSpan.getFinishLine.

Doc from com.amazon.ion.TextSpan.getFinishLine.

Returns the line number of this span's finish position, counting from one. In most cases, the finish position is implicit and this method returns -1. That's since in general (notably for containers) the finish offset can't be determined without significant effort to parse to the end of the value.

getFinishOffsetback to summary
public long getFinishOffset()

Implements com.amazon.ion.OffsetSpan.getFinishOffset.

Doc from com.amazon.ion.OffsetSpan.getFinishOffset.

Returns this span's finish position as a zero-based offset within the source. In some cases, the finish position is implicit and this method returns -1. This includes most text sources, since in general (notably for containers) the finish offset can't be determined without significant effort to parse to the end of the value.

getStartColumnback to summary
public long getStartColumn()

Implements com.amazon.ion.TextSpan.getStartColumn.

Doc from com.amazon.ion.TextSpan.getStartColumn.

Returns the column number of this span's start position, counting from one.

getStartLineback to summary
public long getStartLine()

Implements com.amazon.ion.TextSpan.getStartLine.

Doc from com.amazon.ion.TextSpan.getStartLine.

Returns the line number of this span's start position, counting from one.

getStartOffsetback to summary
public long getStartOffset()

Implements com.amazon.ion.OffsetSpan.getStartOffset.

Doc from com.amazon.ion.OffsetSpan.getStartOffset.

Returns this span's start position as a zero-based offset within the source.

com.amazon.ion.impl back to summary

private final Class IonReaderTextUserX.SeekableReaderFacet

extends SpanProviderFacet
implements SeekableReader
Class Inheritance
All Implemented Interfaces
com.amazon.ion.SeekableReader, com.amazon.ion.SpanProvider

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
hoist(Span span)

Implements com.amazon.ion.SeekableReader.hoist.

Seeks this reader to produce the given span as if its values were at top-level.

Inherited from com.amazon.ion.impl.IonReaderTextUserX.SpanProviderFacet:
currentSpan

Constructor Detail

SeekableReaderFacetback to summary
private SeekableReaderFacet()

Method Detail

hoistback to summary
public void hoist(Span span)

Implements com.amazon.ion.SeekableReader.hoist.

Doc from com.amazon.ion.SeekableReader.hoist.

Seeks this reader to produce the given span as if its values were at top-level. The caller cannot stepOut from the span nor continue reading beyond it.

After calling this method, this reader's current span will be empty and positioned just before the first value of the given span; the caller must call next() to begin reading values. At the end of the span, the reader will behave as if it's at EOF regardless whether the source has more data beyond the span.

Hoisting makes the span's values appear to be at top-level even if they have containers in the source. The depth will be zero, and calls to getFieldName() will return null even if the span's original parent was a struct.

com.amazon.ion.impl back to summary

private Class IonReaderTextUserX.SpanProviderFacet

extends Object
implements SpanProvider
Class Inheritance
All Implemented Interfaces
com.amazon.ion.SpanProvider
Known Direct Subclasses
com.amazon.ion.impl.IonReaderTextUserX.SeekableReaderFacet

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Span
currentSpan()

Implements com.amazon.ion.SpanProvider.currentSpan.

Gets the current span of this object, generally covering a single value on the source.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SpanProviderFacetback to summary
private SpanProviderFacet()

Method Detail

currentSpanback to summary
public Span currentSpan()

Implements com.amazon.ion.SpanProvider.currentSpan.

Doc from com.amazon.ion.SpanProvider.currentSpan.

Gets the current span of this object, generally covering a single value on the source.