KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
22  * Exception that occurs when the first output form for a {@link Forward} resolves to a
23  * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward} annotation whose
24  * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward#outputFormBean outputFormBean} or
25  * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward#outputFormBeanType outputFormBeanType}
26  * attribute demands a different form type.
27  *
28  * @see Forward#addOutputForm
29  */

30 public class IllegalOutputFormTypeException extends IllegalOutputFormException
31 {
32     private String JavaDoc _requiredType;
33     
34     
35     /**
36      * @param forwardName the name of the relevant {@link Forward}.
37      * @param actionName the name of the current action being run.
38      * @param flowController the current {@link FlowController} instance.
39      * @param outputFormType the type name of the relevant output form.
40      * @param requiredType the name of the required form type.
41      */

42     public IllegalOutputFormTypeException( String JavaDoc forwardName, String JavaDoc actionName, FlowController flowController,
43                                            String JavaDoc outputFormType, String JavaDoc requiredType )
44     {
45         super( forwardName, actionName, flowController, outputFormType );
46         _requiredType = requiredType;
47     }
48
49     /**
50      * Get the name of the required form type.
51      *
52      * @return a String that is the name of the required form type.
53      */

54     public String JavaDoc getRequiredType()
55     {
56         return _requiredType;
57     }
58
59     protected Object JavaDoc[] getMessageArgs()
60     {
61         return new Object JavaDoc[]{ getForwardName(), getActionName(), getFlowControllerURI(), getOutputFormType(),
62                              _requiredType };
63     }
64
65     public String JavaDoc[] getMessageParts()
66     {
67         return new String JavaDoc[]
68         {
69             "The forward \"", "\" on action ", " in page flow ", " has a first output form of type ",
70             ", but is declared to require type ", "."
71         };
72     }
73 }
74
Popular Tags