Top Description Fields Methods
com.amazon.ion

public Interface SymbolToken

Known Direct Subinterfaces
com.amazon.ion.impl._Private_SymbolToken

An Ion symbol token (field name, annotation, and symbol values) providing both the symbol text and the assigned symbol ID. Symbol tokens may be interned into a SymbolTable.

Any instance will have at least one of the two properties defined.

Warning

This interface should not be implemented or extended by code outside of this library.

Field Summary

Modifier and TypeField and Description
public static final SymbolToken[]
EMPTY_ARRAY

A zero-length array.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the text of the symbol, not null.
assumeText
()

Gets the text of this symbol, throwing an exception if its unknown.

public int

Returns:

the symbol ID (sid) of this symbol, or SymbolTable#UNKNOWN_SYMBOL_ID if the sid is unknown.
getSid
()

Gets the ID of this symbol token.

public String

Returns:

the text of this symbol, or null if the text is unknown.
getText
()

Gets the text of this symbol.

Field Detail

EMPTY_ARRAYback to summary
public static final SymbolToken[] EMPTY_ARRAY

A zero-length array.

Method Detail

assumeTextback to summary
public String assumeText()

Gets the text of this symbol, throwing an exception if its unknown.

Returns:String

the text of the symbol, not null.

Exceptions
UnknownSymbolException:
if the symbol text isn't known.
getSidback to summary
public int getSid()

Gets the ID of this symbol token.

If no ID has yet been assigned (as may be the case when processing Ion text-formatted data), this method returns SymbolTable#UNKNOWN_SYMBOL_ID. In such cases getText() will be non-null.

Returns:int

the symbol ID (sid) of this symbol, or SymbolTable#UNKNOWN_SYMBOL_ID if the sid is unknown.

getTextback to summary
public String getText()

Gets the text of this symbol.

If the text is not known (usually due to a shared symbol table being unavailable) then this method returns null. In such cases getSid() will be non-negative.

Returns:String

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