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: Datalink.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.engine.annotations;
09:
10: import java.lang.annotation.Documented;
11: import java.lang.annotation.Retention;
12: import java.lang.annotation.RetentionPolicy;
13: import java.lang.annotation.Target;
14:
15: /**
16: * Declares a data link for the element.
17: *
18: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
19: * @version $Revision: 3634 $
20: * @since 1.5
21: */
22: @Retention(RetentionPolicy.RUNTIME)
23: @Target({})
24: @Documented
25: public @interface Datalink {
26: /**
27: * The name of this element's source output.
28: * @since 1.5
29: */
30: String srcOutput() default "";
31:
32: /**
33: * The name of this element's outbean.
34: * @since 1.5
35: */
36: String srcOutbean() default "";
37:
38: /**
39: * The ID of the destination element for this data link.
40: * <p>If <code>destClass</code> is provided, it will override the
41: * <code>destId</code> value.
42: * @see #destClass
43: * @since 1.5
44: */
45: String destId() default "";
46:
47: /**
48: * The Java class of the destination element for this data link. This
49: * class should at least have an {@link Elem} annotation.
50: * <p>If <code>destClass</code> is provided, it will override the
51: * <code>destId</code> value.
52: * <p>The ID will be evaluated locally to the current subsite. If you
53: * have to refer to an ID in another subsite, you have to use the
54: * {@link #destClassIdPrefix}.
55: * @see #destId
56: * @see #destClassIdPrefix
57: * @since 1.5
58: */
59: Class destClass() default void.class;
60:
61: /**
62: * The prefix that will be added to the <code>destClass</code> ID.
63: * <p>This makes it possible to refer to an ID in another subsite.
64: * Note that this prefix is not validated individually, it is merely added
65: * as a string to build the final ID that will be used.
66: * @see #destClass
67: * @since 1.5
68: */
69: String destClassIdPrefix() default "";
70:
71: /**
72: * Indicates whether this data link is a snapback.
73: * @since 1.5
74: */
75: boolean snapback() default false;
76:
77: /**
78: * The name of the target element's destination input.
79: * @since 1.5
80: */
81: String destInput() default "";
82:
83: /**
84: * The name of the target element's destination inbean.
85: * @since 1.5
86: */
87: String destInbean() default "";
88: }
|