Class ValidatorFactory
java.lang.Object
net.sourceforge.jbizmo.commons.validation.util.validator.ValidatorFactory
A factory (registry) for validators of annotation-based constraints. This is a singleton for providing a single access point to the registered validators. Note that this class is thread safe.
Copyright 2010 (C) by Martin Ganserer
- Version:
- 1.0.0
- Author:
- Martin Ganserer
-
Method Summary
Modifier and TypeMethodDescriptionstatic ValidatorFactorygetValidatorFor(Class<? extends Annotation> constraintType) Get the validator for the given constraint type or null if there is no registered validatorvoidregister(Class<? extends Annotation> constraintType, ConstraintValidator validator) Register a validator
-
Method Details
-
getInstance
- Returns:
- the singleton instance
-
getValidatorFor
Get the validator for the given constraint type or null if there is no registered validator- Parameters:
constraintType-- Returns:
- the validator
-
register
Register a validator- Parameters:
constraintType-validator-
-