package freemarker.core;
import freemarker.template.Version;
class LegacyConstructorParserConfiguration implements ParserConfiguration {
private final int tagSyntax;
private final int interpolationSyntax;
private final int namingConvention;
private final boolean whitespaceStripping;
private final boolean strictSyntaxMode;
private ArithmeticEngine arithmeticEngine;
private Integer autoEscapingPolicy;
private OutputFormat outputFormat;
private Boolean recognizeStandardFileExtensions;
private Integer tabSize;
private final Version incompatibleImprovements;
LegacyConstructorParserConfiguration(boolean strictSyntaxMode, boolean whitespaceStripping,
int tagSyntax, int interpolationSyntax,
int namingConvention, Integer autoEscaping, OutputFormat outputFormat,
Boolean recognizeStandardFileExtensions, Integer tabSize,
Version incompatibleImprovements, ArithmeticEngine arithmeticEngine) {
this.tagSyntax = tagSyntax;
this.interpolationSyntax = interpolationSyntax;
this.namingConvention = namingConvention;
this.whitespaceStripping = whitespaceStripping;
this.strictSyntaxMode = strictSyntaxMode;
this.autoEscapingPolicy = autoEscaping;
this.outputFormat = outputFormat;
this.recognizeStandardFileExtensions = recognizeStandardFileExtensions;
this.tabSize = tabSize;
this.incompatibleImprovements = incompatibleImprovements;
this.arithmeticEngine = arithmeticEngine;
}
public int getTagSyntax() {
return tagSyntax;
}
public int getInterpolationSyntax() {
return interpolationSyntax;
}
public int getNamingConvention() {
return namingConvention;
}
public boolean getWhitespaceStripping() {
return whitespaceStripping;
}
public boolean getStrictSyntaxMode() {
return strictSyntaxMode;
}
public Version getIncompatibleImprovements() {
return incompatibleImprovements;
}
public ArithmeticEngine getArithmeticEngine() {
if (arithmeticEngine == null) {
throw new IllegalStateException();
}
return arithmeticEngine;
}
void setArithmeticEngineIfNotSet(ArithmeticEngine arithmeticEngine) {
if (this.arithmeticEngine == null) {
this.arithmeticEngine = arithmeticEngine;
}
}
public int getAutoEscapingPolicy() {
if (autoEscapingPolicy == null) {
throw new IllegalStateException();
}
return autoEscapingPolicy.intValue();
}
void setAutoEscapingPolicyIfNotSet(int autoEscapingPolicy) {
if (this.autoEscapingPolicy == null) {
this.autoEscapingPolicy = Integer.valueOf(autoEscapingPolicy);
}
}
public OutputFormat getOutputFormat() {
if (outputFormat == null) {
throw new IllegalStateException();
}
return outputFormat;
}
void setOutputFormatIfNotSet(OutputFormat outputFormat) {
if (this.outputFormat == null) {
this.outputFormat = outputFormat;
}
}
public boolean getRecognizeStandardFileExtensions() {
if (recognizeStandardFileExtensions == null) {
throw new IllegalStateException();
}
return recognizeStandardFileExtensions.booleanValue();
}
void setRecognizeStandardFileExtensionsIfNotSet(boolean recognizeStandardFileExtensions) {
if (this.recognizeStandardFileExtensions == null) {
this.recognizeStandardFileExtensions = Boolean.valueOf(recognizeStandardFileExtensions);
}
}
public int getTabSize() {
if (tabSize == null) {
throw new IllegalStateException();
}
return tabSize.intValue();
}
void setTabSizeIfNotSet(int tabSize) {
if (this.tabSize == null) {
this.tabSize = Integer.valueOf(tabSize);
}
}
}