001: /*
002: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
003: * Distributed under the terms of either:
004: * - the common development and distribution license (CDDL), v1.0; or
005: * - the GNU Lesser General Public License, v2.1 or later
006: * $Id: FlowlinkExitField.java 3634 2007-01-08 21:42:24Z gbevin $
007: */
008: package com.uwyn.rife.engine.annotations;
009:
010: import java.lang.annotation.Retention;
011: import java.lang.annotation.RetentionPolicy;
012: import java.lang.annotation.Target;
013: import java.lang.annotation.ElementType;
014: import java.lang.annotation.Documented;
015:
016: /**
017: * Declares a flow link for the element. This annotation may only be used on
018: * final String fields. The value of the field is used as the source exit name.
019: *
020: * @author Steven Grimm (koreth[remove] at midwinter dot com)
021: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
022: * @version $Revision: 3634 $
023: * @since 1.5
024: * @see Flowlink
025: */
026: @Retention(RetentionPolicy.RUNTIME)
027: @Target({ElementType.FIELD})
028: @Documented
029: public @interface FlowlinkExitField {
030: /**
031: * The ID of the destination element for this flow link.
032: * <p>If <code>destClass</code> is provided, it will override the
033: * <code>destId</code> value.
034: * @see #destClass
035: * @since 1.5
036: */
037: String destId() default "";
038:
039: /**
040: * The Java class of the destination element for this data link. This
041: * class should at least have an {@link Elem} annotation.
042: * <p>If <code>destClass</code> is provided, it will override the
043: * <code>destId</code> value.
044: * <p>The ID will be evaluated locally to the current subsite. If you
045: * have to refer to an ID in another subsite, you have to use the
046: * {@link #destClassIdPrefix}.
047: * @see #destId
048: * @see #destClassIdPrefix
049: * @since 1.5
050: */
051: Class destClass() default void.class;
052:
053: /**
054: * The prefix that will be added to the <code>destClass</code> ID.
055: * <p>This makes it possible to refer to an ID in another subsite.
056: * Note that this prefix is not validated individually, it is merely added
057: * as a string to build the final ID that will be used.
058: * @see #destClass
059: * @since 1.5
060: */
061: String destClassIdPrefix() default "";
062:
063: /**
064: * Indicates whether this flow link is a snapback.
065: * @since 1.5
066: */
067: boolean snapback() default false;
068:
069: /**
070: * Indicates whether this flow link will redirect to a dedicated URL
071: * instead of executing the destination element directly.
072: * @since 1.5
073: */
074: boolean redirect() default false;
075:
076: /**
077: * Indicates whether the behavioral inheritance (3D flow) should be
078: * preserved or cancelled when this flow link is followed.
079: * @since 1.5
080: */
081: Inheritance inheritance() default Inheritance.PRESERVE;
082:
083: /**
084: * Indicates whether element embedded should be preserved or cancelled
085: * when this flow link is followed.
086: * @since 1.5
087: */
088: Embedding embedding() default Embedding.PRESERVE;
089:
090: /**
091: * This flow link's data links.
092: * @since 1.5
093: */
094: Datalink[] datalinks() default {};
095:
096: public enum Inheritance {
097: PRESERVE, CANCEL
098: }
099:
100: public enum Embedding {
101: PRESERVE, CANCEL
102: }
103: }
|