KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > pageflow > MismatchedActionOutputException


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * $Header:$
17  */

18 package org.apache.beehive.netui.pageflow;
19
20 /**
21  * Exception that occurs in iterative development mode when an action output attached to a {@link Forward} is of a
22  * different type than was declared.
23  */

24 public class MismatchedActionOutputException extends PageFlowException
25 {
26     private String JavaDoc _actionOutputName;
27     private String JavaDoc _expectedType;
28     private String JavaDoc _actualType;
29     private String JavaDoc _forwardName;
30
31     public MismatchedActionOutputException( String JavaDoc actionName, FlowController flowController, String JavaDoc actionOutputName,
32                                             String JavaDoc forwardName, String JavaDoc expectedType, String JavaDoc actualType )
33     {
34         super( actionName, flowController );
35         _actionOutputName = actionOutputName;
36         _expectedType = expectedType;
37         _actualType = actualType;
38         _forwardName = forwardName;
39     }
40
41     protected Object JavaDoc[] getMessageArgs()
42     {
43         return new Object JavaDoc[]{ _actionOutputName, _forwardName, getActionName(), getFlowControllerURI(), _actualType,
44                              _expectedType };
45     }
46
47     protected String JavaDoc[] getMessageParts()
48     {
49         return new String JavaDoc[]{ "The action output \"", "\" on forward \"", "\" (action ", " in Page Flow ", ") is of type ",
50                              ", but was declared to expect type ", "." };
51     }
52
53     public String JavaDoc getActionOutputName()
54     {
55         return _actionOutputName;
56     }
57
58     public String JavaDoc getForwardName()
59     {
60         return _forwardName;
61     }
62
63     public String JavaDoc getExpectedType()
64     {
65         return _expectedType;
66     }
67
68     public String JavaDoc getActualType()
69     {
70         return _actualType;
71     }
72
73     /**
74      * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
75      * the actual session ID. In this case, the answer is <code>false</code>.
76      */

77     public boolean causeMayBeSessionExpiration()
78     {
79         return false;
80     }
81 }
82
Popular Tags