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: GlobalExit.java 3701 2007-03-18 12:24:23Z gbevin $
07: */
08: package com.uwyn.rife.engine;
09:
10: public class GlobalExit {
11: private int mGroupId = -1;
12:
13: private String mDestId = null;
14: private ElementInfo mTarget = null;
15: private boolean mReflective = false;
16: private boolean mSnapback = false;
17: private boolean mCancelInheritance = false;
18: private boolean mCancelEmbedding = false;
19: private boolean mRedirect = false;
20: private boolean mCancelContinuations = false;
21:
22: GlobalExit(String destId, boolean reflective, boolean snapback,
23: boolean cancelInheritance, boolean cancelEmbedding,
24: boolean redirect, boolean cancelContinuations) {
25: assert (destId != null && !reflective && !snapback)
26: || (null == destId && reflective && !snapback)
27: || (null == destId && !reflective && snapback);
28:
29: mDestId = destId;
30: mReflective = reflective;
31: mSnapback = snapback;
32: mCancelInheritance = cancelInheritance;
33: mCancelEmbedding = cancelEmbedding;
34: mRedirect = redirect;
35: mCancelContinuations = cancelContinuations;
36: }
37:
38: GlobalExit setGroupId(int groupId) {
39: assert groupId > -1;
40:
41: mGroupId = groupId;
42:
43: return this ;
44: }
45:
46: void makeAbsoluteDestId(SiteBuilder siteBuilder) {
47: if (mDestId != null) {
48: mDestId = siteBuilder.makeAbsoluteElementId(mDestId);
49: mDestId = Site.getCanonicalId(mDestId);
50: }
51: }
52:
53: String getDestId() {
54: return mDestId;
55: }
56:
57: void setTarget(ElementInfo target) {
58: mTarget = target;
59: }
60:
61: public ElementInfo getTarget() {
62: return mTarget;
63: }
64:
65: public int getGroupId() {
66: return mGroupId;
67: }
68:
69: public boolean isReflective() {
70: return mReflective;
71: }
72:
73: public boolean isSnapback() {
74: return mSnapback;
75: }
76:
77: public boolean cancelInheritance() {
78: return mCancelInheritance;
79: }
80:
81: public boolean cancelEmbedding() {
82: return mCancelEmbedding;
83: }
84:
85: public boolean isRedirect() {
86: return mRedirect;
87: }
88:
89: public boolean cancelContinuations() {
90: return mCancelContinuations;
91: }
92: }
|