org.jtwig.environment.EnvironmentConfiguration Maven / Gradle / Ivy
package org.jtwig.environment;
import org.jtwig.environment.initializer.EnvironmentInitializer;
import org.jtwig.escape.config.EscapeEngineConfiguration;
import org.jtwig.extension.Extension;
import org.jtwig.functions.JtwigFunction;
import org.jtwig.parser.config.JtwigParserConfiguration;
import org.jtwig.property.configuration.PropertyResolverConfiguration;
import org.jtwig.render.config.RenderConfiguration;
import org.jtwig.render.expression.calculator.enumerated.EnumerationListStrategy;
import org.jtwig.resource.config.ResourceConfiguration;
import org.jtwig.value.config.ValueConfiguration;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class EnvironmentConfiguration {
private final ResourceConfiguration resourceConfiguration;
private final JtwigParserConfiguration jtwigParserConfiguration;
private final RenderConfiguration renderConfiguration;
private final ValueConfiguration valueConfiguration;
private final EscapeEngineConfiguration escapeConfiguration;
private final PropertyResolverConfiguration propertyResolverConfiguration;
private final Collection enumerationStrategies;
private final Collection functions;
private final Map parameters = new HashMap<>();
private final Collection extensions;
private final List initializers;
public EnvironmentConfiguration(ResourceConfiguration resourceConfiguration, Collection enumerationStrategies, JtwigParserConfiguration jtwigParserConfiguration, ValueConfiguration valueConfiguration, RenderConfiguration renderConfiguration, EscapeEngineConfiguration escapeConfiguration, PropertyResolverConfiguration propertyResolverConfiguration, Collection functions, Map parameters, Collection extensions, List initializers) {
this.resourceConfiguration = resourceConfiguration;
this.escapeConfiguration = escapeConfiguration;
this.enumerationStrategies = enumerationStrategies;
this.jtwigParserConfiguration = jtwigParserConfiguration;
this.valueConfiguration = valueConfiguration;
this.renderConfiguration = renderConfiguration;
this.propertyResolverConfiguration = propertyResolverConfiguration;
this.functions = functions;
this.extensions = extensions;
this.initializers = initializers;
this.parameters.putAll(parameters);
}
public ResourceConfiguration getResourceConfiguration() {
return resourceConfiguration;
}
public Map getParameters() {
return parameters;
}
public Collection getFunctions() {
return functions;
}
public PropertyResolverConfiguration getPropertyResolverConfiguration() {
return propertyResolverConfiguration;
}
public Collection getEnumerationStrategies() {
return enumerationStrategies;
}
public ValueConfiguration getValueConfiguration() {
return valueConfiguration;
}
public JtwigParserConfiguration getJtwigParserConfiguration() {
return jtwigParserConfiguration;
}
public RenderConfiguration getRenderConfiguration() {
return renderConfiguration;
}
public Collection getExtensions() {
return extensions;
}
public EscapeEngineConfiguration getEscapeConfiguration() {
return escapeConfiguration;
}
public List getInitializers() {
return initializers;
}
}