net.sf.oval.guard
Annotation Type Post


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

After the annotated method has been executed the condition is evaluated.

In case of constraint violations the method will throw an ConstraintsViolatedException.

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 old
          Formula that is evaluated prior method execution.
 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:
_args[] -> the current parameter values
_old -> the old values
_returns -> the method's return value _this -> the validated bean
additionally variables named accordingly to the parameters 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.Post"

message

public abstract String message
message to be used for the ContraintsViolatedException

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

old

public abstract String old
Formula that is evaluated prior method execution.
The returned value can later be accessed in the constraint expression via the variable _old

Default:
""

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.