public class ViolationCollector extends Object
| Constructor and Description |
|---|
ViolationCollector(javax.validation.ConstraintValidatorContext context) |
| Modifier and Type | Method and Description |
|---|---|
void |
addViolation(String message)
Adds a new violation to this collector.
|
void |
addViolation(String propertyName,
Integer index,
String message)
Adds a new violation to this collector.
|
void |
addViolation(String propertyName,
String message)
Adds a new violation to this collector.
|
void |
addViolation(String propertyName,
String key,
String message)
Adds a new violation to this collector.
|
javax.validation.ConstraintValidatorContext |
getContext()
This method returns the wrapped context for raw access to the validation framework.
|
boolean |
hasViolationOccurred() |
void |
setViolationOccurred(boolean violationOccurred)
Manually sets if a violation occurred.
|
public ViolationCollector(javax.validation.ConstraintValidatorContext context)
public void addViolation(String message)
violationOccurred to true.message - the message of the violation (any EL expression will be escaped and not parsed)public void addViolation(String propertyName, String message)
violationOccurred to true.propertyName - the name of the propertymessage - the message of the violation (any EL expression will be escaped and not parsed)public void addViolation(String propertyName, Integer index, String message)
violationOccurred to true.propertyName - the name of the property with the violationindex - the index of the element with the violationmessage - the message of the violation (any EL expression will be escaped and not parsed)public void addViolation(String propertyName, String key, String message)
violationOccurred to true.propertyName - the name of the property with the violationkey - the key of the element with the violationmessage - the message of the violation (any EL expression will be escaped and not parsed)public javax.validation.ConstraintValidatorContext getContext()
setViolationOccurred(true).public boolean hasViolationOccurred()
public void setViolationOccurred(boolean violationOccurred)
addViolation is called.violationOccurred - if any violation was collectedCopyright © 2020. All rights reserved.