Class DefaultFunctionProvider
- java.lang.Object
-
- org.vedantatree.expressionoasis.extensions.DefaultFunctionProvider
-
- All Implemented Interfaces:
FunctionProvider
- Direct Known Subclasses:
CustomFunctionProvider
public class DefaultFunctionProvider extends Object implements FunctionProvider
This is the default function provider.
-
-
Constructor Summary
Constructors Constructor Description DefaultFunctionProvider(Class functionProviderClass)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Type
getFunctionType(String functionName, Type[] parameterTypes)
Gets the return type of the function.ValueObject
getFunctionValue(String functionName, ValueObject[] parameters)
Gets the return value of function.void
initialize(ExpressionContext expressionContext)
Initializes the method map.boolean
supportsFunction(String functionName, Type[] parameterTypes)
Checks whether the this function provider supports any function or not.
-
-
-
Constructor Detail
-
DefaultFunctionProvider
public DefaultFunctionProvider(Class functionProviderClass) throws ExpressionEngineException
Constructor.- Parameters:
functionProviderClass
-- Throws:
ExpressionEngineException
-
-
Method Detail
-
getFunctionType
public Type getFunctionType(String functionName, Type[] parameterTypes) throws ExpressionEngineException
Description copied from interface:FunctionProvider
Gets the return type of the function.- Specified by:
getFunctionType
in interfaceFunctionProvider
- Parameters:
functionName
- the name of the function.parameterTypes
- the types of the parameters- Returns:
- the return type of the function
- Throws:
ExpressionEngineException
- if anything goes wrong- See Also:
FunctionProvider.getFunctionType(java.lang.String, org.vedantatree.types.Type[])
-
getFunctionValue
public ValueObject getFunctionValue(String functionName, ValueObject[] parameters) throws ExpressionEngineException
Description copied from interface:FunctionProvider
Gets the return value of function.- Specified by:
getFunctionValue
in interfaceFunctionProvider
- Parameters:
functionName
- the name of the functionparameters
- the parameters values of the function- Returns:
- the return value of the function
- Throws:
ExpressionEngineException
- if anything goes wrong- See Also:
FunctionProvider.getFunctionValue(java.lang.String, org.vedantatree.types.ValueObject[])
-
supportsFunction
public boolean supportsFunction(String functionName, Type[] parameterTypes) throws ExpressionEngineException
Description copied from interface:FunctionProvider
Checks whether the this function provider supports any function or not.- Specified by:
supportsFunction
in interfaceFunctionProvider
- Parameters:
functionName
- the name of the functionparameterTypes
- the type of parameters for the function- Returns:
true
if function provider supports the functionfalse
otherwise- Throws:
ExpressionEngineException
- if anything goes wrong- See Also:
FunctionProvider.supportsFunction(java.lang.String, org.vedantatree.types.Type[])
-
initialize
public void initialize(ExpressionContext expressionContext) throws ExpressionEngineException
Initializes the method map.- Specified by:
initialize
in interfaceFunctionProvider
- Parameters:
expressionContext
- Context of current expression evaluation process- Throws:
ExpressionEngineException
-
-