All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zodiac.template.velocity.config.VelocityTemplateInfo Maven / Gradle / Ivy

package org.zodiac.template.velocity.config;

import java.nio.charset.Charset;
import java.util.Map;

import org.springframework.core.io.Resource;
import org.zodiac.core.application.AppEnvType;
import org.zodiac.sdk.toolkit.util.collection.CollUtil;
import org.zodiac.template.velocity.constants.VelocityTemplateConstants;

public class VelocityTemplateInfo {

    private boolean enabled = false;
    private Map properties = CollUtil.map();
    private Map preloadedResources = CollUtil.map();
    private Object[] plugins;
    private AppEnvType appEnvType = AppEnvType.DEFAULT;

    // resource loader
    private String path = VelocityTemplateConstants.DEFAULT_RESOURCE_LOADER_PATH;
    private Boolean cacheEnabled;
    private int modificationCheckSeconds = VelocityTemplateConstants.DEFAULT_MODIFICATION_CHECK_SECONDS;

    // strict ref
    private boolean strictReference = true;

    // template charset encoding
    private Charset charset = VelocityTemplateConstants.DEFAULT_ENCODING;

    private int parserPoolSize = VelocityTemplateConstants.DEFAULT_PARSER_POOL_SIZE;

    private boolean logWhenFoundTemplate = false;

    private boolean exceptionWrongArgs = true;

    private boolean inlineLocalScope = true;

    // global macros
    private String[] macros;

    public VelocityTemplateInfo() {
    }

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public Object[] getPlugins() {
        return plugins;
    }

    public void setPlugins(Object[] plugins) {
        this.plugins = plugins;
    }

    public AppEnvType getAppEnvType() {
        return appEnvType;
    }

    public VelocityTemplateInfo setAppEnvType(AppEnvType appEnvType) {
        this.appEnvType = appEnvType;
        return this;
    }

    public boolean isProductionMode() {
        return appEnvType.productionMode();
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public Boolean getCacheEnabled() {
        return cacheEnabled;
    }

    public void setCacheEnabled(Boolean cacheEnabled) {
        this.cacheEnabled = cacheEnabled;
    }

    public int getModificationCheckSeconds() {
        return modificationCheckSeconds;
    }

    public void setModificationCheckSeconds(int modificationCheckSeconds) {
        this.modificationCheckSeconds = modificationCheckSeconds;
    }

    public boolean isStrictReference() {
        return strictReference;
    }

    public void setStrictReference(boolean strictReference) {
        this.strictReference = strictReference;
    }

    public Charset getCharset() {
        return charset;
    }

    public void setCharset(Charset charset) {
        this.charset = charset;
    }

    public int getParserPoolSize() {
        return parserPoolSize;
    }

    public void setParserPoolSize(int parserPoolSize) {
        this.parserPoolSize = parserPoolSize;
    }

    public boolean isLogWhenFoundTemplate() {
        return logWhenFoundTemplate;
    }

    public void setLogWhenFoundTemplate(boolean logWhenFoundTemplate) {
        this.logWhenFoundTemplate = logWhenFoundTemplate;
    }

    public boolean isExceptionWrongArgs() {
        return exceptionWrongArgs;
    }

    public void setExceptionWrongArgs(boolean exceptionWrongArgs) {
        this.exceptionWrongArgs = exceptionWrongArgs;
    }

    public boolean isInlineLocalScope() {
        return inlineLocalScope;
    }

    public void setInlineLocalScope(boolean inlineLocalScope) {
        this.inlineLocalScope = inlineLocalScope;
    }

    public String[] getMacros() {
        return macros;
    }

    public void setMacros(String[] macros) {
        this.macros = macros;
    }

    public Map getProperties() {
        return properties;
    }

    public void setProperties(Map properties) {
        this.properties = properties;
    }

    public Map getPreloadedResources() {
        return preloadedResources;
    }

    public void setPreloadedResources(Map preloadedResources) {
        this.preloadedResources = preloadedResources;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy