Constructor and Description |
---|
ValidatorFactory(ValidatorProvider validatorProvider,
ObjectAccessorProvider objectAccessorProvider)
Constructs a new
ValidatorFactory . |
Modifier and Type | Method and Description |
---|---|
Validator |
createContextualValidator(Class<?> objectType,
Field field,
Annotation contextAnnotation,
Class<? extends Annotation> dataTypeAnnotationType)
Creates a contextual validator for the given object type.
|
Validator |
createValidator(Class<?> objectType,
Class<? extends Annotation>... fieldAnnotationTypes)
Creates a context free validator for the given object type.
|
public ValidatorFactory(ValidatorProvider validatorProvider, ObjectAccessorProvider objectAccessorProvider)
ValidatorFactory
.validatorProvider
- the validator providerobjectAccessorProvider
- the object accessor providerpublic Validator createContextualValidator(Class<?> objectType, Field field, Annotation contextAnnotation, Class<? extends Annotation> dataTypeAnnotationType)
objectType
- the object type to create a validator forfield
- the field to create a contextual validator for (may be null)contextAnnotation
- the annotation providing parameters for constructing the validatordataTypeAnnotationType
- the type of the data type annotation providing default parameters for
constructing the validatorpublic Validator createValidator(Class<?> objectType, Class<? extends Annotation>... fieldAnnotationTypes)
objectType
- the object type to create a validator forfieldAnnotationTypes
- the possible annotation types for the fields of the given object type providing
parameters for constructing the validatorCopyright © 2014. All rights reserved.