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: FlowLinkDeclaration.java 3701 2007-03-18 12:24:23Z gbevin $
07: */
08: package com.uwyn.rife.engine;
09:
10: class FlowLinkDeclaration extends AbstractLogicLinkDeclaration {
11: private FlowLink mFlowLink = null;
12:
13: FlowLinkDeclaration(SiteBuilder siteBuilder, String srcExit,
14: String destId, boolean snapback, boolean cancelInheritance,
15: boolean cancelEmbedding, boolean redirect,
16: boolean cancelContinuations) {
17: super (siteBuilder, srcExit, destId, snapback,
18: cancelInheritance, cancelEmbedding, redirect,
19: cancelContinuations);
20:
21: assert destId != null || snapback;
22: assert null == destId || !snapback;
23: }
24:
25: FlowLink getFlowLink() {
26: if (mFlowLink != null) {
27: return mFlowLink;
28: }
29:
30: ElementDeclaration target_elementdeclaration = null;
31: ElementInfo flowlink_target_elementinfo = null;
32:
33: flowlink_target_elementinfo = null;
34:
35: if (getDestId() != null) {
36: // get the element declaration that corresponds to the destination id
37: target_elementdeclaration = getSiteBuilder()
38: .getGlobalElementDeclaration(getDestId());
39:
40: // if the target element couldn't be found, throw an exception
41: if (null == target_elementdeclaration) {
42: getSiteBuilder().elementIdNotFound(getDestId());
43: }
44:
45: flowlink_target_elementinfo = target_elementdeclaration
46: .getElementInfo();
47: }
48:
49: mFlowLink = new FlowLink(getSrcExit(),
50: flowlink_target_elementinfo, isSnapback(),
51: cancelInheritance(), cancelEmbedding(), isRedirect(),
52: cancelContinuations());
53:
54: return mFlowLink;
55: }
56:
57: public boolean equals(Object other) {
58: if (!(other instanceof FlowLinkDeclaration)) {
59: return false;
60: }
61:
62: return super.equals(other);
63: }
64: }
|