Expression Languages in Marmalade
Introduction
Marmalade is not simply another scripting language to learn. If you know XML namespaces, and either the JSP expression language or OGNL expression language, you can use Marmalade. If you don't know either of these expression languages, you can implement your own flavor and use that. If you don't need dynamic expression evaluation, you don't have to include or use any expression language library - the default for marmalade-core is a dummy EL, which simply passes all data through unchanged.
It's your choice.
Choose Your EL
This is one way of choosing your expression language:
So is this:
Or this:
I hope this begins to show the flexibility of Marmalade.
Roll Your Own EL
Building your own EL flavor is simple, once you get the expression language engine figured out. As you've no doubt noticed, I took the easy way out on the first two EL implementations. Commons-EL drives the JSP-like expression language, and OGNL drives the OGNL syntax (big surprise). Once you have an expression language engine like this, it's a simple two-step process:
- Implement
org.codehaus.marmalade.el.ExpressionEvaluator - Create a file called
META-INF/marmalade/el/your-el-namewith the one-line contents consisting of the fully-qualified class name of yourExpressionEvaluatorimplementation.
