Enum Class MessageParameterEscaping
java.lang.Object
java.lang.Enum<MessageParameterEscaping>
org.hibernate.validator.messageinterpolation.MessageParameterEscaping
- All Implemented Interfaces:
Serializable, Comparable<MessageParameterEscaping>, Constable
Defines whether message parameters should be escaped to prevent injection into message interpolation expressions.
- Since:
- 9.1
-
Nested Class Summary
Nested classes/interfaces declared in class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionabstract Objectstatic MessageParameterEscapingstatic MessageParameterEscapingReturns the enum constant of this class with the specified name.static MessageParameterEscaping[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ESCAPE
Message parameter values are escaped before being stored.This is the default behavior. The value is converted to its string representation and characters that have special meaning in message interpolation (
\,{,},$) are escaped to prevent injection. -
NONE
Message parameter values are stored as-is, without any escaping.Use this when the value is already escaped or when you are certain it does not contain characters that could be interpreted during message interpolation. Or when the value can and will be interpolated, but that is your intention to do so.
-
-
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
-
apply
-
of
-