Executable Directive

Directives wrapped in <%% %%> reference a method.

The following shows an example of the format of an executable directive.

<%% method_name [parameter] %%>

The method with the specified name is executed with the expansion object as the receiver. The directive is replaced with the string representation of the result of executing the method.

The specified method must take exactly zero (0) parameters, or a single string parameter. If the method takes one parameter and no parameter is specified, null is passed.

If the method expects any other parameters, a runtime exception is raised.

All other directives are expanded before executable directives. The result of expanding a prior directive can therefore be passed as the parameter.

The following example calls the someMeth method on the expansion object and the String value of the foo property is passed as the parameter.

<%% someMeth <@@ foo @@> %%>