Package jetbrick.template.parser

Examples of jetbrick.template.parser.VariableResolver


    public String getVersion() {
        return VERSION;
    }

    private VariableResolver createVariableResolver() {
        VariableResolver resolver = new VariableResolver();
        for (String pkg : config.getImportPackages()) {
            resolver.addImportPackage(pkg);
        }
        for (String klassName : config.getImportClasses()) {
            resolver.addImportClass(klassName);
        }
        for (String method : config.getImportMethods()) {
            resolver.addMethodClass(method);
        }
        for (String function : config.getImportFunctions()) {
            resolver.addFunctionClass(function);
        }
        for (String tag : config.getImportTags()) {
            resolver.addTagClass(tag);
        }
        for (String variable : config.getImportVariables()) {
            int pos = variable.lastIndexOf(" ");
            String defination = variable.substring(0, pos);
            String id = variable.substring(pos + 1);
            resolver.addGlobalVariable(defination, id);
        }

        if (config.isImportAutoscan()) {
            log.info("Starting to autoscan the JetMethods, JetFunctions, JetTags implements...");
            autoScanClassImplements(resolver);
View Full Code Here


    protected JetWebEngine(JetConfig config, ServletContext servletContext) {
        this.servletContext = servletContext;

        load(config);

        VariableResolver resolver = getVariableResolver();
        resolver.addGlobalVariable("javax.servlet.ServletContext", JetWebContext.SERVLET_CONTEXT);
        resolver.addGlobalVariable("javax.servlet.http.HttpSession", JetWebContext.SESSION);
        resolver.addGlobalVariable("javax.servlet.http.HttpServletRequest", JetWebContext.REQUEST);
        resolver.addGlobalVariable("javax.servlet.http.HttpServletResponse", JetWebContext.RESPONSE);
        resolver.addGlobalVariable("java.util.Map<String,Object>", JetWebContext.SERVLET_CONTEXT_SCOPE);
        resolver.addGlobalVariable("java.util.Map<String,Object>", JetWebContext.SESSION_SCOPE);
        resolver.addGlobalVariable("java.util.Map<String,Object>", JetWebContext.REQUEST_SCOPE);
        resolver.addGlobalVariable("java.util.Map<String,String>", JetWebContext.PARAMETER);
        resolver.addGlobalVariable("java.util.Map<String,String[]>", JetWebContext.PARAMETER_VALUES);
    }
View Full Code Here

TOP

Related Classes of jetbrick.template.parser.VariableResolver

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.