Class SpelParserConfiguration.Builder
- Enclosing class:
SpelParserConfiguration
SpelParserConfiguration.
Each property defaults to the same value as the corresponding
property in a SpelParserConfiguration created via the
no-arg constructor
— including honoring the system properties or Spring properties named
"spring.expression.compiler.mode",
"spring.expression.maxOperations", and
"spring.expression.maxBigPowerBits" — with
one exception: maximumAutoGrowSize
defaults to 256 rather than Integer.MAX_VALUE, for
consistency with the default auto-grow limit used for Spring's data
binding support (see DataBinder.DEFAULT_AUTO_GROW_COLLECTION_LIMIT).
Only configure the properties that need to deviate from those defaults.
- Since:
- 7.0.10
- Author:
- Juergen Hoeller, Phillip Webb, Andy Clement, Sam Brannen
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionEnable automatic growth of collections and arrays encountered while traversing a property path.Enable automatic growth ofnullreferences encountered while traversing a property path.build()Build theSpelParserConfigurationconfigured via this builder.compilerClassLoader(@Nullable ClassLoader compilerClassLoader) Set theClassLoaderto use as the basis for expression compilation.compilerMode(SpelCompilerMode compilerMode) Set the compiler mode that parsers using this configuration should use.maximumAutoGrowSize(int maximumAutoGrowSize) Set the maximum size to which a collection or array can automatically grow.maximumBigPowerBits(int maximumBigPowerBits) Set the maximum number of bits permitted in the result of aBigDecimalorBigIntegerpower operation within a SpEL expression.maximumExpressionLength(int maximumExpressionLength) Set the maximum length permitted for a SpEL expression.maximumOperations(int maximumOperations) Set the maximum number of operations permitted during SpEL expression evaluation.
-
Method Details
-
compilerMode
Set the compiler mode that parsers using this configuration should use.By default, set to the value configured via
SpringPropertiesfor a system property or Spring property named "spring.expression.compiler.mode", orSpelCompilerMode.OFFif that property is not set.- Parameters:
compilerMode- the compiler mode to use; must not benull
-
compilerClassLoader
public SpelParserConfiguration.Builder compilerClassLoader(@Nullable ClassLoader compilerClassLoader) Set theClassLoaderto use as the basis for expression compilation.By default, set to
null, indicating that the defaultClassLoadershould be used.- Parameters:
compilerClassLoader- theClassLoaderto use
-
autoGrowNullReferences
Enable automatic growth ofnullreferences encountered while traversing a property path.By default, this is disabled.
-
autoGrowCollections
Enable automatic growth of collections and arrays encountered while traversing a property path.By default, this is disabled.
- See Also:
-
maximumAutoGrowSize
Set the maximum size to which a collection or array can automatically grow.By default, set to
256, for consistency with the default auto-grow limit used for Spring's data binding support (seeDataBinder.DEFAULT_AUTO_GROW_COLLECTION_LIMIT) — unlike the constructors inSpelParserConfiguration, which default toInteger.MAX_VALUE(effectively unbounded) for backward compatibility.- Parameters:
maximumAutoGrowSize- the maximum auto-grow size; must not be negative, and a value of0effectively disables growing a collection or array beyond its current size- See Also:
-
maximumExpressionLength
Set the maximum length permitted for a SpEL expression.By default, set to
SpelParserConfiguration.DEFAULT_MAX_EXPRESSION_LENGTH.- Parameters:
maximumExpressionLength- the maximum expression length; must be a positive number
-
maximumOperations
Set the maximum number of operations permitted during SpEL expression evaluation.By default, set to the value configured via
SpringPropertiesfor a system property or Spring property named "spring.expression.maxOperations", orSpelParserConfiguration.DEFAULT_MAX_OPERATIONSif that property is not set.- Parameters:
maximumOperations- the maximum number of operations; must be a positive number
-
maximumBigPowerBits
Set the maximum number of bits permitted in the result of aBigDecimalorBigIntegerpower operation within a SpEL expression.By default, set to the value configured via
SpringPropertiesfor a system property or Spring property named "spring.expression.maxBigPowerBits", orSpelParserConfiguration.DEFAULT_MAX_BIG_POWER_BITSif that property is not set.- Parameters:
maximumBigPowerBits- the maximum number of bits; must be a positive number; useInteger.MAX_VALUEfor no limit
-
build
Build theSpelParserConfigurationconfigured via this builder.
-