Examples
The following examples show how to invoke a method using the Perform
action. You should notice the following facts about these examples:
- In Example 1, the Perform action calls the update() method on
the variable $importedVar$. Notice that:
- The entire method call is enclosed in dollar signs ($).
- In the context of a method call, the variable name itself (importedVar) is not enclosed in dollar signs ($).
- A variable passed as a parameter to a method must be enclosed in dollar signs ($) as usual ($str$).
- A string passed as a parameter to a method must be enclosed in single quotes as usual ('Application').
- In Example 2, the Perform action calls a static method.
- In Example 3, the Perform action calls the close() method belonging to the class to which the variable belongs, such as java.io.FileInputStream.
- In Example 4, the Perform action calls the createZipEntry() method belonging to the class to which the variable belongs, such as java.util.zip.ZipInputStream.
- In Example 5, the Perform action calls the clear() method belonging to the class to which the variable belongs, such as java.util.Hashtable.
Figure 1. Examples of the Perform action
<actions>
<!-- Example 1 -->
<perform value="$importedVar.update( 5, 'Application', $str$)$" />
<!-- Example 2 -->
<perform value="$MyClass.myInit('all')$" />
<!-- Example 3 -->
<perform value="$fip.close()$" />
<!-- Example 4 -->
<perform value="$zis.createZipEntry( $name$ )$" />
<!-- Example 5 -->
<perform value="$ht.clear()$" />
</actions>