Examples of MethodStub


Examples of org.mvel2.util.MethodStub

  public void testStrictTypingCompilation2() throws Exception {
    ParserContext ctx = new ParserContext();
    //noinspection RedundantArrayCreation
    ctx.addImport("getRuntime",
            new MethodStub(Runtime.class.getMethod("getRuntime",
                    new Class[]{})));

    ctx.setStrictTypeEnforcement(true);

    ExpressionCompiler compiler = new ExpressionCompiler("getRuntime()");
View Full Code Here

Examples of org.mvel2.util.MethodStub

    Object o;

    for (Map.Entry<String, Object> entry : imports.entrySet()) {
      if ((o = entry.getValue()) instanceof Method) {
        this.imports.put(entry.getKey(), new MethodStub((Method) o));
      }
      else {
        this.imports.put(entry.getKey(), o);
      }
    }
View Full Code Here

Examples of org.mvel2.util.MethodStub

    initImports();
    this.imports.put(name, proto);
  }

  public void addImport(String name, Method method) {
    addImport(name, new MethodStub(method));
  }
View Full Code Here

Examples of org.mvel2.util.MethodStub

  public StaticMethodImportResolverFactory() {
    this.variableResolvers = new HashMap<String, VariableResolver>();
  }

  public VariableResolver createVariable(String name, Object value) {
    if (value instanceof Method) value = new MethodStub((Method) value);

    StaticMethodImportResolver methodResolver = new StaticMethodImportResolver(name, (MethodStub) value);
    this.variableResolvers.put(name, methodResolver);
    return methodResolver;
  }
View Full Code Here

Examples of org.mvel2.util.MethodStub

   *
   * @param name   The alias to use
   * @param method The instance of <tt>Method</tt> which represents the static import.
   */
  public void addImport(String name, Method method) {
    addImport(name, new MethodStub(method));
    //   addInput(name, MethodStub.class);
  }
View Full Code Here

Examples of org.mvel2.util.MethodStub

   *
   * @param name   The alias to use
   * @param method The instance of <tt>Method</tt> which represents the static import.
   */
  public void addImport(String name, Method method) {
    addImport(name, new MethodStub(method));
    //   addInput(name, MethodStub.class);
  }
View Full Code Here

Examples of org.mvel2.util.MethodStub

    if (this.imports == null) this.imports = new LinkedHashMap<String, Object>();
    Object o;

    for (Map.Entry<String, Object> entry : imports.entrySet()) {
      if ((o = entry.getValue()) instanceof Method) {
        this.imports.put(entry.getKey(), new MethodStub((Method) o));
      }
      else {
        this.imports.put(entry.getKey(), o);
      }
    }
View Full Code Here

Examples of org.mvel2.util.MethodStub

    if (this.imports == null) this.imports = new ConcurrentHashMap<String, Object>();
    this.imports.put(name, proto);
  }

  public void addImport(String name, Method method) {
    addImport(name, new MethodStub(method));
  }
View Full Code Here

Examples of org.mvel2.util.MethodStub

  public void testStrictTypingCompilation2() throws Exception {
    ParserContext ctx = new ParserContext();
    //noinspection RedundantArrayCreation
    ctx.addImport("getRuntime",
            new MethodStub(Runtime.class.getMethod("getRuntime",
                    new Class[]{})));

    ctx.setStrictTypeEnforcement(true);

    ExpressionCompiler compiler = new ExpressionCompiler("getRuntime()");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.