Enum Class ExpressionLanguageFeatureLevel
java.lang.Object
java.lang.Enum<ExpressionLanguageFeatureLevel>
org.hibernate.validator.messageinterpolation.ExpressionLanguageFeatureLevel
- All Implemented Interfaces:
Serializable
,Comparable<ExpressionLanguageFeatureLevel>
,Constable
Indicates the level of features enabled for the Expression Language engine.
- Since:
- 6.2
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThis level allows what is allowed with thebean-properties
level plus bean methods execution and can lead to serious security issues, including arbitrary code execution, if not very carefully handled.Only allows to what is allowed with thevariables
level plus access to bean properties.The default Expression Language feature level.Expression Language expressions are not interpolated.Only allows access to the variables injected viaHibernateConstraintValidatorContext.addExpressionVariable(String, Object)
, the Jakarta Bean Validation-definedformatter
and theResourceBundle
s. -
Method Summary
Modifier and TypeMethodDescriptionReturns the enum constant of this class with the specified name.static ExpressionLanguageFeatureLevel[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
The default Expression Language feature level.Depends on the context.
For standard constraint messages, it is
BEAN_PROPERTIES
.For custom violations, the default is
NONE
and, if Expression Language is enabled for a given custom violation via the API, the default becomesVARIABLES
in the context of this given custom violation. -
NONE
Expression Language expressions are not interpolated. -
VARIABLES
Only allows access to the variables injected viaHibernateConstraintValidatorContext.addExpressionVariable(String, Object)
, the Jakarta Bean Validation-definedformatter
and theResourceBundle
s. -
BEAN_PROPERTIES
Only allows to what is allowed with thevariables
level plus access to bean properties.This is the minimal level to have a specification-compliant implementation.
-
BEAN_METHODS
This level allows what is allowed with thebean-properties
level plus bean methods execution and can lead to serious security issues, including arbitrary code execution, if not very carefully handled.If using this level, you need to be sure you are not injecting user input in an expression without properly escaping it using
HibernateConstraintValidatorContext.addExpressionVariable(String, Object)
.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
of
-
interpretDefaultForConstraints
public static ExpressionLanguageFeatureLevel interpretDefaultForConstraints(ExpressionLanguageFeatureLevel value) -
interpretDefaultForCustomViolations
public static ExpressionLanguageFeatureLevel interpretDefaultForCustomViolations(ExpressionLanguageFeatureLevel value)
-