@Profile(value="resthub-validation") @Named(value="validationService") public class ValidationServiceImpl extends Object implements ValidationService
ValidationService
.
This implementation relies on BeanValidation standard but is Validation framework agnostic.
This service is defined under the "resthub-validation" Spring profile and can be activated by adding this
profile to your context.ValidationService
Constructor and Description |
---|
ValidationServiceImpl() |
Modifier and Type | Method and Description |
---|---|
ModelConstraint |
getConstraintsForClass(Class<?> clazz)
Find validation constraints for a model class and return their representation
|
ModelConstraint |
getConstraintsForClass(Class<?> clazz,
Locale locale)
Find validation constraints for a model class and return their representation.
|
ModelConstraint |
getConstraintsForClassName(String canonicalClassName)
Find validation constraints for a model class name and return their representation
|
ModelConstraint |
getConstraintsForClassName(String canonicalClassName,
Locale locale)
Find validation constraints for a model class name and return their representation.
|
public ModelConstraint getConstraintsForClassName(String canonicalClassName) throws ClassNotFoundException
getConstraintsForClassName
in interface ValidationService
canonicalClassName
- complete class name of the model to findModelConstraint
wrapper containing all validation
constraints retrieved for the given canonicalClassNameClassNotFoundException
- if canonicalClassName does not match any classpublic ModelConstraint getConstraintsForClassName(String canonicalClassName, Locale locale) throws ClassNotFoundException
getConstraintsForClassName
in interface ValidationService
canonicalClassName
- complete class name of the model to findlocale
- Locale
object used to resolve localized messages, if anyModelConstraint
wrapper containing all validation
constraints retrieved for the given canonicalClassNameClassNotFoundException
- if canonicalClassName does not match any classpublic ModelConstraint getConstraintsForClass(Class<?> clazz)
getConstraintsForClass
in interface ValidationService
clazz
- class of the model to findModelConstraint
wrapper containing all validation
constraints retrieved for the given clazzpublic ModelConstraint getConstraintsForClass(Class<?> clazz, Locale locale)
getConstraintsForClass
in interface ValidationService
clazz
- class of the model to findlocale
- Locale
object used to resolve localized messages, if anyModelConstraint
wrapper containing all validation
constraints retrieved for the given clazzCopyright © 2009–2014. All rights reserved.