Top Description Fields Constructors Methods
org.hibernate.validator.messageinterpolation

public final Enum ExpressionLanguageFeatureLevel

extends Enum<ExpressionLanguageFeatureLevel>
Class Inheritance
Annotations
@Incubating
Imports
org.hibernate.validator.Incubating, org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorContext

Indicates the level of features enabled for the Expression Language engine.
Since
6.2

Field Summary

Modifier and TypeField and Description
public static final ExpressionLanguageFeatureLevel
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.

public static final ExpressionLanguageFeatureLevel
BEAN_PROPERTIES

Only allows to what is allowed with the variables level plus access to bean properties.

public static final ExpressionLanguageFeatureLevel
DEFAULT

The default Expression Language feature level.

private final String
public static final ExpressionLanguageFeatureLevel
NONE

Expression Language expressions are not interpolated.

public static final ExpressionLanguageFeatureLevel
VARIABLES

Only allows access to the variables injected via HibernateConstraintValidatorContext#addExpressionVariable(String, Object), the Jakarta Bean Validation-defined formatter and the ResourceBundles.

Constructor Summary

AccessConstructor and Description
private
ExpressionLanguageFeatureLevel(String externalRepresentation)

Method Summary

Modifier and TypeMethod and Description
public static ExpressionLanguageFeatureLevel
public static ExpressionLanguageFeatureLevel
public static ExpressionLanguageFeatureLevel
of(String value)

public static ExpressionLanguageFeatureLevel
public static ExpressionLanguageFeatureLevel[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BEAN_METHODSback to summary
public static final ExpressionLanguageFeatureLevel 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.

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).

BEAN_PROPERTIESback to summary
public static final ExpressionLanguageFeatureLevel BEAN_PROPERTIES

Only allows to what is allowed with the variables level plus access to bean properties.

This is the minimal level to have a specification-compliant implementation.

DEFAULTback to summary
public static final ExpressionLanguageFeatureLevel DEFAULT

The default Expression Language feature level.

Depends on the context.

For standard constraint messages, it is ExpressionLanguageFeatureLevel#BEAN_PROPERTIES.

For custom violations, the default is ExpressionLanguageFeatureLevel#NONE and, if Expression Language is enabled for a given custom violation via the API, the default becomes ExpressionLanguageFeatureLevel#VARIABLES in the context of this given custom violation.

externalRepresentationback to summary
private final String externalRepresentation
NONEback to summary
public static final ExpressionLanguageFeatureLevel NONE

Expression Language expressions are not interpolated.

VARIABLESback to summary
public static final ExpressionLanguageFeatureLevel VARIABLES

Only allows access to the variables injected via HibernateConstraintValidatorContext#addExpressionVariable(String, Object), the Jakarta Bean Validation-defined formatter and the ResourceBundles.

Constructor Detail

ExpressionLanguageFeatureLevelback to summary
private ExpressionLanguageFeatureLevel(String externalRepresentation)

Method Detail

interpretDefaultForConstraintsback to summary
public static ExpressionLanguageFeatureLevel interpretDefaultForConstraints(ExpressionLanguageFeatureLevel value)
interpretDefaultForCustomViolationsback to summary
public static ExpressionLanguageFeatureLevel interpretDefaultForCustomViolations(ExpressionLanguageFeatureLevel value)
ofback to summary
public static ExpressionLanguageFeatureLevel of(String value)
valueOfback to summary
public static ExpressionLanguageFeatureLevel valueOf(String name)
valuesback to summary
public static ExpressionLanguageFeatureLevel[] values()