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.constraint;
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: import net.sf.oval.configuration.annotation.Constraint;
21:
22: /**
23: * Checks if the value satsifies the constraints defined for the specified field.
24: *
25: * @author Sebastian Thomschke
26: */
27: @Documented
28: @Retention(RetentionPolicy.RUNTIME)
29: @Target({ElementType.PARAMETER,ElementType.METHOD})
30: @Constraint(checkWith=AssertFieldConstraintsCheck.class)
31: public @interface AssertFieldConstraints {
32: /**
33: * The class in which the field is declared. If omitted the current class and it's super classes are searched for a field with the given name.
34: * The default value Void.class means the current class.
35: */
36: Class declaringClass() default Void.class;
37:
38: /**
39: * Name of the field. If not specified, the constraints of the field with the same name as the annotated constructor/method parameter are applied.
40: */
41: String value() default "";
42:
43: /**
44: * The associated validation profiles.
45: */
46: String[] profiles() default {};
47: }
|