Class ConstraintValidatorContextImpl.ConstraintViolationBuilderImpl
java.lang.Object
org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorContextImpl.ConstraintViolationBuilderImpl
- All Implemented Interfaces:
ConstraintValidatorContext.ConstraintViolationBuilder,HibernateConstraintViolationBuilder
- Enclosing class:
- ConstraintValidatorContextImpl
protected class ConstraintValidatorContextImpl.ConstraintViolationBuilderImpl
extends Object
implements HibernateConstraintViolationBuilder
-
Nested Class Summary
Nested classes/interfaces inherited from interface jakarta.validation.ConstraintValidatorContext.ConstraintViolationBuilder
ConstraintValidatorContext.ConstraintViolationBuilder.ContainerElementNodeBuilderCustomizableContext, ConstraintValidatorContext.ConstraintViolationBuilder.ContainerElementNodeBuilderDefinedContext, ConstraintValidatorContext.ConstraintViolationBuilder.ContainerElementNodeContextBuilder, ConstraintValidatorContext.ConstraintViolationBuilder.LeafNodeBuilderCustomizableContext, ConstraintValidatorContext.ConstraintViolationBuilder.LeafNodeBuilderDefinedContext, ConstraintValidatorContext.ConstraintViolationBuilder.LeafNodeContextBuilder, ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderCustomizableContext, ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderDefinedContext, ConstraintValidatorContext.ConstraintViolationBuilder.NodeContextBuilder -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ExpressionLanguageFeatureLevelprotected final Stringprotected PathImpl -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstraintViolationBuilderImpl(String template, PathImpl path) -
Method Summary
Modifier and TypeMethodDescriptionAdds a bean node (class-level) to the path theConstraintViolationwill be associated to.ConstraintValidatorContext.ConstraintViolationBuilder.ContainerElementNodeBuilderCustomizableContextaddContainerElementNode(String name, Class<?> containerType, Integer typeArgumentIndex) Adds a container element node to the path theConstraintViolationwill be associated to.Deprecated.addParameterNode(int index) Adds a method parameter node to the path theConstraintViolationwill be associated to.addPropertyNode(String name) Adds a property node to the path theConstraintViolationwill be associated to.enableExpressionLanguage(ExpressionLanguageFeatureLevel expressionLanguageFeatureLevel) Enable Expression Language for the constraint violation created by this builder if the chosenMessageInterpolatorsupports it.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.validation.ConstraintValidatorContext.ConstraintViolationBuilder
addConstraintViolationMethods inherited from interface org.hibernate.validator.constraintvalidation.HibernateConstraintViolationBuilder
enableExpressionLanguage
-
Field Details
-
messageTemplate
-
expressionLanguageFeatureLevel
-
propertyPath
-
-
Constructor Details
-
ConstraintViolationBuilderImpl
-
-
Method Details
-
enableExpressionLanguage
public HibernateConstraintViolationBuilder enableExpressionLanguage(ExpressionLanguageFeatureLevel expressionLanguageFeatureLevel) Description copied from interface:HibernateConstraintViolationBuilderEnable Expression Language for the constraint violation created by this builder if the chosenMessageInterpolatorsupports it.If you enable this, you need to make sure your message template does not contain any unescaped user input (such as the validated value): use
addExpressionVariable()to inject properly escaped variables into the template.- Specified by:
enableExpressionLanguagein interfaceHibernateConstraintViolationBuilder- Parameters:
expressionLanguageFeatureLevel- The Expression Language features level supported.
-
addNode
@Deprecated public ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderDefinedContext addNode(String name) Deprecated.Description copied from interface:ConstraintValidatorContext.ConstraintViolationBuilderAdds a node to the path theConstraintViolationwill be associated to.namedescribes a single property. In particular, dot (.) is not allowed.- Specified by:
addNodein interfaceConstraintValidatorContext.ConstraintViolationBuilder- Parameters:
name- property name- Returns:
- a builder representing node
name
-
addPropertyNode
public ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderCustomizableContext addPropertyNode(String name) Description copied from interface:ConstraintValidatorContext.ConstraintViolationBuilderAdds a property node to the path theConstraintViolationwill be associated to.namedescribes a single property. In particular, dot (.) is not allowed.- Specified by:
addPropertyNodein interfaceConstraintValidatorContext.ConstraintViolationBuilder- Parameters:
name- property name- Returns:
- a builder representing node
name
-
addBeanNode
public ConstraintValidatorContext.ConstraintViolationBuilder.LeafNodeBuilderCustomizableContext addBeanNode()Description copied from interface:ConstraintValidatorContext.ConstraintViolationBuilderAdds a bean node (class-level) to the path theConstraintViolationwill be associated to. Note that bean nodes are always leaf nodes.- Specified by:
addBeanNodein interfaceConstraintValidatorContext.ConstraintViolationBuilder- Returns:
- a builder representing the bean node
-
addParameterNode
public ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderDefinedContext addParameterNode(int index) Description copied from interface:ConstraintValidatorContext.ConstraintViolationBuilderAdds a method parameter node to the path theConstraintViolationwill be associated to. The parameter index must be valid (i.e. within the boundaries of the method parameter indexes). May only be called from within cross-parameter validators.- Specified by:
addParameterNodein interfaceConstraintValidatorContext.ConstraintViolationBuilder- Parameters:
index- the parameter index- Returns:
- a builder representing the index-th parameter node
-
addContainerElementNode
public ConstraintValidatorContext.ConstraintViolationBuilder.ContainerElementNodeBuilderCustomizableContext addContainerElementNode(String name, Class<?> containerType, Integer typeArgumentIndex) Description copied from interface:ConstraintValidatorContext.ConstraintViolationBuilderAdds a container element node to the path theConstraintViolationwill be associated to.- Specified by:
addContainerElementNodein interfaceConstraintValidatorContext.ConstraintViolationBuilder- Parameters:
name- the node namecontainerType- the type of the containertypeArgumentIndex- the index of the type argument- Returns:
- a builder representing the container element node
-
addConstraintViolation
-