public class JavaMethodExpression extends java.lang.Object implements Expression
Modifier and Type | Class and Description |
---|---|
static class |
JavaMethodExpression.MethodDescriptor |
Constructor and Description |
---|
JavaMethodExpression(JavaMethodExpression.MethodDescriptor descriptor) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
describe(Value value,
Value... args)
Describe this expression in a human-readable way.
|
java.util.Optional<Value> |
evaluate(Value value,
Value... args)
Evaluates the given expression for the given value and the array of arguments.
|
static java.util.Optional<JavaMethodExpression.MethodDescriptor> |
getMethodByName(Value value,
java.lang.String name,
java.lang.String jniSignature) |
static java.util.List<JavaMethodExpression.MethodDescriptor> |
getMethodsWithArguments(Value value) |
static java.util.List<JavaMethodExpression.MethodDescriptor> |
getMethodsWithoutArguments(Value value) |
void |
initialize(DrawingStepHandler stepHandler)
Initialize the given step handler.
|
int |
requiredArguments()
Returns the number of required arguments to evaluate this expression.
|
public JavaMethodExpression(JavaMethodExpression.MethodDescriptor descriptor)
public static java.util.Optional<JavaMethodExpression.MethodDescriptor> getMethodByName(Value value, java.lang.String name, java.lang.String jniSignature)
public static java.util.List<JavaMethodExpression.MethodDescriptor> getMethodsWithoutArguments(Value value)
public static java.util.List<JavaMethodExpression.MethodDescriptor> getMethodsWithArguments(Value value)
public int requiredArguments()
Expression
requiredArguments
in interface Expression
public java.util.Optional<Value> evaluate(Value value, Value... args)
Expression
Expression.requiredArguments()
for the number
of required arguments to be supplied.evaluate
in interface Expression
value
- The value to evaluate the expression for.args
- The array of arguments. There must be at least Expression.requiredArguments()
arguments
given. Additional arguments will be ignored.public java.lang.String describe(Value value, Value... args)
Expression
describe
in interface Expression
value
- The value which would be given to the Expression.evaluate(Value, Value...)
method.args
- The array of arguments which would be given to the Expression.evaluate(Value, Value...)
method.public void initialize(DrawingStepHandler stepHandler)
Expression
DSLUpdater
instance
used for updates to the blacklist, etc.initialize
in interface Expression
stepHandler
- The step handler to be initialized.