@Incubating public enum ExpressionLanguageFeatureLevel extends Enum<ExpressionLanguageFeatureLevel>
Enum Constant and Description |
---|
BEAN_METHODS
This level allows what is allowed with the
bean-properties level plus bean methods execution and can lead
to serious security issues, including arbitrary code execution, if not very carefully handled. |
BEAN_PROPERTIES
Only allows to what is allowed with the
variables level plus access to bean properties. |
DEFAULT
The default Expression Language feature level.
|
NONE
Expression Language expressions are not interpolated.
|
VARIABLES
Only allows access to the variables injected via
HibernateConstraintValidatorContext.addExpressionVariable(String, Object) , the Jakarta Bean
Validation-defined formatter and the ResourceBundle s. |
Modifier and Type | Method and Description |
---|---|
static ExpressionLanguageFeatureLevel |
interpretDefaultForConstraints(ExpressionLanguageFeatureLevel value) |
static ExpressionLanguageFeatureLevel |
interpretDefaultForCustomViolations(ExpressionLanguageFeatureLevel value) |
static ExpressionLanguageFeatureLevel |
of(String value) |
static ExpressionLanguageFeatureLevel |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ExpressionLanguageFeatureLevel[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ExpressionLanguageFeatureLevel DEFAULT
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 becomes
VARIABLES
in the context of this given custom violation.
public static final ExpressionLanguageFeatureLevel NONE
public static final ExpressionLanguageFeatureLevel VARIABLES
HibernateConstraintValidatorContext.addExpressionVariable(String, Object)
, the Jakarta Bean
Validation-defined formatter
and the ResourceBundle
s.public static final ExpressionLanguageFeatureLevel BEAN_PROPERTIES
variables
level plus access to bean properties.
This is the minimal level to have a specification-compliant implementation.
public static final ExpressionLanguageFeatureLevel BEAN_METHODS
bean-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)
.
public static ExpressionLanguageFeatureLevel[] values()
for (ExpressionLanguageFeatureLevel c : ExpressionLanguageFeatureLevel.values()) System.out.println(c);
public static ExpressionLanguageFeatureLevel valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static ExpressionLanguageFeatureLevel of(String value)
public static ExpressionLanguageFeatureLevel interpretDefaultForConstraints(ExpressionLanguageFeatureLevel value)
public static ExpressionLanguageFeatureLevel interpretDefaultForCustomViolations(ExpressionLanguageFeatureLevel value)
Copyright © 2007-2021 Red Hat, Inc. All Rights Reserved