01: /*
02: * Copyright 2004-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: package org.springframework.webflow.definition.registry;
17:
18: import org.springframework.core.style.StylerUtils;
19: import org.springframework.webflow.core.FlowException;
20:
21: /**
22: * Thrown when no flow definition was found during a lookup operation by a flow
23: * locator.
24: *
25: * @author Keith Donald
26: * @author Erwin Vervaet
27: */
28: public class NoSuchFlowDefinitionException extends FlowException {
29:
30: /**
31: * The id of the flow definition that could not be located.
32: */
33: private String flowId;
34:
35: /**
36: * Creates an exception indicating a flow definition could not be found.
37: * @param flowId the flow id
38: * @param availableFlowIds all flow ids available to the locator generating
39: * this exception
40: */
41: public NoSuchFlowDefinitionException(String flowId,
42: String[] availableFlowIds) {
43: super ("No such flow definition with id '" + flowId
44: + "' found; the flows available are: "
45: + StylerUtils.style(availableFlowIds));
46: this .flowId = flowId;
47: }
48:
49: /**
50: * Returns the id of the flow definition that could not be found.
51: */
52: public String getFlowId() {
53: return flowId;
54: }
55: }
|