1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
package org.apache.tapestry; |
16 | |
|
17 | |
import org.apache.hivemind.ApplicationRuntimeException; |
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
public class StaleLinkException extends ApplicationRuntimeException |
30 | |
{ |
31 | |
|
32 | |
private static final long serialVersionUID = -1266992401198999606L; |
33 | |
|
34 | |
private final transient IPage _page; |
35 | |
private final String _pageName; |
36 | |
private final String _targetIdPath; |
37 | |
private final String _targetActionId; |
38 | |
|
39 | |
public StaleLinkException() |
40 | |
{ |
41 | 0 | super(null, null, null, null); |
42 | |
|
43 | 0 | _targetIdPath = null; |
44 | 0 | _page = null; |
45 | 0 | _pageName = null; |
46 | 0 | _targetActionId = null; |
47 | 0 | } |
48 | |
|
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
public StaleLinkException(IComponent component, String targetActionId, |
55 | |
String targetIdPath) |
56 | |
{ |
57 | 0 | super(Tapestry.format("StaleLinkException.action-mismatch", |
58 | |
new String[] { targetActionId, component.getIdPath(), |
59 | |
targetIdPath }), component, null, null); |
60 | |
|
61 | 0 | _page = component.getPage(); |
62 | 0 | _pageName = _page.getPageName(); |
63 | |
|
64 | 0 | _targetActionId = targetActionId; |
65 | 0 | _targetIdPath = targetIdPath; |
66 | 0 | } |
67 | |
|
68 | |
|
69 | |
|
70 | |
|
71 | |
|
72 | |
public StaleLinkException(IPage page, String targetActionId, |
73 | |
String targetIdPath) |
74 | |
{ |
75 | 0 | this(Tapestry.format("StaleLinkException.component-mismatch", |
76 | |
targetActionId, targetIdPath), page); |
77 | 0 | } |
78 | |
|
79 | |
public StaleLinkException(String message, IComponent component) |
80 | |
{ |
81 | 0 | super(message, component, null, null); |
82 | |
|
83 | 0 | _targetIdPath = null; |
84 | 0 | _page = null; |
85 | 0 | _pageName = null; |
86 | 0 | _targetActionId = null; |
87 | 0 | } |
88 | |
|
89 | |
public String getPageName() |
90 | |
{ |
91 | 0 | return _pageName; |
92 | |
} |
93 | |
|
94 | |
|
95 | |
|
96 | |
|
97 | |
|
98 | |
|
99 | |
public IPage getPage() |
100 | |
{ |
101 | 0 | return _page; |
102 | |
} |
103 | |
|
104 | |
public String getTargetActionId() |
105 | |
{ |
106 | 0 | return _targetActionId; |
107 | |
} |
108 | |
|
109 | |
public String getTargetIdPath() |
110 | |
{ |
111 | 0 | return _targetIdPath; |
112 | |
} |
113 | |
|
114 | |
} |