Class SpelParserConfiguration
java.lang.Object
org.springframework.expression.spel.SpelParserConfiguration
Configuration object for the SpEL expression parser.
- Since:
- 3.0
- Author:
- Juergen Hoeller, Phillip Webb, Andy Clement, Sam Brannen
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default maximum length permitted for a SpEL expression.static final String
System property to configure the default compiler mode for SpEL expression parsers: "spring.expression.compiler.mode". -
Constructor Summary
ConstructorDescriptionCreate a newSpelParserConfiguration
instance with default settings.SpelParserConfiguration
(boolean autoGrowNullReferences, boolean autoGrowCollections) Create a newSpelParserConfiguration
instance.SpelParserConfiguration
(boolean autoGrowNullReferences, boolean autoGrowCollections, int maximumAutoGrowSize) Create a newSpelParserConfiguration
instance.SpelParserConfiguration
(SpelCompilerMode compilerMode, ClassLoader compilerClassLoader) Create a newSpelParserConfiguration
instance.SpelParserConfiguration
(SpelCompilerMode compilerMode, ClassLoader compilerClassLoader, boolean autoGrowNullReferences, boolean autoGrowCollections, int maximumAutoGrowSize) Create a newSpelParserConfiguration
instance.SpelParserConfiguration
(SpelCompilerMode compilerMode, ClassLoader compilerClassLoader, boolean autoGrowNullReferences, boolean autoGrowCollections, int maximumAutoGrowSize, int maximumExpressionLength) Create a newSpelParserConfiguration
instance. -
Method Summary
Modifier and TypeMethodDescriptionReturn the ClassLoader to use as the basis for expression compilation.Return the compiler mode for parsers using this configuration object.int
Return the maximum size that a collection can auto grow.int
Return the maximum number of characters that a SpEL expression can contain.boolean
Returntrue
if collections should be automatically grown.boolean
Returntrue
ifnull
references should be automatically grown.
-
Field Details
-
DEFAULT_MAX_EXPRESSION_LENGTH
public static final int DEFAULT_MAX_EXPRESSION_LENGTHDefault maximum length permitted for a SpEL expression.- Since:
- 5.2.24
- See Also:
-
SPRING_EXPRESSION_COMPILER_MODE_PROPERTY_NAME
System property to configure the default compiler mode for SpEL expression parsers: "spring.expression.compiler.mode".- See Also:
-
-
Constructor Details
-
SpelParserConfiguration
public SpelParserConfiguration()Create a newSpelParserConfiguration
instance with default settings. -
SpelParserConfiguration
public SpelParserConfiguration(@Nullable SpelCompilerMode compilerMode, @Nullable ClassLoader compilerClassLoader) Create a newSpelParserConfiguration
instance.- Parameters:
compilerMode
- the compiler mode for the parsercompilerClassLoader
- the ClassLoader to use as the basis for expression compilation
-
SpelParserConfiguration
public SpelParserConfiguration(boolean autoGrowNullReferences, boolean autoGrowCollections) Create a newSpelParserConfiguration
instance.- Parameters:
autoGrowNullReferences
- if null references should automatically growautoGrowCollections
- if collections should automatically grow- See Also:
-
SpelParserConfiguration
public SpelParserConfiguration(boolean autoGrowNullReferences, boolean autoGrowCollections, int maximumAutoGrowSize) Create a newSpelParserConfiguration
instance.- Parameters:
autoGrowNullReferences
- if null references should automatically growautoGrowCollections
- if collections should automatically growmaximumAutoGrowSize
- the maximum size that the collection can auto grow
-
SpelParserConfiguration
public SpelParserConfiguration(@Nullable SpelCompilerMode compilerMode, @Nullable ClassLoader compilerClassLoader, boolean autoGrowNullReferences, boolean autoGrowCollections, int maximumAutoGrowSize) Create a newSpelParserConfiguration
instance.- Parameters:
compilerMode
- the compiler mode that parsers using this configuration object should usecompilerClassLoader
- the ClassLoader to use as the basis for expression compilationautoGrowNullReferences
- if null references should automatically growautoGrowCollections
- if collections should automatically growmaximumAutoGrowSize
- the maximum size that the collection can auto grow
-
SpelParserConfiguration
public SpelParserConfiguration(@Nullable SpelCompilerMode compilerMode, @Nullable ClassLoader compilerClassLoader, boolean autoGrowNullReferences, boolean autoGrowCollections, int maximumAutoGrowSize, int maximumExpressionLength) Create a newSpelParserConfiguration
instance.- Parameters:
compilerMode
- the compiler mode that parsers using this configuration object should usecompilerClassLoader
- the ClassLoader to use as the basis for expression compilationautoGrowNullReferences
- if null references should automatically growautoGrowCollections
- if collections should automatically growmaximumAutoGrowSize
- the maximum size that a collection can auto growmaximumExpressionLength
- the maximum length of a SpEL expression; must be a positive number- Since:
- 5.2.25
-
-
Method Details
-
getCompilerMode
Return the compiler mode for parsers using this configuration object. -
getCompilerClassLoader
Return the ClassLoader to use as the basis for expression compilation. -
isAutoGrowNullReferences
public boolean isAutoGrowNullReferences()Returntrue
ifnull
references should be automatically grown. -
isAutoGrowCollections
public boolean isAutoGrowCollections()Returntrue
if collections should be automatically grown. -
getMaximumAutoGrowSize
public int getMaximumAutoGrowSize()Return the maximum size that a collection can auto grow. -
getMaximumExpressionLength
public int getMaximumExpressionLength()Return the maximum number of characters that a SpEL expression can contain.- Since:
- 5.2.25
-