01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: * $Header:$
18: */
19: package org.apache.beehive.netui.pageflow;
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
31: IllegalOutputFormException {
32: private String _requiredType;
33:
34: /**
35: * @param forwardName the name of the relevant {@link Forward}.
36: * @param actionName the name of the current action being run.
37: * @param flowController the current {@link FlowController} instance.
38: * @param outputFormType the type name of the relevant output form.
39: * @param requiredType the name of the required form type.
40: */
41: public IllegalOutputFormTypeException(String forwardName,
42: String actionName, FlowController flowController,
43: String outputFormType, String requiredType) {
44: super (forwardName, actionName, flowController, outputFormType);
45: _requiredType = requiredType;
46: }
47:
48: /**
49: * Get the name of the required form type.
50: *
51: * @return a String that is the name of the required form type.
52: */
53: public String getRequiredType() {
54: return _requiredType;
55: }
56:
57: protected Object[] getMessageArgs() {
58: return new Object[] { getForwardName(), getActionName(),
59: getFlowControllerURI(), getOutputFormType(),
60: _requiredType };
61: }
62:
63: public String[] getMessageParts() {
64: return new String[] { "The forward \"", "\" on action ",
65: " in page flow ", " has a first output form of type ",
66: ", but is declared to require type ", "." };
67: }
68: }
|