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: OutBeanProperty.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.OutbeanOutjectionException;
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 getter
18: * will be used as an output 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, the output bean instance will be
21: * outjected from element through the getter as invididual output values that
22: * correspond to the bean properties. An {@link OutbeanOutjectionException}
23: * exception will be thrown if the outjection failed.
24: *
25: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
26: * @version $Revision: 3687 $
27: * @since 1.5
28: * @see OutBean
29: */
30: @Retention(RetentionPolicy.RUNTIME)
31: @Target({ElementType.METHOD})
32: @Documented
33: public @interface OutBeanProperty {
34: /**
35: * The expected name of the property.
36: * <p>
37: * This hasn't got any influence on the actual name that is being used
38: * for the property, but is used instead to ensure that the property name
39: * is the same as the one specified here. This is typically used to create
40: * a single point of declaration for the property name that can be
41: * referenced elsewhere and that is ensured to be correct.
42: *
43: * @since 1.6
44: */
45: String name() default "";
46:
47: /**
48: * The prefix that will be prepended to each property name of the output
49: * bean when corresponding output names are automatically declared.
50: * @since 1.5
51: */
52: String prefix() default "";
53:
54: /**
55: * The validation group that has been declared by the bean class.
56: * <p>This requires the bean class to implement the {@link ValidatedConstrained}
57: * interface, either directly, or by extending {@link MetaData}, or by using
58: * automated <a href="http://rifers.org/wiki/display/RIFE/Meta+data+merging">meta data merging</a>.
59: * <p>The group will indicate which bean properties should only be taken
60: * into account. Any properties outside the group will not be created as
61: * outputs.
62: * @since 1.5
63: */
64: String group() default "";
65: }
|