public class ScriptAssertValidator extends AbstractScriptAssertValidator<ScriptAssert,Object>
ScriptAssert
constraint annotation.escapedScript, languageName, script, scriptAssertContext
Constructor and Description |
---|
ScriptAssertValidator() |
Modifier and Type | Method and Description |
---|---|
void |
initialize(ConstraintDescriptor<ScriptAssert> constraintDescriptor,
HibernateConstraintValidatorInitializationContext initializationContext)
Initializes the validator in preparation for
ConstraintValidator.isValid(Object, ConstraintValidatorContext) calls. |
boolean |
isValid(Object value,
ConstraintValidatorContext constraintValidatorContext)
Implements the validation logic.
|
initialize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initialize
public void initialize(ConstraintDescriptor<ScriptAssert> constraintDescriptor, HibernateConstraintValidatorInitializationContext initializationContext)
HibernateConstraintValidator
ConstraintValidator.isValid(Object, ConstraintValidatorContext)
calls.
It is an alternative to ConstraintValidator.initialize(Annotation)
method. Should be used if any additional information
except annotation is needed to initialize a validator.
Note, when using HibernateConstraintValidator
user should only override one of the methods, either
HibernateConstraintValidator.initialize(ConstraintDescriptor, HibernateConstraintValidatorInitializationContext)
or ConstraintValidator.initialize(Annotation)
.
Both methods will be called during initialization, starting with
HibernateConstraintValidator.initialize(ConstraintDescriptor, HibernateConstraintValidatorInitializationContext)
.constraintDescriptor
- a constraint descriptor for a given constraint declarationinitializationContext
- an initialization context for a current ConstraintValidatorFactory
public boolean isValid(Object value, ConstraintValidatorContext constraintValidatorContext)
ConstraintValidator
value
must not be altered.
This method can be accessed concurrently, thread-safety must be ensured by the implementation.
value
- object to validateconstraintValidatorContext
- context in which the constraint is evaluatedfalse
if value
does not pass the constraintCopyright © 2021 JBoss by Red Hat. All rights reserved.