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

net.anotheria.util.content.template.processors.variables.ConstantVariables Maven / Gradle / Ivy

There is a newer version: 4.0.0
Show newest version
package net.anotheria.util.content.template.processors.variables;

import net.anotheria.util.content.template.configs.TemplateProcessorConfig;

import java.util.HashMap;
import java.util.Map;

/**
 * Contains constants for Template & Variable processors.
 *
 * @author h3llka
 * @version $Id: $Id
 */
public final class ConstantVariables {

	/**
	 * Map with constants.
	 */
	private static Map constants = new HashMap<>();
	/**
	 * {@link TemplateProcessorConfig} instance.
	 */
	private static final TemplateProcessorConfig templateProcessorConfig = TemplateProcessorConfig.getInstance();

	static {
		constants.put("spacer", " ");
		constants.put("euro", "€");
		constants.put("copyright", "©");
		constants.put("EUR", "€");
		constants.put("CHF", "CHF");
		constants.put("form", "form");
		constants.put("input", "input");
		constants.put("textarea", "textarea");
		constants.put("lbrace", "{");
		constants.put("rbrace", "}");
		constants.put("greatThan", ">");
		constants.put("lessThan", "<");
		constants.put("gt", ">");
		constants.put("lt", "<");
		constants.put("rbrace", "}");
		constants.put("colon", ":");
		constants.put("semicolon", ";");
		constants.put("raquo", "»");
		constants.put("laquo", "«");
		constants.put("lang", "lang");
		constants.putAll(templateProcessorConfig.getCustomConstantVariablesMap());
	}

	/**
	 * Private Constructor.
	 */
	private ConstantVariables() {
	}

	/**
	 * Return all constants.
	 *
	 * @return constants collection
	 */
	public static Map getConstants() {
		return constants;
	}

	/**
	 * Constant will be returned if exists.
	 *
	 * @param key string key
	 * @return string value
	 */
	public static String getConstantValue(String key) {
		return constants.get(key);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy