Author: Timo Laitinen
Date: 2004-10-02
Contents
The JIC attributes 'action' and 'instance' accept Limited Java Expressions.. LJE expressions exists, because:
- The method or constructor to be invoked was best expressed with a Java-expression. Some kind of reflection-based Java-code-parser was needed.
- However, JICE is not intended to be a Java scripting engine. The JIC-files must not contain too complex Java-code fragments - the actual code belongs to the Java classes, not into JIC files.
- Parsing of any expression is faster if the parser knows that only a few simple expressions can be used.
Therefore JICE supports only a very limited set of Java expressions. That is enough and more is not needed.
A LJE expression can be:
- an atom
- a boolean:
true
orfalse
- a String, enclosed within single quotes:
'Hello World'
- a number:
- an int:
12344
- a double:
123.44
(or123.44d
) - a long:
12344l
(or12344L
) - a float:
123.44f
(or123.44F
)
- an int:
- a variable:
myVariable1
,yourVariable2
, etc.
- a boolean:
- a 'new' operation:
new full.package.name.ClassName(parameters)
, where parameters is a comma-separated list of atoms. - a method call
- a static method call:
full.package.name.ClassName.methodName(parameters)
, where parameters is a comma-separated list of atoms.-
java.lang.Integer.parseInt(1234)
-
java.util.Calendar.getInstance(locale, timeZone)
-
- a method call:
actor.methodName(parameters)
, where actor is an atom that specifies the instance whose method is called, and parameters is a comma separated list of atoms.-
map.put('key', 'value')
-
object.toString()
-
- a static method call: