Package io.micronaut.views.pebble
Class PebbleConfigurationProperties
java.lang.Object
io.micronaut.views.pebble.PebbleConfigurationProperties
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
,PebbleConfiguration
@ConfigurationProperties("micronaut.views.pebble")
public class PebbleConfigurationProperties
extends Object
implements PebbleConfiguration
ConfigurationProperties
implementation of PebbleConfiguration
.- Since:
- 2.2.0
- Author:
- Ecmel Ercan
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
static final boolean
static final boolean
static final boolean
static final String
static final String
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
void
setAllowOverrideCoreOperators
(boolean allowOverrideCoreOperators) Sets whether or not core operators overrides should be allowed.void
setAutoEscaping
(boolean autoEscaping) Sets whether or not escaping should be performed automatically.void
setCacheActive
(boolean cacheActive) Enable/disable all caches, i.e.void
setDefaultEscapingStrategy
(String defaultEscapingStrategy) Sets the default escaping strategy of the built-in escaper extension.void
setDefaultExtension
(String defaultExtension) The default extension.void
setEnabled
(boolean enabled) Sets whether the component is enabled.void
setGreedyMatchMethod
(boolean greedyMatchMethod) Enable/disable greedy matching mode for finding java method.void
setLiteralDecimalsAsIntegers
(boolean literalDecimalsAsIntegers) Enable/disable treat literal decimal as Integer.void
setLiteralNumbersAsBigDecimals
(boolean literalNumbersAsBigDecimals) Enable/disable treat literal numbers as BigDecimals.void
setNewLineTrimming
(boolean newLineTrimming) Changes the newLineTrimming setting of the PebbleEngine.void
setStrictVariables
(boolean strictVariables) Changes the strictVariables setting of the PebbleEngine.
-
Field Details
-
PREFIX
- See Also:
-
ENABLED
- See Also:
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLED- See Also:
-
DEFAULT_EXTENSION
- See Also:
-
DEFAULT_CACHE_ACTIVE
public static final boolean DEFAULT_CACHE_ACTIVE- See Also:
-
DEFAULT_NEW_LINE_TRIMMING
public static final boolean DEFAULT_NEW_LINE_TRIMMING- See Also:
-
DEFAULT_AUTO_ESCAPING
public static final boolean DEFAULT_AUTO_ESCAPING- See Also:
-
DEFAULT_ESCAPING_STRATEGY
- See Also:
-
DEFAULT_STRICT_VARIABLES
public static final boolean DEFAULT_STRICT_VARIABLES- See Also:
-
DEFAULT_GREEDY_MATCH_METHOD
public static final boolean DEFAULT_GREEDY_MATCH_METHOD- See Also:
-
DEFAULT_ALLOW_OVERRIDE_CORE_OPERATORS
public static final boolean DEFAULT_ALLOW_OVERRIDE_CORE_OPERATORS- See Also:
-
DEFAULT_LITERAL_DECIMALS_AS_INTEGERS
public static final boolean DEFAULT_LITERAL_DECIMALS_AS_INTEGERS- See Also:
-
DEFAULT_LITERAL_NUMBERS_AS_BIG_DECIMALS
public static final boolean DEFAULT_LITERAL_NUMBERS_AS_BIG_DECIMALS- See Also:
-
-
Constructor Details
-
PebbleConfigurationProperties
public PebbleConfigurationProperties()
-
-
Method Details
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceio.micronaut.core.util.Toggleable
-
setEnabled
public void setEnabled(boolean enabled) Sets whether the component is enabled. Default value (true).- Parameters:
enabled
- Whether or not component is enabled
-
getDefaultExtension
- Specified by:
getDefaultExtension
in interfacePebbleConfiguration
- Returns:
- Gets
defaultExtension
property
-
setDefaultExtension
The default extension. Default value ("html").- Parameters:
defaultExtension
- The extension
-
isCacheActive
public boolean isCacheActive()- Specified by:
isCacheActive
in interfacePebbleConfiguration
- Returns:
- Gets
cacheActive
property
-
setCacheActive
public void setCacheActive(boolean cacheActive) Enable/disable all caches, i.e. cache used by the engine to store compiled PebbleTemplate instances and tags cache. Default value (true).- Parameters:
cacheActive
- toggle to enable/disable all caches
-
isNewLineTrimming
public boolean isNewLineTrimming()- Specified by:
isNewLineTrimming
in interfacePebbleConfiguration
- Returns:
- Gets
newLineTrimming
property
-
setNewLineTrimming
public void setNewLineTrimming(boolean newLineTrimming) Changes the newLineTrimming setting of the PebbleEngine. By default, Pebble will trim a new line that immediately follows a Pebble tag. If set to false, then the first newline following a Pebble tag won't be trimmed. All newlines will be preserved. Default value (true).- Parameters:
newLineTrimming
- Whether or not the newline should be trimmed.
-
isAutoEscaping
public boolean isAutoEscaping()- Specified by:
isAutoEscaping
in interfacePebbleConfiguration
- Returns:
- Gets
autoEscaping
property
-
setAutoEscaping
public void setAutoEscaping(boolean autoEscaping) Sets whether or not escaping should be performed automatically. Default value (true).- Parameters:
autoEscaping
- The auto escaping setting
-
getDefaultEscapingStrategy
- Specified by:
getDefaultEscapingStrategy
in interfacePebbleConfiguration
- Returns:
- Gets
defaultEscapingStrategy
property
-
setDefaultEscapingStrategy
Sets the default escaping strategy of the built-in escaper extension. Default value ("html").- Parameters:
defaultEscapingStrategy
- The name of the default escaping strategy
-
isStrictVariables
public boolean isStrictVariables()- Specified by:
isStrictVariables
in interfacePebbleConfiguration
- Returns:
- Gets
strictVariables
property
-
setStrictVariables
public void setStrictVariables(boolean strictVariables) Changes the strictVariables setting of the PebbleEngine. Default value (false).- Parameters:
strictVariables
- Whether or not strict variables is used
-
isGreedyMatchMethod
public boolean isGreedyMatchMethod()- Specified by:
isGreedyMatchMethod
in interfacePebbleConfiguration
- Returns:
- Gets
greedyMatchMethod
property
-
setGreedyMatchMethod
public void setGreedyMatchMethod(boolean greedyMatchMethod) Enable/disable greedy matching mode for finding java method. Default is disabled. If enabled, when can not find perfect method (method name, parameter length and parameter type are all satisfied), reduce the limit of the parameter type, try to find other method which has compatible parameter types. Default value (false).- Parameters:
greedyMatchMethod
- toggle to enable/disable greedy match method- See Also:
-
TypeUtils.compatibleCast(Object, Class)
-
isAllowOverrideCoreOperators
public boolean isAllowOverrideCoreOperators()- Specified by:
isAllowOverrideCoreOperators
in interfacePebbleConfiguration
- Returns:
- Gets
isAllowOverrideCoreOperators
property
-
setAllowOverrideCoreOperators
public void setAllowOverrideCoreOperators(boolean allowOverrideCoreOperators) Sets whether or not core operators overrides should be allowed. Default value (false).- Parameters:
allowOverrideCoreOperators
- Whether or not core operators overrides should be allowed.
-
isLiteralDecimalsAsIntegers
public boolean isLiteralDecimalsAsIntegers()- Specified by:
isLiteralDecimalsAsIntegers
in interfacePebbleConfiguration
- Returns:
- Gets
literalDecimalsAsInteger
property
-
setLiteralDecimalsAsIntegers
public void setLiteralDecimalsAsIntegers(boolean literalDecimalsAsIntegers) Enable/disable treat literal decimal as Integer. Default value (false), treated as Long.- Parameters:
literalDecimalsAsIntegers
- toggle to enable/disable literal decimal treated as integer
-
isLiteralNumbersAsBigDecimals
public boolean isLiteralNumbersAsBigDecimals()- Specified by:
isLiteralNumbersAsBigDecimals
in interfacePebbleConfiguration
- Returns:
- Gets
literalNumbersAsBigDecimals
property
-
setLiteralNumbersAsBigDecimals
public void setLiteralNumbersAsBigDecimals(boolean literalNumbersAsBigDecimals) Enable/disable treat literal numbers as BigDecimals. Default value (false), treated as Long/Double.- Parameters:
literalNumbersAsBigDecimals
- toggle to enable/disable literal numbers treated as BigDecimals
-