Top Fields Constructors Methods
com.amazon.ion.impl.lite

pack-priv final Class IonSymbolLite

extends IonTextLite
implements _Private_IonSymbol
Class Inheritance
All Implemented Interfaces
com.amazon.ion.impl._Private_IonSymbol, com.amazon.ion.IonSymbol, com.amazon.ion.IonText, com.amazon.ion.IonValue, java.lang.Cloneable
Static Imports
com.amazon.ion.SymbolTable.UNKNOWN_SYMBOL_ID, .SystemSymbols.ION_1_0, .SystemSymbols.ION_1_0_SID

Field Summary

Modifier and TypeField and Description
private int
private static final int
Inherited from com.amazon.ion.impl.lite.IonTextLite:
_text_value

Constructor Summary

AccessConstructor and Description
pack-priv
IonSymbolLite(ContainerlessContext context, boolean
if true, constructs a null.symbol value.
isNull
)

pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
private String

Returns:

null if symbol text is unknown.
_stringValue
()

Get's the text of this NON-NULL symbol, finding it from our symbol table if it's not yet known (and caching the result if possible).

private String
public void
accept(ValueVisitor
will have one of its visit methods called.
visitor
)

Implements abstract com.amazon.ion.impl.lite.IonValueLite.accept.

Implements com.amazon.ion.IonValue.accept.

Entry point for visitor pattern.

pack-priv boolean
attemptClearSymbolIDValues()

Overrides com.amazon.ion.impl.lite.IonValueLite.attemptClearSymbolIDValues.

Sets this value's symbol table to null, and erases any SIDs here and recursively.

public IonSymbolLite
clone()

Implements abstract com.amazon.ion.impl.lite.IonTextLite.clone.

Implements com.amazon.ion.IonSymbol.clone, com.amazon.ion.IonText.clone, com.amazon.ion.IonValue.clone.

Creates a copy of this value and all of its children.

public int
getSymbolId()

Implements com.amazon.ion.IonSymbol.getSymbolId.

Deprecated

Gets the integer symbol id used in the binary encoding of this symbol.

private int
public IonType
pack-priv int
protected boolean
pack-priv int
scalarHashCode()

Implements abstract com.amazon.ion.impl.lite.IonValueLite.scalarHashCode.

Internal HashCode implementation to be overridden by scalar subclasses.

protected void
setIsIonVersionMarker(boolean isIVM)

private void
setSID(int sid)

public void
setValue(String
the new value of this symbol; may be null to make this null.symbol.
value
)

Overrides com.amazon.ion.impl.lite.IonTextLite.setValue.

Implements com.amazon.ion.IonSymbol.setValue, com.amazon.ion.IonText.setValue.

Changes the value of this element.

pack-priv IonValueLite
shallowClone(IonContext
the context applicable to the value's parent.
context
)

Implements abstract com.amazon.ion.impl.lite.IonValueLite.shallowClone.

Clones the value's annotations and field name (if any).

public String
private String
public SymbolToken
symbolValue()

Implements com.amazon.ion.IonSymbol.symbolValue.

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

public SymbolToken
symbolValue(_Private_IonValue.SymbolTableProvider
- provides this IonSymbol's symbol table
symbolTableProvider
)

Implements com.amazon.ion.impl._Private_IonSymbol.symbolValue.

Overrides IonSymbol#symbolValue() for use when there exists a SymbolTableProvider implementation for this IonSymbol.

pack-priv final void
writeBodyTo(IonWriter
an IonWriter.
writer
,
_Private_IonValue.SymbolTableProvider
a SymbolTableProvider.
symbolTableProvider
)

Implements abstract com.amazon.ion.impl.lite.IonValueLite.writeBodyTo.

Writes a *non-null scalar* value to the given writer.

Inherited from com.amazon.ion.impl.lite.IonTextLite:
_get_value_set_value

Field Detail

_sidback to summary
private int _sid
HASH_SIGNATUREback to summary
private static final int HASH_SIGNATURE

Constructor Detail

IonSymbolLiteback to summary
pack-priv IonSymbolLite(ContainerlessContext context, boolean isNull)
Parameters
isNull:boolean

if true, constructs a null.symbol value.

IonSymbolLiteback to summary
pack-priv IonSymbolLite(IonSymbolLite existing, IonContext context) throws UnknownSymbolException
IonSymbolLiteback to summary
pack-priv IonSymbolLite(ContainerlessContext context, SymbolToken sym)

Method Detail

_stringValueback to summary
private String _stringValue()

Get's the text of this NON-NULL symbol, finding it from our symbol table if it's not yet known (and caching the result if possible).

Caller must check isNullValue()

Returns:String

null if symbol text is unknown.

_stringValueback to summary
private String _stringValue(_Private_IonValue.SymbolTableProvider symbolTableProvider)
acceptback to summary
public void accept(ValueVisitor visitor) throws Exception

Implements abstract com.amazon.ion.impl.lite.IonValueLite.accept.

Implements com.amazon.ion.IonValue.accept.

Doc from com.amazon.ion.IonValue.accept.

Entry point for visitor pattern. Implementations of this method by concrete classes will simply call the appropriate visit method on the visitor. For example, instances of IonBool will invoke ValueVisitor#visit(IonBool).

Parameters
visitor:ValueVisitor

will have one of its visit methods called.

Annotations
@Override
Exceptions
Exception:
any exception thrown by the visitor is propagated.
attemptClearSymbolIDValuesback to summary
pack-priv boolean attemptClearSymbolIDValues()

Overrides com.amazon.ion.impl.lite.IonValueLite.attemptClearSymbolIDValues.

Doc from com.amazon.ion.impl.lite.IonValueLite.attemptClearSymbolIDValues.

Sets this value's symbol table to null, and erases any SIDs here and recursively.

Returns:boolean

true if all SID's have been successfully removed, otherwise false

Annotations
@Override
cloneback to summary
public IonSymbolLite clone() throws UnknownSymbolException

Implements abstract com.amazon.ion.impl.lite.IonTextLite.clone.

Implements com.amazon.ion.IonSymbol.clone, com.amazon.ion.IonText.clone, com.amazon.ion.IonValue.clone.

Doc from com.amazon.ion.IonValue.clone.

Creates a copy of this value and all of its children. The cloned value may use the same shared symbol tables, but it will have an independent local symbol table if necessary. The cloned value will be modifiable regardless of whether this instance isReadOnly().

The cloned value will be created in the context of the same ValueFactory as this instance; if you want a copy using a different factory, then use ValueFactory#clone(IonValue) instead.

Returns:IonSymbolLite

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
Exceptions
UnknownSymbolException:
if any part of this value has unknown text but known Sid for its field name, annotation or symbol.
getSymbolIdback to summary
public int getSymbolId() throws NullValueException

Implements com.amazon.ion.IonSymbol.getSymbolId.

Doc from com.amazon.ion.IonSymbol.getSymbolId.

Deprecated

Gets the integer symbol id used in the binary encoding of this symbol.

Returns:int

an integer greater than zero, if this value has an associated symbol table. Otherwise, return SymbolTable#UNKNOWN_SYMBOL_ID.

Annotations
@Deprecated
Exceptions
NullValueException:
if this is null.symbol.
getSymbolIdback to summary
private int getSymbolId(_Private_IonValue.SymbolTableProvider symbolTableProvider) throws NullValueException
getTypeSlowback to summary
public IonType getTypeSlow()

Implements abstract com.amazon.ion.impl.lite.IonValueLite.getTypeSlow.

Returns:IonType

Doc from com.amazon.ion.impl.lite.IonValueLite.getTypeSlow.

the value's type.

Annotations
@Override
hashSignatureback to summary
pack-priv int hashSignature()

Implements abstract com.amazon.ion.impl.lite.IonValueLite.hashSignature.

Returns:int

Doc from com.amazon.ion.impl.lite.IonValueLite.hashSignature.

the constant hash signature unique to the value's type.

Annotations
@Override
isIonVersionMarkerback to summary
protected boolean isIonVersionMarker()
scalarHashCodeback to summary
pack-priv int scalarHashCode()

Implements abstract com.amazon.ion.impl.lite.IonValueLite.scalarHashCode.

Doc from com.amazon.ion.impl.lite.IonValueLite.scalarHashCode.

Internal HashCode implementation to be overridden by scalar subclasses. Must only be called on non-null values.

Annotations
@Override
setIsIonVersionMarkerback to summary
protected void setIsIonVersionMarker(boolean isIVM)
setSIDback to summary
private void setSID(int sid)
setValueback to summary
public void setValue(String value)

Overrides com.amazon.ion.impl.lite.IonTextLite.setValue.

Implements com.amazon.ion.IonSymbol.setValue, com.amazon.ion.IonText.setValue.

Doc from com.amazon.ion.IonSymbol.setValue.

Changes the value of this element.

Parameters
value:String

the new value of this symbol; may be null to make this null.symbol.

Annotations
@Override
shallowCloneback to summary
pack-priv IonValueLite shallowClone(IonContext context)

Implements abstract com.amazon.ion.impl.lite.IonValueLite.shallowClone.

Doc from com.amazon.ion.impl.lite.IonValueLite.shallowClone.

Clones the value's annotations and field name (if any). For scalars, also clones the value. For containers, leaves the cloned container empty rather than cloning the children.

Parameters
context:IonContext

the context applicable to the value's parent.

Returns:IonValueLite

a shallow clone of this value.

Annotations
@Override
stringValueback to summary
public String stringValue() throws UnknownSymbolException

Overrides com.amazon.ion.impl.lite.IonTextLite.stringValue.

Implements com.amazon.ion.IonSymbol.stringValue, com.amazon.ion.IonText.stringValue.

Doc from com.amazon.ion.IonSymbol.stringValue.

Gets the text content of this symbol.

Returns:String

the text of the symbol, or null if this is null.symbol.

Annotations
@Override
Exceptions
UnknownSymbolException:
if this symbol has unknown text.
stringValueback to summary
private String stringValue(_Private_IonValue.SymbolTableProvider symbolTableProvider) throws UnknownSymbolException
symbolValueback to summary
public SymbolToken symbolValue()

Implements com.amazon.ion.IonSymbol.symbolValue.

Doc from com.amazon.ion.IonSymbol.symbolValue.

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

Returns:SymbolToken

null if isNullValue()

symbolValueback to summary
public SymbolToken symbolValue(_Private_IonValue.SymbolTableProvider symbolTableProvider)

Implements com.amazon.ion.impl._Private_IonSymbol.symbolValue.

Doc from com.amazon.ion.impl._Private_IonSymbol.symbolValue.

Overrides IonSymbol#symbolValue() for use when there exists a SymbolTableProvider implementation for this IonSymbol.

Parameters
symbolTableProvider:_Private_IonValue.SymbolTableProvider

- provides this IonSymbol's symbol table

Returns:SymbolToken

a SymbolToken representing this IonSymbol

writeBodyToback to summary
pack-priv final void writeBodyTo(IonWriter writer, _Private_IonValue.SymbolTableProvider symbolTableProvider) throws IOException

Implements abstract com.amazon.ion.impl.lite.IonValueLite.writeBodyTo.

Doc from com.amazon.ion.impl.lite.IonValueLite.writeBodyTo.

Writes a *non-null scalar* value to the given writer. It is incorrect to call this method on a container value.

Parameters
writer:IonWriter

an IonWriter.

symbolTableProvider:_Private_IonValue.SymbolTableProvider

a SymbolTableProvider.

Annotations
@Override
Exceptions
IOException:
if thrown when writing the value.