@SupportedValidationTarget(value=PARAMETERS) public class ParameterScriptAssertValidator extends Object implements ConstraintValidator<ParameterScriptAssert,Object[]>
ParameterScriptAssert
constraint annotation.Constructor and Description |
---|
ParameterScriptAssertValidator() |
Modifier and Type | Method and Description |
---|---|
void |
initialize(ParameterScriptAssert constraintAnnotation)
Initializes the validator in preparation for
ConstraintValidator.isValid(Object, ConstraintValidatorContext) calls. |
boolean |
isValid(Object[] arguments,
ConstraintValidatorContext constraintValidatorContext)
Implements the validation logic.
|
public void initialize(ParameterScriptAssert constraintAnnotation)
ConstraintValidator
ConstraintValidator.isValid(Object, ConstraintValidatorContext)
calls.
The constraint annotation for a given constraint declaration
is passed.
This method is guaranteed to be called before any use of this instance for
validation.initialize
in interface ConstraintValidator<ParameterScriptAssert,Object[]>
constraintAnnotation
- annotation instance for a given constraint declarationpublic boolean isValid(Object[] arguments, ConstraintValidatorContext constraintValidatorContext)
ConstraintValidator
value
must not be altered.
This method can be accessed concurrently, thread-safety must be ensured
by the implementation.isValid
in interface ConstraintValidator<ParameterScriptAssert,Object[]>
arguments
- object to validateconstraintValidatorContext
- context in which the constraint is evaluatedfalse
if value
does not pass the constraintCopyright © 2017 JBoss by Red Hat. All rights reserved.