public class RythmConfiguration extends Object
Store the configuration for a rythm engine instance. Different engine instance has different configuration instance.
| Modifier and Type | Field and Description |
|---|---|
static ResourceBundle.Control |
DEF_RESOURCE_BUNDLE_CONTROL |
static RythmConfiguration |
EMPTY_CONF |
| Constructor and Description |
|---|
RythmConfiguration(Map<String,?> configuration,
RythmEngine engine)
Construct a
RythmConfiguration with a map. |
public static final ResourceBundle.Control DEF_RESOURCE_BUNDLE_CONTROL
public static final RythmConfiguration EMPTY_CONF
public RythmConfiguration(Map<String,?> configuration, RythmEngine engine)
Construct a RythmConfiguration with a map. The map is copied to the original map of the configuration instance
configuration - public <T> T get(RythmConfigurationKey key)
Return configuration by configuration key
T - key - public <T> List<T> getList(RythmConfigurationKey key, Class<T> c)
Return a configuration value as list
T - key - c - public <T> T get(String key)
Look up configuration by a String key. If the String key can be converted into rythm configuration key, then it is converted and call to get(RythmConfigurationKey) method. Otherwise the original configuration map is used to fetch the value from the string key
T - key - public String pluginVersion()
Return plugin version without lookup
public IByteCodeHelper byteCodeHelper()
Return RythmConfigurationKey.ENGINE_CLASS_LOADER_BYTE_CODE_HELPER_IMPL without lookup
public boolean playFramework()
Return RythmConfigurationKey.ENGINE_PLAYFRAMEWORK without lookup
public boolean logRenderTime()
Return RythmConfigurationKey.LOG_TIME_RENDER_ENABLED without look up
public boolean loadPrecompiled()
Return RythmConfigurationKey.ENGINE_LOAD_PRECOMPILED_ENABLED without lookup
public boolean precompileMode()
Return RythmConfigurationKey.ENGINE_PRECOMPILE_MODE without lookup
public boolean disableFileWrite()
Return inversed value of RythmConfigurationKey.ENGINE_FILE_WRITE_ENABLED without lookup
public boolean gae()
public Set<String> restrictedClasses()
Return RythmConfigurationKey.SANDBOX_RESTRICTED_CLASS without lookup
Note, the return value also contains rythm’s built-in restricted classes
public boolean typeInferenceEnabled()
Get RythmConfigurationKey.FEATURE_TYPE_INFERENCE_ENABLED without lookup
public boolean smartEscapeEnabled()
Get RythmConfigurationKey.FEATURE_SMART_ESCAPE_ENABLED without lookup
public boolean naturalTemplateEnabled()
Get RythmConfigurationKey.FEATURE_NATURAL_TEMPLATE_ENABLED without lookup
public boolean debugJavaSourceEnabled()
Get RythmConfigurationKey.ENGINE_OUTPUT_JAVA_SOURCE_ENABLED without lookup
public boolean cacheEnabled()
Return true if cache is not disabled for the engine instance. A cache is disabled when
public boolean cacheDisabled()
Return true if cache is disabled for the engine instance.
cacheEnabled()public boolean transformEnabled()
Return RythmConfigurationKey.FEATURE_TRANSFORM_ENABLED without look up
public boolean compactModeEnabled()
Return RythmConfigurationKey.CODEGEN_COMPACT_ENABLED without look up
public IDurationParser durationParser()
Return RythmConfigurationKey.CACHE_DURATION_PARSER_IMPL without lookup
public ICodeType defaultCodeType()
Return RythmConfigurationKey.DEFAULT_CODE_TYPE_IMPL without lookup
public File tmpDir()
Return RythmConfigurationKey.HOME_TMP without lookup
public List<URI> templateHome()
Return RythmConfigurationKey.HOME_TEMPLATE without lookup
public void setTemplateHome(File home)
Set template source home path
Note, this is not supposed to be used by user application or third party plugin
public IByteCodeEnhancer byteCodeEnhancer()
Return RythmConfigurationKey.CODEGEN_BYTE_CODE_ENHANCER without lookup
public ISourceCodeEnhancer sourceEnhancer()
public Locale locale()
Get RythmConfigurationKey.I18N_LOCALE without lookup
public List<String> messageSources()
Get RythmConfigurationKey.I18N_MESSAGE_SOURCES without lookup
public II18nMessageResolver i18nMessageResolver()
Get RythmConfigurationKey.I18N_MESSAGE_RESOLVER without lookup
public String resourceBundleEncoding()
Get RythmConfigurationKey.RESOURCE_BUNDLE_ENCODING without lookup
public ResourceBundle.Control resourceBundleControl()
public String resourceNameSuffix()
Get RythmConfigurationKey.RESOURCE_NAME_SUFFIX without lookup
public long resourceRefreshInterval()
public boolean autoScan()
public String allowedSystemProperties()
public boolean sandboxTmpIO()
public boolean hasGlobalInclude()
public static RythmConfiguration get()
Return RythmConfiguration instance of current RythmEngine, or if it is not inside a RythmEngine runtime context, an empty configuration is returned
public void debug()
Copyright © 2017–2021 OSGL (Open Source General Library). All rights reserved.