Unfold Hierarchy number Tags Values

      JEXL Codes
        1  Examples
            1.1  Math
                1.1.1  e
Script
Math.E
Context
jexlContext.set("Math", Math.class);
                1.1.2  pi
Script
Math.PI
Context
jexlContext.set("Math", Math.class);
                1.1.3  absoluate
Script
Math.abs(-5.611)
Context
jexlContext.set("Math", Math.class);
                1.1.4  square root
Script
Math.sqrt(9)
Context
jexlContext.set("Math", Math.class);
                1.1.5  cubic root
Script
Math.cbrt(27)
Context
jexlContext.set("Math", Math.class);
                1.1.6  power
Script
Math.pow(2,5)
Context
jexlContext.set("Math", Math.class);
                1.1.7  power of e
Script
Math.exp(2)
Context
jexlContext.set("Math", Math.class);
                1.1.8  natural logarithm(base e)
Script
Math.log(6)
Context
jexlContext.set("Math", Math.class);
                1.1.9  common logarithm(base 10)
Script
Math.log10(6)
Context
jexlContext.set("Math", Math.class);
                1.1.10  cosine
Script
Math.cos(0)
Context
jexlContext.set("Math", Math.class);
                1.1.11  sine
Script
Math.sin(9)
Context
jexlContext.set("Math", Math.class);
                1.1.12  tangent
Script
Math.tan(5)
Context
jexlContext.set("Math", Math.class);
                1.1.13  arc tangent
Script
Math.atan(-7.3)
Context
jexlContext.set("Math", Math.class);
                1.1.14  arc cosine
Script
Math.acos(0.5)
Context
jexlContext.set("Math", Math.class);
                1.1.15  arc sine
Script
Math.asin(0.3)
Context
jexlContext.set("Math", Math.class);
                1.1.16  round up
Script
Math.ceil(4.13)
Context
jexlContext.set("Math", Math.class);
                1.1.17  round down
Script
Math.floor(4.67)
Context
jexlContext.set("Math", Math.class);
                1.1.18  round
Script
Math.round(4.83)
Context
jexlContext.set("Math", Math.class);
                1.1.19  random()
Script
Math.random( )
Context
jexlContext.set("Math", Math.class);
                1.1.20  maximum
Script
Math.max(1,-3)
Context
jexlContext.set("Math", Math.class);
                1.1.21  minimum
Script
Math.min(1,-3)
Context
jexlContext.set("Math", Math.class);
            1.2  Boolean expression
                1.2.1  in array
var value = 3;
var array = [1,'2',3, 'hello'];
value =~ array;
                1.2.2  not in set
var value = 2;
var set = {1,'2',3, 'hello'};
value !~ set;
                1.2.3  match string
Script
var s = 'abc1233hello';
var regex = '\\S*3{2,}\\S*';
var caseInsensitive = true;
StringTools.match(s,regex,caseInsensitive);
Context
jexlContext.set("StringTools", mara.mybox.tools.StringTools.class);
                1.2.4  include string
Script
var s = 'abc1233hello';
var regex = '3{2}';
var caseInsensitive = true;
StringTools.include(s,regex,caseInsensitive);
Context
jexlContext.set("StringTools", mara.mybox.tools.StringTools.class);
                1.2.5  and/or/not
var a = 5;
var b = 2;
'hello'.startsWith('hell') and ( a < 9 or b >= 6  ) and not ( a == b );
            1.3  Numeric operations
                1.3.1  decimal scale
Script
var d = 52362.18903;
var scale = 2;
DoubleTools.scale(d, scale);
Context
jexlContext.set("DoubleTools", mara.mybox.tools.DoubleTools.class);
                1.3.2  format
Script
var d = 52362.18903;
var scale = 2;
DoubleTools.format(d, scale);
Context
jexlContext.set("DoubleTools", mara.mybox.tools.DoubleTools.class);
                1.3.3  percentage
Script
var number = 37;
var total = 518;
var scale = 2;
DoubleTools.percentage(number, total, scale);
Context
jexlContext.set("DoubleTools", mara.mybox.tools.DoubleTools.class);
            1.4  Date
                1.4.1  now
Script
DateTools.nowString();
Context
jexlContext.set("DateTools", mara.mybox.tools.DateTools.class);
                1.4.2  format
Script
var date = new('java.util.Date');
var format = 'yyyy-MM-dd HH:mm:ss.SSS';
DateTools.datetimeToString(date, format);
Context
jexlContext.set("DateTools", mara.mybox.tools.DateTools.class);
            1.5  Statement
                1.5.1  loop
var array = [ 'A', 'B', 'C', 'D' ];
var arrayString = '';
for (var i : 1 .. size (array)) {
    if (empty (arrayString)) {
         arrayString = array[i-1];
    } else {
         arrayString += ' , ' + array[i-1];
    }
}
return arrayString;
                1.5.2  function
Script
var circleArea = function(r) {
    Math.PI * r * r 
}
var r = 9.42;
return circleArea(r);
Context
jexlContext.set("Math", Math.class);
            1.6  Object
                1.6.1  string
var s = new('java.lang.String', 'Hello');
return 'include e:'+ s.contains('e') + '  length:' + s.length();
                1.6.2  time
var date = new('java.util.Date');
return 'current time:' + date.toString() + '  value:' + date.getTime();
                1.6.3  double
var d = new('java.lang.Double', 0d);
return 'minmum of positive=' + d.MIN_VALUE + ' maximum=' + d.MAX_VALUE;

* Links and controls may be unresponsive when html page is editable.