fr.paris.lutece.util.beanvalidation
Class BeanValidationUtil

java.lang.Object
  extended by fr.paris.lutece.util.beanvalidation.BeanValidationUtil

public final class BeanValidationUtil
extends java.lang.Object

BeanValidationUtils validates beans using JSR303 annotations.

See Also:
validate(Object)

Method Summary
static javax.validation.Validator getValidator()
          Use this in case you need more than a global validation
static
<T> java.util.Set<javax.validation.ConstraintViolation<T>>
validate(T bean)
          Validates a bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

validate

public static <T> java.util.Set<javax.validation.ConstraintViolation<T>> validate(T bean)
Validates a bean.

Type Parameters:
T - the bean type
Parameters:
bean - the bean to validate
Throws:
javax.validation.ValidationException - if an error occurs. All violation are reported.

getValidator

public static javax.validation.Validator getValidator()
Use this in case you need more than a global validation

Returns:
the validator


Copyright © 2012 Mairie de Paris. All Rights Reserved.