@PublicEvolving public final class TokenDefinition extends Object implements Serializable
TokenDefinition class represents a definition of token as specified
by the user while defining a directive usage. All definitions of a token are represented
by a instance of this class.
The definition are constant (immutable) and they cannot be changed once defined.
For example :
TokenDefinition token = new TokenDefintion("column", TokenType.COLUMN_NAME, null, 0, Optional.FALSE);
The class TokenDefinition includes methods for retrieveing different members of
like name of the token, type of the token, label associated with token, whether it's optional or not
and the ordinal number of the token in the TokenGroup.
As this class is immutable, the constructor requires all the member variables to be presnted for an instance of this object to be created.
| Constructor and Description |
|---|
TokenDefinition(String name,
TokenType type,
String label,
int ordinal,
boolean optional) |
| Modifier and Type | Method and Description |
|---|---|
String |
label() |
String |
name() |
boolean |
optional() |
int |
ordinal() |
TokenType |
type() |
public String label()
TokenDefinition. If a label is not provided, then this return null.public int ordinal()
TokenDefinition within
the TokenGroup,public boolean optional()
TokenDefinition is optional, false otherwise.public String name()
TokenDefinitionpublic TokenType type()
TokenDefinition.Copyright © 2023 CDAP Licensed under the Apache License, Version 2.0.