net.sf.oval.guard
Annotation Type Pre


@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Pre

Before the annotated method is executed the expression is evaluated.
This evaluation happens after the single parameter constraints were validated and only if no parameter constraint violations were detected.
If constraint violations occur, the annotated method will not be executed instead it will throw a ConstraintsViolatedException exception.

Author:
Sebastian Thomschke

Required Element Summary
 String expr
          formula in the given expression language describing the constraint. the formula must return true if the constraint is satisfied.
 String lang
          the expression language that is used
 
Optional Element Summary
 String errorCode
          error code passed to the ConstraintViolation object
 String message
          message to be used for the ContraintsViolatedException
 String[] profiles
          The associated constraint profiles.
 int severity
          severity passed to the ConstraintViolation object
 

Element Detail

expr

public abstract String expr
formula in the given expression language describing the constraint. the formula must return true if the constraint is satisfied.
available variables are:
_this -> the validated bean
_args[] -> the current parameter values
additionally variables matching the parameter names are available


lang

public abstract String lang
the expression language that is used

errorCode

public abstract String errorCode
error code passed to the ConstraintViolation object

Default:
"net.sf.oval.guard.Pre"

message

public abstract String message
message to be used for the ContraintsViolatedException

See Also:
ConstraintsViolatedException
Default:
"net.sf.oval.guard.Pre.violated"

profiles

public abstract String[] profiles
The associated constraint profiles.

Default:
{}

severity

public abstract int severity
severity passed to the ConstraintViolation object

Default:
0


Copyright © 2005–2015 The OVal Development Team. All rights reserved.