| Modifier and Type | Field and Description |
|---|---|
static String |
TYPE
This defines a interface variable that is static and final for specify
the
type of the plugin this interface would provide. |
| Modifier and Type | Method and Description |
|---|---|
UsageDefinition |
define()
This method provides a way for the developer to provide information
about the arguments expected by this directive.
|
destroy, execute, initializestatic final String TYPE
type of the plugin this interface would provide.
This constant should be used when defining a plugin. An example of such usage is as follow:
UsageDefinition define()
This method uses UsageDefinition#Builder to build the token
definitions. Each token definition consists of name, TokenType
and optional field that specifies whether the token specified is
optionally present.
The UsageDefinition provides different methods to define,
and as well generate usage based on the definition.
This method is invoked by the framework at the time of creating an executable
directive that will be added to the RecipePipeline. It's generally during
the configuration phase.
NOTE: As best practice, developer needs to make sure that this class doesn't throw an exception. Also, it should not include external libraries that can generate exception unknown to the developer.
Following is an example of how define could be used.
public UsageDefinition define() {
UsageDefinition.Builder builder = UsageDefinition.builder();
builder.define("column", TokeType.COLUMN_NAME); // :column
builder.define("number", TokenType.NUMERIC, Optional.TRUE); // 1.0 or 8
builder.define("text", TokenType.TEXT); // 'text'
builder.define("boolean", TokenType.BOOL); // true / false
builder.define("expression", TokenType.EXPRESSOION); // exp: { age < 10.0 }
}
TokenType supports many different token types that can be used within the
usage definition.UsageDefinition containing definitions of each argument
expected by this directive.TokenTypeCopyright © 2023 CDAP Licensed under the Apache License, Version 2.0.