org.apache.bval.guice
Annotation Type Validate


@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Validate

Marker for methods which arguments have to be validated.

Version:
$Id: Validate.java 1074156 2011-02-24 14:11:34Z simonetripodi $

Optional Element Summary
 String exceptionMessage
          A custom error message when throwing the custom exception.
 Class<?>[] groups
          The groups have to be validated, empty by default.
 Class<? extends Throwable> rethrowExceptionsAs
          The exception re-thrown when an error occurs during the validation.
 boolean validateReturnedValue
          Marks if the returned object by the intercepted method execution has to be validated, false by default.
 

groups

public abstract Class<?>[] groups
The groups have to be validated, empty by default.

Returns:
the groups have to be validated, empty by default.
Default:
{}

validateReturnedValue

public abstract boolean validateReturnedValue
Marks if the returned object by the intercepted method execution has to be validated, false by default.

Returns:
false by default.
Default:
false

rethrowExceptionsAs

public abstract Class<? extends Throwable> rethrowExceptionsAs
The exception re-thrown when an error occurs during the validation.

Returns:
the exception re-thrown when an error occurs during the validation.
Default:
javax.validation.ConstraintViolationException.class

exceptionMessage

public abstract String exceptionMessage
A custom error message when throwing the custom exception. It supports java.util.Formatter place holders, intercepted method arguments will be used as message format arguments.

Returns:
a custom error message when throwing the custom exception.
See Also:
Formatter.format(String, Object...)
Default:
""


Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.