| Syntax |
|
| Documentation | $java.invoke: Invoke a method of a java object or a class. If parameter 1 is an object the objects virtual or static methods can be invoked. Is it a class name then only static methods can be invoked. The invoked methods need to be public accessible. The second parameter describes the method to be called. In most cases the method name is sufficient. If the method name alone is ambigious or if the argument(s) need to be casted the parameter signature may be added in normal brackets.
|
| Examples | |
Information about a class$set{class}{java.math.BigDecimal} Constructors:$java.getConstructors{$get{class}}
Methods: $java.getMethods{$get{class}}
Fields: $java.getFields{$get{class}}
Field (separatorChar): $java.getField{$get{class}}{ROUND_DOWN} Initializing and using an object$set{o}{$java.new{java.math.BigDecimal(java.lang.String)}{10}} Class: $java.getClass{$get{o}}Invoke: $set{r}{$java.invoke{$get{o}}{equals(java.math.BigDecimal)}{10}} $// cast 10 to new BigDecimal $java.invoke{$get{r}}{toString} Print float value: $java.invoke{$get{o}}{floatValue} Add to itself: $java.invoke{$get{o}}{add}{$get{o}} $// no need to give param types 'cause we neither need a cast nor is it unclear which function is meant |
|
| Group | Special |
| Minimum required transaction-mode: | NONE |
| Required scripting permission of the developer | PERMISSION_FL_EXPERT |
| Minimum parameters | 2 |
| Maximum parameters | <unlimited> |