custom signature examples

This page demonstrates the use of custom signatures and the signature directive. See the source listing below. The next page has the listing of the BeanShell code itself.

examples of the signatures in use

hello world works! Notice the hello signature uses a BeanShell function defined in the file testsigs.bsh. version A

hello world works! version B

hello world WORKS! version C

goodbye world, it's been nice. The bye signature is defined by two lines of BeanShell code.

note

Note: an arbitrary number of lines of code may go in a signature block, but it must be a single block without children. So, if you are writing something large, put it in an external *.bsh file as a function defintion then use a signature directive like the hello signature above. There is some performance advantage to this as well.

source for Home/ByExample/BeanShell :: testSig.xil

custom signature examples

This page demonstrates the use of custom signatures and the @signature@
directive.  See the source listing below.  The "next page":${_Next_} has the
listing of the BeanShell code itself.

signature. helloA
helloWorldA()

signature. helloB
helloWorldB()

signature. helloC
helloWorldC()

signature. bye
tmp = task.markup("goodbye " + text);
sig.insertAttributes("<blockquote>") + tmp +"</blockquote>";

h2. examples of the signatures in use

helloA. works!  Notice the @hello@ signature uses a BeanShell function defined
in the file @testsigs.bsh@. 

helloB(myclass#myid)>. works!

helloC(myclass). works!

bye. world, it's been nice.  The @bye@ signature is defined by two lines of
BeanShell code.

h2. note

Note:  an arbitrary number of lines of code may go in a signature block, but it
must be a single block without children.  So, if you are writing something
large, put it in an external *.bsh file as a function defintion then use a
signature directive like the @hello@ signature above.  There is some performance
advantage to this as well.

Long lines are wrapped in this listing.
Use your web browser's "View Page Source" feature to examine the HTML