Print
Block WITH Operator

The block with operator is a powerful construct for acting on an object instance.

Example:

The code above is functionally equivalent to:

Nesting WITH

MVEL has support for deep graph hierarchies using 'with' and inline arrays, lists and maps:

To be able to use the 'with' keyword in nested structures and in such a way that it returns a value you must encase the keyword and it's following curly braces in parenthesis, i.e. ( with(...) {...} ).

The above deep graph assignment is the equivalent of:

Powered by Atlassian Confluence