Package org.mvel2.integration.impl

Examples of org.mvel2.integration.impl.ImmutableDefaultFactory


  }


  MVELInterpretedRuntime(String expression) {
    setExpression(expression);
    this.variableFactory = new ImmutableDefaultFactory();
  }
View Full Code Here


  }

  MVELInterpretedRuntime(String expression, Object ctx) {
    setExpression(expression);
    this.ctx = ctx;
    this.variableFactory = new ImmutableDefaultFactory();
  }
View Full Code Here

  }

  public PropertyAccessor(String property, Object ctx) {
    this.length = end = (this.property = property.toCharArray()).length;
    this.ctx = ctx;
    this.variableFactory = new ImmutableDefaultFactory();
  }
View Full Code Here

  public static Object eval(File file, Object ctx, VariableResolverFactory vars, TemplateRegistry registry) {
    return execute(compileTemplate(TemplateTools.readInFile(file)), ctx, vars, registry);
  }

  public static Object eval(InputStream instream) {
    return eval(instream, null, new ImmutableDefaultFactory(), null);
  }
View Full Code Here

  public static Object eval(InputStream instream) {
    return eval(instream, null, new ImmutableDefaultFactory(), null);
  }

  public static Object eval(InputStream instream, Object ctx) {
    return eval(instream, ctx, new ImmutableDefaultFactory(), null);
  }
View Full Code Here

            return new FixedExpression(literalNode.getEgressType(), literalNode.getLiteralValue());
        }

        if (node instanceof BinaryOperation) {
            BinaryOperation binaryOperation = (BinaryOperation)node;
            Object value = binaryOperation.getReducedValue(parserContext, null, new ImmutableDefaultFactory());
            return new FixedExpression(binaryOperation.getEgressType(), value);
        }

        Accessor accessor = node.getAccessor();
        if (accessor == null && node instanceof NewObjectNode) {
View Full Code Here

        if (node instanceof BinaryOperation) {
            BinaryOperation op = (BinaryOperation)node;
            if (node.getClass() == BinaryOperation.class) {
                return new AritmeticExpression(node.getEgressType(), analyzeNode(op.getLeft()), AritmeticOperator.fromMvelOpCode(op.getOperation()), analyzeNode(op.getRight()));
            } else {
                return new FixedExpression(op.getEgressType(), op.getReducedValue(parserContext, null, new ImmutableDefaultFactory()));
            }
        }

        Accessor accessor = node.getAccessor();
View Full Code Here

                                 final Object invokerLookup,
                                 final BaseDescr descrLookup) {
        TemplateRegistry registry = getRuleTemplateRegistry();

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

        registry = getInvokerTemplateRegistry();
        final String invokerClassName = context.getPkg().getName() + "." + context.getProcessDescr().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

    public static void generateMethodTemplate(final String ruleTemplate, final RuleBuildContext context, final Map vars) {
        TemplateRegistry registry = getRuleTemplateRegistry(context.getPackageBuilder().getRootClassLoader());

        context.addMethod((String) TemplateRuntime.execute( registry.getNamedTemplate(ruleTemplate),
                                                            null,
                                                            new MapVariableResolverFactory(vars),
                                                            registry) );
    }
View Full Code Here

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

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

        context.getInvokerLookups().put( invokerClassName,
                                             invokerLookup );
        context.getDescrLookups().put( invokerClassName,
View Full Code Here

TOP

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

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.