MVEL

MVEL

Infobox_Software
name = MVEL



caption =
developer = Mike Brock and Various Contributors
latest_release_version = 1.3.13
latest_release_date = release_date|2008|10|10
latest_preview_version = 2.0 Beta 1
latest_preview_date = release_date|2008|10|03
operating_system = Cross-platform
programming_language = Java
genre = Expression Language (EL)
license = Apache License
website = http://mvel.codehaus.org

MVFLEX Expression Language (MVEL) is a hybrid dynamic/statically typed, embedable Expression Language 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 expressions.

The runtime allows MVEL expressions to be executed either interpretively, or through a pre-compilation process with support for runtime bytecode 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-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. In this sense, MVEL is a completely functional language.

MVEL 2.0

The next version of MVEL 2.0, which is still in development stage supports more features, enabling it as a more full-fledged scripting language. Here is an example of the Quicksort algorithm implemented in MVEL 2.0

array = null;

def swap(i, j) { temp = array [i] ; array [i] = array [j] ; array [j] = temp;}

def partition(low, high) { pivotPoint = array [low] ;

i = low - 1; j = high + 1;

while (i < j) { i++; while (array [i] < pivotPoint) ++i; j--; while (array [j] > pivotPoint) --j; if (i < j) swap(i, j); }

j; //return j}

def sort(low, high) { if (low < high) { var p; sort(low, p = partition(low, high)); sort(p + 1, high);

def quicksort() { sort(0, array.length - 1);}

array = {50,20,21,209,10,77,8,9,55,73,41,99};

quicksort();

ee also

* Java
* OGNL
* Expression Language

Links

* [http://mvel.codehaus.org/Language+Guide MVEL Language Guide]


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • MVEL — Archivo:Mvel logo.png Desarrollador Mike Brock y varios colaboradores http://mvel.codehaus.org/ Información general …   Wikipedia Español

  • Drools — For the tendency of saliva to flow out of the mouth, see drooling. Drools Developer(s) Red Hat Stable release 5.3.0 / October 21, 2011; 30 days ago (2011 10 21) Written in …   Wikipedia

  • OGNL — File:OGNL logo.png Developer(s) OGNL Technology Stable release 2.7.2 / January 31, 2008; 3 years ago (2008 01 31) Written in …   Wikipedia

  • Expression Language — (EL) is a scripting language which allows access to Java components (JavaBeans) through JSP. Since JSP 2.0, it has been used inside JSP tags to separate Java code from JSP, and to allow easier access to Java components (than in Java… …   Wikipedia

  • Expression Language — (EL)  скриптовый язык выражений, который позволяет получить доступ к Java компонентам (JavaBeans) из JSP. Начиная с JSP 2.0 используется внутри JSP тегов для отделения Java кода от JSP для обеспечения лёгкого доступа к Java компонентам.… …   Википедия

  • OVal (Framework) — OVal Maintainer Sebastian Thomschke, Holger Riegel Aktuelle Version 1.70 (5. April 2011) Betriebssystem …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”