public interface TokenInfo extends Token, Snippetable
Token that contains details about location of token in source| Modifier and Type | Method and Description |
|---|---|
default boolean |
contentEquals(Token token)
Compare wrapped token with another token, utility method
|
Location |
getLocation()
Get location of token
|
default Optional<String> |
getName()
Get custom name of the token
|
Token |
getToken()
Get the wrapped token
|
default TokenType |
getType()
Get type of the token represented by
TokenType |
default String |
getValue()
Get value of the token
|
default boolean |
hasName()
Check if the token has custom name
|
default Snippet |
toSnippet()
Converts current object into the
Snippet |
default <T extends Token> |
toToken()
Get token using
getToken() method and cast it to the requested type |
default <T extends Token> |
toToken(Class<T> type)
Get token using
getToken() method and cast it to the requested type |
toStreamdefault boolean contentEquals(Token token)
token - the token to compare withToken getToken()
Location getLocation()
default <T extends Token> T toToken(Class<T> type)
getToken() method and cast it to the requested typeT - the type to casttype - the class typeClassCastExceptiondefault <T extends Token> T toToken()
getToken() method and cast it to the requested typeT - the type to castClassCastExceptiondefault Snippet toSnippet()
SnippetableSnippettoSnippet in interface Snippetabledefault boolean hasName()
Tokendefault Optional<String> getName()
TokenCopyright © 2020. All rights reserved.