Top Description Fields Constructors Methods
org.springframework.expression.spel

public Class SpelParserConfiguration

extends Object
Class Inheritance
Imports
org.springframework.core.SpringProperties, org.springframework.lang.Nullable

Configuration object for the SpEL expression parser.
Authors
Juergen Hoeller, Phillip Webb, Andy Clement, Sam Brannen
Since
3.0
See Also
org.springframework.expression.spel.standard.SpelExpressionParser#SpelExpressionParser(SpelParserConfiguration)

Field Summary

Modifier and TypeField and Description
private final boolean
private final boolean
private final ClassLoader
private final SpelCompilerMode
public static final int
DEFAULT_MAX_EXPRESSION_LENGTH

Default maximum length permitted for a SpEL expression.

private static final SpelCompilerMode
private final int
private final int
public static final String
SPRING_EXPRESSION_COMPILER_MODE_PROPERTY_NAME

System property to configure the default compiler mode for SpEL expression parsers: spring.expression.compiler.mode.

Constructor Summary

AccessConstructor and Description
public
SpelParserConfiguration()

Create a new SpelParserConfiguration instance with default settings.

public
SpelParserConfiguration(SpelCompilerMode
the compiler mode for the parser
compilerMode
,
ClassLoader
the ClassLoader to use as the basis for expression compilation
compilerClassLoader
)

Create a new SpelParserConfiguration instance.

public
SpelParserConfiguration(boolean
if null references should automatically grow
autoGrowNullReferences
,
boolean
if collections should automatically grow
autoGrowCollections
)

Create a new SpelParserConfiguration instance.

public
SpelParserConfiguration(boolean
if null references should automatically grow
autoGrowNullReferences
,
boolean
if collections should automatically grow
autoGrowCollections
,
int
the maximum size that the collection can auto grow
maximumAutoGrowSize
)

Create a new SpelParserConfiguration instance.

public
SpelParserConfiguration(SpelCompilerMode
the compiler mode that parsers using this configuration object should use
compilerMode
,
ClassLoader
the ClassLoader to use as the basis for expression compilation
compilerClassLoader
,
boolean
if null references should automatically grow
autoGrowNullReferences
,
boolean
if collections should automatically grow
autoGrowCollections
,
int
the maximum size that the collection can auto grow
maximumAutoGrowSize
)

Create a new SpelParserConfiguration instance.

public
SpelParserConfiguration(SpelCompilerMode
the compiler mode that parsers using this configuration object should use
compilerMode
,
ClassLoader
the ClassLoader to use as the basis for expression compilation
compilerClassLoader
,
boolean
if null references should automatically grow
autoGrowNullReferences
,
boolean
if collections should automatically grow
autoGrowCollections
,
int
the maximum size that a collection can auto grow
maximumAutoGrowSize
,
int
the maximum length of a SpEL expression; must be a positive number
maximumExpressionLength
)

Create a new SpelParserConfiguration instance.

Method Summary

Modifier and TypeMethod and Description
public ClassLoader
getCompilerClassLoader()

Return the ClassLoader to use as the basis for expression compilation.

public SpelCompilerMode
getCompilerMode()

Return the compiler mode for parsers using this configuration object.

public int
getMaximumAutoGrowSize()

Return the maximum size that a collection can auto grow.

public int
getMaximumExpressionLength()

Return the maximum number of characters that a SpEL expression can contain.

public boolean
isAutoGrowCollections()

Return true if collections should be automatically grown.

public boolean
isAutoGrowNullReferences()

Return true if null references should be automatically grown.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

autoGrowCollectionsback to summary
private final boolean autoGrowCollections
autoGrowNullReferencesback to summary
private final boolean autoGrowNullReferences
compilerClassLoaderback to summary
private final ClassLoader compilerClassLoader
Annotations
@Nullable
compilerModeback to summary
private final SpelCompilerMode compilerMode
DEFAULT_MAX_EXPRESSION_LENGTHback to summary
public static final int DEFAULT_MAX_EXPRESSION_LENGTH

Default maximum length permitted for a SpEL expression.

Since
5.2.24
defaultCompilerModeback to summary
private static final SpelCompilerMode defaultCompilerMode
maximumAutoGrowSizeback to summary
private final int maximumAutoGrowSize
maximumExpressionLengthback to summary
private final int maximumExpressionLength
SPRING_EXPRESSION_COMPILER_MODE_PROPERTY_NAMEback to summary
public static final String SPRING_EXPRESSION_COMPILER_MODE_PROPERTY_NAME

System property to configure the default compiler mode for SpEL expression parsers: spring.expression.compiler.mode.

Constructor Detail

SpelParserConfigurationback to summary
public SpelParserConfiguration()

Create a new SpelParserConfiguration instance with default settings.

SpelParserConfigurationback to summary
public SpelParserConfiguration(SpelCompilerMode compilerMode, ClassLoader compilerClassLoader)

Create a new SpelParserConfiguration instance.

Parameters
compilerMode:SpelCompilerMode

the compiler mode for the parser

compilerClassLoader:ClassLoader

the ClassLoader to use as the basis for expression compilation

SpelParserConfigurationback to summary
public SpelParserConfiguration(boolean autoGrowNullReferences, boolean autoGrowCollections)

Create a new SpelParserConfiguration instance.

Parameters
autoGrowNullReferences:boolean

if null references should automatically grow

autoGrowCollections:boolean

if collections should automatically grow

See Also
SpelParserConfiguration(boolean, boolean, int)
SpelParserConfigurationback to summary
public SpelParserConfiguration(boolean autoGrowNullReferences, boolean autoGrowCollections, int maximumAutoGrowSize)

Create a new SpelParserConfiguration instance.

Parameters
autoGrowNullReferences:boolean

if null references should automatically grow

autoGrowCollections:boolean

if collections should automatically grow

maximumAutoGrowSize:int

the maximum size that the collection can auto grow

SpelParserConfigurationback to summary
public SpelParserConfiguration(SpelCompilerMode compilerMode, ClassLoader compilerClassLoader, boolean autoGrowNullReferences, boolean autoGrowCollections, int maximumAutoGrowSize)

Create a new SpelParserConfiguration instance.

Parameters
compilerMode:SpelCompilerMode

the compiler mode that parsers using this configuration object should use

compilerClassLoader:ClassLoader

the ClassLoader to use as the basis for expression compilation

autoGrowNullReferences:boolean

if null references should automatically grow

autoGrowCollections:boolean

if collections should automatically grow

maximumAutoGrowSize:int

the maximum size that the collection can auto grow

SpelParserConfigurationback to summary
public SpelParserConfiguration(SpelCompilerMode compilerMode, ClassLoader compilerClassLoader, boolean autoGrowNullReferences, boolean autoGrowCollections, int maximumAutoGrowSize, int maximumExpressionLength)

Create a new SpelParserConfiguration instance.

Parameters
compilerMode:SpelCompilerMode

the compiler mode that parsers using this configuration object should use

compilerClassLoader:ClassLoader

the ClassLoader to use as the basis for expression compilation

autoGrowNullReferences:boolean

if null references should automatically grow

autoGrowCollections:boolean

if collections should automatically grow

maximumAutoGrowSize:int

the maximum size that a collection can auto grow

maximumExpressionLength:int

the maximum length of a SpEL expression; must be a positive number

Since
5.2.25

Method Detail

getCompilerClassLoaderback to summary
public ClassLoader getCompilerClassLoader()

Return the ClassLoader to use as the basis for expression compilation.

Annotations
@Nullable
getCompilerModeback to summary
public SpelCompilerMode getCompilerMode()

Return the compiler mode for parsers using this configuration object.

getMaximumAutoGrowSizeback to summary
public int getMaximumAutoGrowSize()

Return the maximum size that a collection can auto grow.

getMaximumExpressionLengthback to summary
public int getMaximumExpressionLength()

Return the maximum number of characters that a SpEL expression can contain.

Since
5.2.25
isAutoGrowCollectionsback to summary
public boolean isAutoGrowCollections()

Return true if collections should be automatically grown.

isAutoGrowNullReferencesback to summary
public boolean isAutoGrowNullReferences()

Return true if null references should be automatically grown.