|
|||||
|
|||||
Useful Things |
Function Definition
MVEL allows the definition of native functions with either the Functions are defined in-order of declaration, and cannot be foreword referenced. The only exception to this is within functions themselves, it is possible to forward reference another function. A Simple ExampleDefining a Simple Function This defines a simple function called "hello" that accepts no parameters. When called it prints "Hello!" to the console. An MVEL-defined function works just like any regular method call, and resolution preference is to MVEL functions over base context methods. Accepting Parameters and Returning ValuesFunctions can be declared to accept parameters, and can return a single value. Consider the following example: This function will accept two parameters ( The ClosuresMVEL allows closures. However the functionality is not interoperable with native Java methods. See Also |
||||
|
Copyright 2003-2006 - The Codehaus. All rights reserved unless otherwise noted.
Powered by Atlassian Confluence
|
|||||