Package org.apache.calcite.schema.impl
Class ReflectiveFunctionBase
- java.lang.Object
-
- org.apache.calcite.schema.impl.ReflectiveFunctionBase
-
- All Implemented Interfaces:
Function
- Direct Known Subclasses:
ReflectiveSchema.MethodTableMacro
,ScalarFunctionImpl
,TableFunctionImpl
,TableMacroImpl
public abstract class ReflectiveFunctionBase extends java.lang.Object implements Function
Implementation of a function that is based on a method. This class mainly solves conversion of method parameter types toList<FunctionParameter>
form.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReflectiveFunctionBase.ParameterListBuilder
Helps build lists ofFunctionParameter
.
-
Field Summary
Fields Modifier and Type Field Description java.lang.reflect.Method
method
Method that implements the function.java.util.List<FunctionParameter>
parameters
Types of parameter for the function call.
-
Constructor Summary
Constructors Constructor Description ReflectiveFunctionBase(java.lang.reflect.Method method)
ReflectiveFunctionBase
constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ReflectiveFunctionBase.ParameterListBuilder
builder()
Creates a ParameterListBuilder.(package private) static boolean
classHasPublicZeroArgsConstructor(java.lang.Class<?> clazz)
Verifies if given class has public constructor with zero arguments.(package private) static java.lang.reflect.Method
findMethod(java.lang.Class<?> clazz, java.lang.String name)
Finds a method in a given class by name.java.util.List<FunctionParameter>
getParameters()
Returns the parameters of this function.
-
-
-
Field Detail
-
method
public final java.lang.reflect.Method method
Method that implements the function.
-
parameters
public final java.util.List<FunctionParameter> parameters
Types of parameter for the function call.
-
-
Method Detail
-
getParameters
public java.util.List<FunctionParameter> getParameters()
Returns the parameters of this function.- Specified by:
getParameters
in interfaceFunction
- Returns:
- Parameters; never null
-
classHasPublicZeroArgsConstructor
static boolean classHasPublicZeroArgsConstructor(java.lang.Class<?> clazz)
Verifies if given class has public constructor with zero arguments.- Parameters:
clazz
- class to verify- Returns:
- true if given class has public constructor with zero arguments
-
findMethod
static java.lang.reflect.Method findMethod(java.lang.Class<?> clazz, java.lang.String name)
Finds a method in a given class by name.- Parameters:
clazz
- class to search method inname
- name of the method to find- Returns:
- the first method with matching name or null when no method found
-
builder
public static ReflectiveFunctionBase.ParameterListBuilder builder()
Creates a ParameterListBuilder.
-
-