Class FunctionMetadataValidator


  • public class FunctionMetadataValidator
    extends Object
    The validator encodes business logic with respect to what a valid function description is. These methods call each other from the most complex components (FunctionMethod) to the simplest pieces (function name). Certain users of the validator may only need to call lower level methods.
    • Field Detail

      • MAX_LENGTH

        public static final int MAX_LENGTH
        Maximum length for function names, parameter names, categories, and descriptions.
        See Also:
        Constant Field Values
    • Method Detail

      • validateFunctionMethod

        public static final void validateFunctionMethod​(FunctionMethod method,
                                                        ValidatorReport report,
                                                        Map<String,​Datatype> runtimeTypeMap)
        Determine whether a FunctionMethod is valid. The following items are validated:
        • Validate method name
        • Validate description
        • Validate category
        • Validate invocation method
        • Validate all input parameters
        • Validate output parameter
        Parameters:
        method - The method to validate
        report - The report to update during validation
      • validateFunctionParameter

        public static final void validateFunctionParameter​(FunctionParameter param)
                                                    throws FunctionMetadataException
        Determine whether a FunctionParameter is valid. The following items are validated:
        • Validate parameter name
        • Validate description
        • Validate type
        Parameters:
        param - The parameter to validate
        Throws:
        FunctionMetadataException - Thrown if function parameter is not valid in some way
      • validateName

        public static final void validateName​(String name)
                                       throws FunctionMetadataException
        Determine whether a function or parameter name is valid. The following items are validated:
        • Validate that name is not null
        • Validate that name has length <= MAX_LENGTH
        • Validate that name starts with alphabetic character
        • Validate that name contains only valid characters: letters, numbers, and _
        Parameters:
        name - Name to validate
        Throws:
        FunctionMetadataException - Thrown if function or parameter name is not valid in some way
      • validateDescription

        public static final void validateDescription​(String description)
                                              throws FunctionMetadataException
        Determine whether a description is valid. The following items are validated:
        • Validate that description (if not null) has length <= 4000
        Parameters:
        description - Description to validate
        Throws:
        FunctionMetadataException - Thrown if description is not valid in some way
      • validateCategory

        public static final void validateCategory​(String category)
                                           throws FunctionMetadataException
        Determine whether a category is valid. The following items are validated:
        • Validate that category is not null
        • Validate that category has length <= MAX_LENGTH
        Parameters:
        category - Category to validate
        Throws:
        FunctionMetadataException - Thrown if category is not valid in some way
      • validateInvocationMethod

        public static final void validateInvocationMethod​(String invocationClass,
                                                          String invocationMethod,
                                                          FunctionMethod.PushDown pushdown)
                                                   throws FunctionMetadataException
        Determine whether an invocation class and method are valid. The following items are validated:
        • Validate that invocation class is not null
        • Validate that invocation method is not null
        • Validate that class is valid Java class name
        • Validate that method is valid Java method name
        Parameters:
        invocationClass - Invocation class to validate
        invocationMethod - Invocation method to validate
        Throws:
        FunctionMetadataException - Thrown if invocation method is not valid in some way