A method table is a Java method described within a table. The following is an example of a method table:
Figure 29: Method table
The first row is a table header, which has the following format:
<keyword> <return type> <method name and parameters>
where <keyword>
is either 'Method' or 'Code'.
The second row, and the following rows, is the actual code to be executed. It can reference parameters passed to the method and all Java objects and tables visible to the OpenL Tablets engine.
Method in the preceding example table can be called from Java code as follows:
ApprovalRulesWrapper tableWrapper = new ApprovalRulesWrapper();
System.out.println(tableWrapper.getGreeting("John"));