Package com.amazon.ion
Interface SymbolToken
-
- All Known Subinterfaces:
_Private_SymbolToken
public interface SymbolTokenAn 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 aSymbolTable.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
Fields Modifier and Type Field Description static SymbolToken[]EMPTY_ARRAYA zero-length array.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringassumeText()Gets the text of this symbol, throwing an exception if its unknown.intgetSid()Gets the ID of this symbol token.java.lang.StringgetText()Gets the text of this symbol.
-
-
-
Field Detail
-
EMPTY_ARRAY
static final SymbolToken[] EMPTY_ARRAY
A zero-length array.
-
-
Method Detail
-
getText
java.lang.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:
- the text of this symbol, or null if the text is unknown.
-
assumeText
java.lang.String assumeText()
Gets the text of this symbol, throwing an exception if its unknown.- Returns:
- the text of the symbol, not null.
- Throws:
UnknownSymbolException- if the symbol text isn't known.
-
getSid
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 casesgetText()will be non-null.- Returns:
- the symbol ID (sid) of this symbol, or
SymbolTable.UNKNOWN_SYMBOL_IDif the sid is unknown.
-
-