Skip navigation links
io.cdap.wrangler.api

Interface Directive

    • Field Summary

      Fields 
      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.
    • Field Detail

      • TYPE

        static final String TYPE
        This defines a interface variable that is static and final for specify the 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:

        See Also:
        Constant Field Values
    • Method Detail

      • define

        UsageDefinition define()
        This method provides a way for the developer to provide information about the arguments expected by this directive. The definition of arguments would provide information to the framework about how each argument should be parsed and interpretted.

        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.
        Returns:
        A object of UsageDefinition containing definitions of each argument expected by this directive.
        See Also:
        TokenType

Copyright © 2023 CDAP Licensed under the Apache License, Version 2.0.