Package org.mvel2.integration.impl

Examples of org.mvel2.integration.impl.MapVariableResolverFactory


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


       
        TemplateRegistry registry = getRuleTemplateRegistry(context.getPackageBuilder().getRootClassLoader());

        context.getMethods().add( TemplateRuntime.execute( registry.getNamedTemplate( ruleTemplate ),
                                                           null,
                                                           new MapVariableResolverFactory( vars ),
                                                           registry ) );

        registry = getInvokerTemplateRegistry(context.getPackageBuilder().getRootClassLoader());
        final String invokerClassName = context.getPkg().getName() + "." + context.getRuleDescr().getClassName() + StringUtils.ucFirst( className ) + "Invoker";

        context.getInvokers().put( invokerClassName,
                                   TemplateRuntime.execute( registry.getNamedTemplate( invokerTemplate ),
                                                            null,
                                                            new MapVariableResolverFactory( vars ),
                                                            registry ) );

        context.getInvokerLookups().put( invokerClassName,
                                             invokerLookup );
        context.getDescrLookups().put( invokerClassName,
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

            for ( Object o : map.get( "locations" ).values() ) {
                ksession.insert( o );
            }

            MapVariableResolverFactory f = new MapVariableResolverFactory( map );

            String baseStr = "import  org.drools.adventures.*;  import org.drools.adventures.commands.*;\n";
            FactHandle fh = ksession.insert( MVEL.eval( baseStr + "new EnterEvent( characters['hero'], rooms['first floor hallway'] )",
                                                        f ) );
            ksession.fireAllRules();
View Full Code Here

        try {
            Thread.currentThread().setContextClassLoader( classLoader );
            Map vars = new HashMap();
            vars.put( "args",
                      cmd );
            MapVariableResolverFactory f = new MapVariableResolverFactory( vars );
            Action c = (Action) cmd.get( 0 );
            switch ( c ) {
                case MOVE : {
                    ksession.insert( new Request( session,
                                                  MVEL.eval( baseStr + "new MoveCommand(args[1], args[2])",
View Full Code Here

        TemplateRegistry registry = getRuleTemplateRegistry();

        Object method = TemplateRuntime.execute( registry.getNamedTemplate( "accumulateInnerClass" ),
                                                 null,
                                                 new MapVariableResolverFactory( map ),
                                                 registry );

        //System.out.println( method );
    }
View Full Code Here

                 Boolean.FALSE );

        TemplateRegistry registry = getInvokerTemplateRegistry();
        Object method = TemplateRuntime.execute( registry.getNamedTemplate( "accumulateInvoker" ),
                                                 null,
                                                 new MapVariableResolverFactory( map ),
                                                 registry );

        //System.out.println( method );
    }
View Full Code Here

                 Boolean.TRUE );

        TemplateRegistry registry = getInvokerTemplateRegistry();
        Object method = TemplateRuntime.execute( registry.getNamedTemplate( "accumulateInvoker" ),
                                                 null,
                                                 new MapVariableResolverFactory( map ),
                                                 registry );

        //System.out.println( method );
    }
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

    @Override
    public Object run(Map<String, Object> variables) {
        if (variables == null) {
            variables = new HashMap<String, Object>();
        }
        VariableResolverFactory factory = new MapVariableResolverFactory(variables, _propertyResolverFactory);
        return isCompiled() ? MVEL.executeExpression(_compiled, factory) : MVEL.eval(_expression, factory);
    }
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.