Package org.mvel2.templates

Examples of org.mvel2.templates.SimpleTemplateRegistry


    }

    @Override
    public void load(String name, String view) {
        // compile the template
        CompiledTemplate compiled = TemplateCompiler.compileTemplate(view);
        registry.addNamedTemplate(name, compiled);
    }
View Full Code Here


    protected static String JAVA_RULE_MVEL             = "javaRule.mvel";
    protected static String JAVA_INVOKERS_MVEL         = "javaInvokers.mvel";

    public static void setConsequenceTemplate( String name ) {
        JAVA_RULE_MVEL = name;
        RULE_REGISTRY = new SimpleTemplateRegistry();
    }
View Full Code Here

        RULE_REGISTRY = new SimpleTemplateRegistry();
    }

    public static void setInvokerTemplate( String name ) {
        JAVA_INVOKERS_MVEL = name;
        INVOKER_REGISTRY = new SimpleTemplateRegistry();
    }
View Full Code Here

        //System.out.println( method );
    }

    private TemplateRegistry getRuleTemplateRegistry() {
        TemplateRegistry ruleRegistry = new SimpleTemplateRegistry();
        CompiledTemplate compiled = TemplateCompiler.compileTemplate( AbstractJavaRuleBuilder.class.getResourceAsStream( "javaRule.mvel" ),
                                                                      (Map<String, Class<? extends Node>>) null );
        TemplateRuntime.execute( compiled,
                                 null,
                                 ruleRegistry );
View Full Code Here

        return ruleRegistry;
    }

    private TemplateRegistry getInvokerTemplateRegistry() {
        TemplateRegistry invokerRegistry = new SimpleTemplateRegistry();
        CompiledTemplate compiled = TemplateCompiler.compileTemplate( AbstractJavaRuleBuilder.class.getResourceAsStream( "javaInvokers.mvel" ),
                                                                      (Map<String, Class<? extends Node>>) null );
        TemplateRuntime.execute( compiled,
                                 null,
                                 invokerRegistry );
View Full Code Here


   
    private static void initRegistry() {
        if ( registry == null ) {
            registry = new SimpleTemplateRegistry();
        }

        if ( ! globalLoaded ) {
            for ( String ntempl : GLOBAL_TEMPLATES ) {
                prepareTemplate( ntempl );
View Full Code Here

    protected static String JAVA_RULE_MVEL             = "javaRule.mvel";
    protected static String JAVA_INVOKERS_MVEL         = "javaInvokers.mvel";

    public static void setConsequenceTemplate( String name ) {
        JAVA_RULE_MVEL = name;
        RULE_REGISTRY = new SimpleTemplateRegistry();
    }
View Full Code Here

        RULE_REGISTRY = new SimpleTemplateRegistry();
    }

    public static void setInvokerTemplate( String name ) {
        JAVA_INVOKERS_MVEL = name;
        INVOKER_REGISTRY = new SimpleTemplateRegistry();
    }
View Full Code Here

    this.loader = loader;
  }

  @Override
  public TemplateRegistry get() {
    TemplateRegistry registry = new SimpleTemplateRegistry();

    for (RegisteredTemplate template : templates) {
      String templateName = template.getName();
      Class<?> pageClass = template.getPageClass();
      Template loadedTemplate = loader.load(pageClass);

      CompiledTemplate compiledTemplate;
      compiledTemplate = TemplateCompiler.compileTemplate(loadedTemplate.getText());

      registry.addNamedTemplate(templateName, compiledTemplate);
    }

    return registry;
  }
View Full Code Here


   
    private static void initRegistry() {
        if ( registry == null ) {
            registry = new SimpleTemplateRegistry();
        }

        if ( ! globalLoaded ) {
            for ( String ntempl : GLOBAL_TEMPLATES ) {
                prepareTemplate( ntempl );
View Full Code Here

TOP

Related Classes of org.mvel2.templates.SimpleTemplateRegistry

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.