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 TypegetFunctionType(String functionName, Type[] parameterTypes)Gets the return type of the function.ValueObjectgetFunctionValue(String functionName, ValueObject[] parameters)Gets the return value of function.voidinitialize(ExpressionContext expressionContext)Initializes the method map.booleansupportsFunction(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:FunctionProviderGets the return type of the function.- Specified by:
getFunctionTypein 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:FunctionProviderGets the return value of function.- Specified by:
getFunctionValuein 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:FunctionProviderChecks whether the this function provider supports any function or not.- Specified by:
supportsFunctionin interfaceFunctionProvider- Parameters:
functionName- the name of the functionparameterTypes- the type of parameters for the function- Returns:
trueif function provider supports the functionfalseotherwise- 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:
initializein interfaceFunctionProvider- Parameters:
expressionContext- Context of current expression evaluation process- Throws:
ExpressionEngineException
-
-