Android Open Source - Kite M V E L2 Evaluator






From Project

Back to project page Kite.

License

The source code is released under:

Apache License

If you think the Android project Kite listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/**
 * //from   ww w. ja v a2 s .  c o  m
 */
package com.efurture.kite.expression;

import java.util.Map;

import org.mvel2.MVEL;

/**
 * mvel2 implementation of evaluator. mvel2: http://mvel.codehaus.org/
 * @author gubaojian   email: gubaojian@163.com
 *  */
public class MVEL2Evaluator  extends Evaluator{
  
  //mvel2 require java 1.5
  static{
    String javaVersion = System.getProperty("java.version");
    try {
      if (javaVersion == null || Float.parseFloat(javaVersion.substring(0,3)) < 1.6) {
        System.setProperty("java.version", "1.6");
      }
    }catch (Exception e) {
      System.setProperty("java.version", "1.6");
    }
  }
  
  
  @Override
  public int evalute(String expression, Map<String, Object> paramsMap){
    Number value =  MVEL.eval(expression, paramsMap, Number.class);
    return value.intValue();
  }
}




Java Source Code List

com.efurture.kite.Kite.java
com.efurture.kite.OnFinishLayoutListener.java
com.efurture.kite.example.KiteItemActivity.java
com.efurture.kite.example.MainActivity.java
com.efurture.kite.expression.EvaluatorException.java
com.efurture.kite.expression.EvaluatorManager.java
com.efurture.kite.expression.Evaluator.java
com.efurture.kite.expression.Exp4jEvaluator.java
com.efurture.kite.expression.MVEL2Evaluator.java
com.efurture.kite.layout.LayoutExtension.java
com.efurture.kite.param.ParamMap.java
com.efurture.kite.param.Params.java