| Constructor and Description |
|---|
MapArguments(UsageDefinition definition,
TokenGroup group) |
| Modifier and Type | Method and Description |
|---|---|
int |
column()
Returns the source column number these arguments were parsed from.
|
boolean |
contains(String name)
This method checks if there exists a token named
name registered
with this object. |
int |
line()
Returns the source line number these arguments were parsed from.
|
int |
size()
Returns the number of tokens that are mapped to arguments.
|
String |
source()
This method returns the original source line of the directive as specified
the user.
|
com.google.gson.JsonElement |
toJson()
Returns
JsonElement representation of this object. |
TokenType |
type(String name)
Each token is defined as one of the types defined in the class
TokenType. |
<T extends Token> |
value(String name)
This method returns the token
value based on the name
specified in the argument. |
public MapArguments(UsageDefinition definition, TokenGroup group) throws DirectiveParseException
DirectiveParseExceptionpublic int size()
The optional arguments specified during the UsageDefinition
are not included in the size if they are not present in the tokens parsed.
public boolean contains(String name)
name registered
with this object.
The name is expected to the same as specified in the UsageDefinition.
There are two reason why the name might not exists in this object :
name.public <T extends Token> T value(String name)
value based on the name
specified in the argument. This method will attempt to convert the token
into the expected return type T.
If the name doesn't exist in this object, then this
method is expected to return null
public TokenType type(String name)
TokenType.
When the directive is parsed into token, the type of the token is passed through.public int line()
public int column()
It takes the start position of the directive as the column number.
public String source()
String representation of the directive.Copyright © 2021 CDAP Licensed under the Apache License, Version 2.0.