public class AndValidator extends Object implements JobEntryValidator
false is immediately returned. The
validators list (a List<JobEntryValidator>) should be stored under the KEY_VALIDATORS
key.| Modifier and Type | Field and Description |
|---|---|
static AndValidator |
INSTANCE |
KEY_LEVEL_ON_FAIL| Constructor and Description |
|---|
AndValidator() |
| Modifier and Type | Method and Description |
|---|---|
String |
getKeyValidators() |
String |
getName()
Returns the name of this validator, unique among all validators.
|
static ValidatorContext |
putValidators(JobEntryValidator... validators)
Uses varargs to conveniently add validators to the list of validators consumed by
AndValidator. |
static void |
putValidators(ValidatorContext context,
JobEntryValidator... validators)
Uses varargs to conveniently add validators to the list of validators consumed by
AndValidator. |
boolean |
validate(CheckResultSourceInterface source,
String propertyName,
List<CheckResultInterface> remarks,
ValidatorContext context)
Using reflection, the validator fetches the field named
propertyName from the bean source
and runs the validation putting any messages into remarks. |
public static final AndValidator INSTANCE
public boolean validate(CheckResultSourceInterface source, String propertyName, List<CheckResultInterface> remarks, ValidatorContext context)
JobEntryValidatorpropertyName from the bean source
and runs the validation putting any messages into remarks. The return value is true if
the validation passes.validate in interface JobEntryValidatorsource - bean to validatepropertyName - property to validateremarks - list to which to add messagescontext - any other information needed to perform the validationpublic String getName()
JobEntryValidatorgetName in interface JobEntryValidatorpublic String getKeyValidators()
public static ValidatorContext putValidators(JobEntryValidator... validators)
AndValidator. This
method creates and returns a new context.public static void putValidators(ValidatorContext context, JobEntryValidator... validators)
AndValidator. This
method adds to an existing map.putValidators(JobEntryValidator[])Copyright © 2018 Hitachi Vantara. All rights reserved.