Package org.mvel2.integration.impl

Examples of org.mvel2.integration.impl.MapVariableResolverFactory


//      return evalWithMVELExpression(MVEL.compileExpression(script, ctx));
    }else{
      if(obj instanceof Map){
        return MVEL.eval(script,(Map)obj);
      }else{
        return MVEL.eval(script,new MapVariableResolverFactory());
      }
     
//      return evalWithMVELExpression(MVEL.compileExpression(script, ctx),obj);
    }
//    if(obj==null){
View Full Code Here


//    }else{
//      return MVEL.eval(script,obj);
//    }
  }
  public static Object evalWithMVEL(String script){
    return MVEL.eval(script, new MapVariableResolverFactory());
//    evalWithMVELExpression(MVEL.compileExpression(script, ctx));
//    if(obj==null){
//      return MVEL.eval(script);
//    }else{
//      return MVEL.eval(script,obj);
View Full Code Here

  }
  public static Object evalWithMVELExpression(Object expression,Object obj){
    if(obj==null){
      return evalWithMVELExpression(expression);
    }else{
      return MVEL.executeExpression(expression, obj,new MapVariableResolverFactory());
    }
  }
View Full Code Here

    }else{
      return MVEL.executeExpression(expression, obj,new MapVariableResolverFactory());
    }
  }
  public static Object evalWithMVELExpression(Object expression){
    return MVEL.executeExpression(expression,new MapVariableResolverFactory());
  }
View Full Code Here

    }
    final boolean returnValue;
    if (this.mvelExpression == null) {
      returnValue = true;
    } else {
      final Object executionResult = MVEL.executeExpression(this.mvelExpression, item, new MapVariableResolverFactory(variables));
      returnValue = executionResult instanceof Boolean && ((Boolean)executionResult).booleanValue();
    }
    return returnValue;
  }
View Full Code Here

      if (log != null && log.isDebugEnabled()) {
        log.debug(String.format("Writing change log to %s using character encoding %s", outputFile, encoding));
      }
      final Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), encoding));
      try {
        TemplateRuntime.execute(compiledTemplate, this, new MapVariableResolverFactory(variables), null /* no TemplateRegistry */, new TemplateOutputWriter(writer));
      } finally {
        try {
          writer.flush();
        } catch (final IOException ignore) {
          // ignore on purpose
View Full Code Here

        }

        vars.put( "text",
                  functionDescr.getText() );

        final String text = String.valueOf(TemplateRuntime.eval( template, null, new MapVariableResolverFactory(vars)));

        final BufferedReader reader = new BufferedReader( new StringReader( text ) );
        String line = null;
        final String lineStartsWith = "    public static " + functionDescr.getReturnType() + " " + functionDescr.getName();
        int offset = 0;
View Full Code Here

        context.put( "session",
                     session );

        return (String) TemplateRuntime.execute( REPORT_REGISTRY.getNamedTemplate( ruleTemplate ),
                                                 null,
                                                 new MapVariableResolverFactory( context ),
                                                 REPORT_REGISTRY );
    }
View Full Code Here

        public DroolsMVELIndexedFactory(String[] varNames,
                                        Object[] values,
                                        VariableResolverFactory factory) {
            this.indexedVariableNames = varNames;
            this.values = values;
            this.nextFactory = new MapVariableResolverFactory();
            this.nextFactory.setNextFactory( factory );
            this.indexedVariableResolvers = createResolvers( values );
        }
View Full Code Here

            VariableResolver vr = getResolver( name );
            if ( vr != null ) {
                vr.setValue( value );
                return vr;
            } else {
                if ( nextFactory == null ) nextFactory = new MapVariableResolverFactory( new HashMap() );
                return nextFactory.createVariable( name,
                                                   value );
            }
        }
View Full Code Here

TOP

Related Classes of org.mvel2.integration.impl.MapVariableResolverFactory

Copyright © 2018 www.massapicom. 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.