public class ComponentValidator<T extends Component> extends java.lang.Object implements Validator<T>
Constructor and Description |
---|
ComponentValidator(ValidationRule... rules) |
Modifier and Type | Method and Description |
---|---|
static void |
assertNone(java.lang.String componentName,
ComponentList<?> components) |
static void |
assertOneOrLess(java.lang.String componentName,
ComponentList<?> components) |
void |
validate(T target)
Validates the associated model against an applicable standard.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
assertFalse
public ComponentValidator(ValidationRule... rules)
public void validate(T target) throws ValidationException
Validator
validate
in interface Validator<T extends Component>
ValidationException
- where the model does not confirm to the applicable standardpublic static void assertNone(java.lang.String componentName, ComponentList<?> components) throws ValidationException
componentName
- a component name used in the assertioncomponents
- a list of componentsValidationException
- where the assertion failspublic static void assertOneOrLess(java.lang.String componentName, ComponentList<?> components) throws ValidationException
componentName
- a component name used in the assertioncomponents
- a list of componentsValidationException
- where the assertion fails