01: /*******************************************************************************
02: * Portions created by Sebastian Thomschke are copyright (c) 2005-2007 Sebastian
03: * Thomschke.
04: *
05: * All Rights Reserved. This program and the accompanying materials
06: * are made available under the terms of the Eclipse Public License v1.0
07: * which accompanies this distribution, and is available at
08: * http://www.eclipse.org/legal/epl-v10.html
09: *
10: * Contributors:
11: * Sebastian Thomschke - initial implementation.
12: *******************************************************************************/package net.sf.oval.guard;
13:
14: import java.lang.annotation.Documented;
15: import java.lang.annotation.ElementType;
16: import java.lang.annotation.Retention;
17: import java.lang.annotation.RetentionPolicy;
18: import java.lang.annotation.Target;
19:
20: /**
21: * This annotation needs to be applied to classes where
22: * OVal's programming by contract features shall be used.<br>
23: * <br>
24: * The GuardAspect will weave the required AOP code into all
25: * classes annotated with @Guarded.
26: *
27: * @author Sebastian Thomschke
28: * @see net.sf.oval.guard.GuardAspect
29: */
30: @Documented
31: @Retention(RetentionPolicy.RUNTIME)
32: @Target(ElementType.TYPE)
33: public @interface Guarded {
34: /**
35: * Automatically apply field constraints to the
36: * parameters of the corresponding setter methods
37: * declared within the same class. A corresponding setter
38: * method is a method following the JavaBean convention and
39: * its parameter has as the same type as the field.
40: */
41: boolean applyFieldConstraintsToSetters() default false;
42:
43: /**
44: * Automatically apply field constraints to
45: * the corresponding parameters of constructors
46: * declared within the same class. A corresponding paramater
47: * is a parameter with the same name and type as the field.
48: */
49: boolean applyFieldConstraintsToConstructors() default false;
50:
51: /**
52: * Specifies if invariants are checked after constructor
53: * execution and prior and after calls to non-private methods.
54: */
55: boolean checkInvariants() default true;
56: }
|