Codota Logo
Expression.get
Code IndexAdd Codota to your IDE (free)

How to use
get
method
in
com.wizzardo.tools.evaluation.Expression

Best Java code snippets using com.wizzardo.tools.evaluation.Expression.get (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: com.wizzardo.tools/tools-evaluation

  @Override
  public Object get(Map<String, Object> model) {
//        HashMap<String, Object> local = new HashMap<String, Object>(model);
    Object ob = null;
    for (Expression expression : expressions) {
      ob = expression.get(model);
    }
    return ob;
  }

origin: com.wizzardo.tools/tools-evaluation

  @Override
  public Object get(Map<String, Object> model) {
    if ((Boolean) condition.get(model)) {
      return thenStatement.get(model);
    } else if (elseStatement != null) {
      return elseStatement.get(model);
    }
    return null;
  }
}
origin: com.wizzardo.tools/tools-evaluation

  @Override
  public Object get(Map<String, Object> model) {
    Object o = inner.get(model);
    try {
      return clazz.cast(o);
    } catch (ClassCastException e) {
      throw new ClassCastException(o.getClass().getCanonicalName() + " cannot be cast to " + clazz.getCanonicalName());
    }
  }
}
origin: wizzardo/tools

  @Override
  public Object get(Map<String, Object> model) {
    Object o = inner.get(model);
    try {
      return clazz.cast(o);
    } catch (ClassCastException e) {
      throw new ClassCastException(o.getClass().getCanonicalName() + " cannot be cast to " + clazz.getCanonicalName());
    }
  }
}
origin: wizzardo/tools

  @SuppressWarnings("unchecked")
  public static <T> T evaluate(String exp, Map<String, Object> model) {
//        System.out.println("evaluate: " + exp + "\t" + model);
    Expression ex = prepare(exp, model);
    return (T) ex.get(model);
  }

origin: com.wizzardo.tools/tools-evaluation

  @SuppressWarnings("unchecked")
  public static <T> T evaluate(String exp, Map<String, Object> model, Map<String, UserFunction> functions) {
//        System.out.println("evaluate: " + exp + "\t" + model);
    Expression ex = prepare(exp, model, functions);
    return (T) ex.get(model);
  }

origin: com.wizzardo.tools/tools-evaluation

  @SuppressWarnings("unchecked")
  public static <T> T evaluate(String exp, Map<String, Object> model) {
//        System.out.println("evaluate: " + exp + "\t" + model);
    Expression ex = prepare(exp, model);
    return (T) ex.get(model);
  }

origin: com.wizzardo.tools/tools-evaluation

  @SuppressWarnings("unchecked")
  public static <T> T evaluate(String exp) {
//        System.out.println("evaluate: " + exp + "\t" + model);
    Expression ex = prepare(exp, null);
    return (T) ex.get(null);
  }

origin: com.wizzardo.tools/tools-evaluation

@Override
public Object get(Map<String, Object> model) {
  if (result != null)
    return result;
  Object r = condition.get(model);
  Boolean result = toBoolean(r);
  if (condition.hardcoded)
    this.result = result;
  return result;
}
origin: wizzardo/tools

  @SuppressWarnings("unchecked")
  public static <T> T evaluate(String exp) {
//        System.out.println("evaluate: " + exp + "\t" + model);
    Expression ex = prepare(exp, null);
    return (T) ex.get(null);
  }

origin: wizzardo/tools

@Override
public Object get(Map<String, Object> model) {
  if (result != null)
    return result;
  Object r = condition.get(model);
  Boolean result = toBoolean(r);
  if (condition.hardcoded)
    this.result = result;
  return result;
}
origin: wizzardo/tools

  @SuppressWarnings("unchecked")
  public static <T> T evaluate(String exp, Map<String, Object> model, Map<String, UserFunction> functions) {
//        System.out.println("evaluate: " + exp + "\t" + model);
    Expression ex = prepare(exp, model, functions);
    return (T) ex.get(model);
  }

origin: wizzardo/tools

@Test
public void testClone() throws Exception {
  String exp = "1+\"ololo\".substring(2)";
  Expression eh = EvalTools.prepare(exp);
  Object ob1 = eh.get(null);
  Object ob2 = eh.get(null);
  assertTrue(ob1 == ob2);
  eh = eh.clone();
  Object ob3 = eh.get(null);
  assertTrue(ob1 != ob3);
  assertTrue(ob1.equals(ob3));
}
origin: wizzardo/tools

@Test
public void test_imports_2() {
  String s = "import " + AtomicInteger.class.getCanonicalName() + ";\n" +
      "i = new AtomicInteger(1)";
  Expression expression = EvalTools.prepare(s);
  Map model = new HashMap();
  expression.get(model);
  Assert.assertEquals(1, model.size());
  Assert.assertEquals(1, ((AtomicInteger) model.get("i")).get());
}
origin: wizzardo/tools

@Test
public void testComment_1() {
  Map<String, Object> model = new HashMap<String, Object>();
  String s = "a = 1\n//a=2";
  Assert.assertEquals(1, EvalTools.prepare(s).get(model));
}
origin: wizzardo/tools

@Test
public void test_4() {
  String s = "a { b { c = 'value'} }";
  Expression expression = EvalTools.prepare(s);
  Config config = new Config();
  expression.get(config);
  Assert.assertEquals(1, config.size());
  Assert.assertEquals("value", ((Map) ((Map) config.get("a")).get("b")).get("c"));
}
origin: wizzardo/tools

@Test
public void test_closures() {
  String s = "a = 1\n" +
      "s = \"|${{->a}}|\"\n" +
      "c = {a}\n" +
      "a=2";
  Expression expression = EvalTools.prepare(s);
  Config config = new Config();
  expression.get(config);
  Assert.assertEquals(Integer.valueOf(2), config.get("a", 0));
  Assert.assertEquals("|2|", config.get("s").toString());
}
origin: wizzardo/tools

@Test
public void test_closure() {
  String s = "" +
      "closure = {'bar'}\n" +
      "foo = closure()" +
      "";
  Expression expression = EvalTools.prepare(s);
  Config config = new Config();
  expression.get(config);
  Assert.assertEquals("bar", config.get("foo"));
}
origin: wizzardo/tools

@Test
public void test_5() {
  String s = "a { b = 'value'; c = 'value 2' }";
  Expression expression = EvalTools.prepare(s);
  Config config = new Config();
  expression.get(config);
  Assert.assertEquals(1, config.size());
  Assert.assertEquals("value", ((Map) config.get("a")).get("b"));
  Assert.assertEquals("value 2", ((Map) config.get("a")).get("c"));
}
origin: wizzardo/tools

@Test
public void test_comment_4() {
  String s = "b = 'this // is not a comment'\n" +
      "c = '/*also just a string*/'";
  Expression expression = EvalTools.prepare(s);
  Config config = new Config();
  expression.get(config);
  Assert.assertEquals("this // is not a comment", config.get("b", ""));
  Assert.assertEquals("/*also just a string*/", config.get("c", ""));
}
com.wizzardo.tools.evaluationExpressionget

Popular methods of Expression

  • setVariable
  • clone
  • parse
  • raw
  • removeUnderscores
  • toString

Popular in Java

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now