01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: InBeanProperty.java 3687 2007-03-09 23:13:07Z gbevin $
07: */
08: package com.uwyn.rife.engine.annotations;
09:
10: import java.lang.annotation.*;
11:
12: import com.uwyn.rife.engine.exceptions.NamedInbeanInjectionException;
13: import com.uwyn.rife.site.MetaData;
14: import com.uwyn.rife.site.ValidatedConstrained;
15:
16: /**
17: * Declares that the bean property that corresponds to the annotated setter
18: * will be used as an input bean. The name of the bean will be the name of
19: * the property, and the bean class will be the property type.
20: * <p>When an element is processed, an instance of the input bean will be
21: * created and its properties will be filled in with the available input
22: * values. The input bean instance will be injected into the element through
23: * the setter and RIFE's type conversion will try to convert the bean type
24: * into the property type. A {@link NamedInbeanInjectionException} exception
25: * will be thrown if the conversion failed.
26: *
27: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
28: * @version $Revision: 3687 $
29: * @since 1.5
30: * @see InBean
31: */
32: @Retention(RetentionPolicy.RUNTIME)
33: @Target({ElementType.METHOD})
34: @Documented
35: public @interface InBeanProperty {
36: /**
37: * The expected name of the property.
38: * <p>
39: * This hasn't got any influence on the actual name that is being used
40: * for the property, but is used instead to ensure that the property name
41: * is the same as the one specified here. This is typically used to create
42: * a single point of declaration for the property name that can be
43: * referenced elsewhere and that is ensured to be correct.
44: *
45: * @since 1.6
46: */
47: String name() default "";
48:
49: /**
50: * The prefix that will be prepended to each property name of the input
51: * bean when corresponding input names are automatically declared.
52: * @since 1.5
53: */
54: String prefix() default "";
55:
56: /**
57: * The validation group that has been declared by the bean class.
58: * <p>This requires the bean class to implement the {@link ValidatedConstrained}
59: * interface, either directly, or by extending {@link MetaData}, or by using
60: * automated <a href="http://rifers.org/wiki/display/RIFE/Meta+data+merging">meta data merging</a>.
61: * <p>The group will indicate which bean properties should only be taken
62: * into account. Any properties outside the group will not be created as
63: * inputs.
64: * @since 1.5
65: */
66: String group() default "";
67: }
|