HOME

TheInfoList



OR:

MVFLEX Expression Language (MVEL) is a hybrid dynamic/statically typed, embeddable
Expression Language An expression language is a language for creating a computer-interpretable representation of specific knowledge and may refer to: *Advanced Boolean Expression Language, an obsolete hardware description language for hardware descriptions * Data Ana ...
and runtime for the Java Platform. Originally started as a utility language for an application framework, the project is now developed completely independently. MVEL is typically used for exposing basic logic to end-users and programmers through configuration such as XML files or annotations. It may also be used to parse simple
JavaBean In computing based on the Java Platform, JavaBeans is a technology developed by Sun Microsystems and released in 1996, as part of JDK 1.1. The 'beans' of JavaBeans are classes that encapsulate one or more objects into a single standardized objec ...
expressions. The runtime allows MVEL expressions to be executed either interpretively, or through a pre-compilation process with support for runtime
bytecode Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (norma ...
generation to remove overhead. Since MVEL is meant to augment Java-based software, it borrows most of its syntax directly from the Java programming language with some minor differences and additional capabilities. For example: as a side effect of MVEL's typing model, which treats class and method references as regular variables, it is possible to use both class and function pointers (but only for static methods). millis = System.currentTimeMillis; // get millis time = millis(); MVEL also allows collections to be represented as folds (or projections) in a
Lisp A lisp is a speech impairment in which a person misarticulates sibilants (, , , , , , , ). These misarticulations often result in unclear speech. Types * A frontal lisp occurs when the tongue is placed anterior to the target. Interdental lisping ...
-like syntax. namesOfParents = (parent.name in (children in employees));


Hello world example

System.out.println("Hello, world!"); MVEL relies on Java namespaces and classes, but does not possess the ability to declare namespaces or classes.


Quicksort Example

Here is an example of the Quicksort algorithm implemented in MVEL 2.0, demonstrating the scripting capabilities of the language. import java.util.*; // the main quicksort algorithm def quicksort(list) // define method to concatenate lists. def concat(list1, pivot, list2) // create a list to sort list =
,2,4,1,18,10,15,1,0 The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
// sort it! quicksort(list);


See also

* Java * OGNL *
Expression Language An expression language is a language for creating a computer-interpretable representation of specific knowledge and may refer to: *Advanced Boolean Expression Language, an obsolete hardware description language for hardware descriptions * Data Ana ...


External links


MVEL Language Guide

original website
(not available any more) Scripting languages Free software programmed in Java (programming language) {{Prog-lang-stub