Package com.libdbm.cel
Interface Functions
public interface Functions
Abstract interface for providing functions to CEL expressions.
Implement this interface to provide custom functions that can be called from CEL expressions.
The StandardFunctions class provides all standard CEL functions and can be extended for
custom functionality.
Example:
class MyFunctions extends StandardFunctions {
@Override
public Object call(final String name, final List<Object> args) {
if (name.equals("customFunc")) {
return myCustomImplementation(args);
}
return super.call(name, args);
}
}
-
Method Summary
-
Method Details
-
callFunction
Calls a global function by name.- Parameters:
name- The name of the function to call.args- The arguments to pass to the function.- Returns:
- The result of the function call.
- Throws:
IllegalArgumentException- if the function is not found or if the arguments are invalid.
-
callMethod
Calls a method on a target object.- Parameters:
target- The object to call the method on.method- The name of the method to call.args- The arguments to pass to the method.- Returns:
- The result of the method call.
- Throws:
IllegalArgumentException- if the method is not found or if the arguments are invalid.
-