KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > webflow > execution > repository > BadlyFormattedFlowExecutionKeyException


1 /*
2  * Copyright 2002-2006 the original author or authors.
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 package org.springframework.webflow.execution.repository;
17
18 /**
19  * Thrown when an encoded flow execution key is badly formatted and could not be
20  * parsed. We debated calling this the <tt>FuckedUpFlowExecutionKeyException</tt>.
21  *
22  * @author Keith Donald
23  * @author Erwin Vervaet
24  */

25 public class BadlyFormattedFlowExecutionKeyException extends FlowExecutionRepositoryException {
26
27     /**
28      * The string encoded flow execution key that was invalid.
29      */

30     private String JavaDoc invalidKey;
31
32     /**
33      * The format the string key should have been in. Could just be a
34      * description of that format.
35      */

36     private String JavaDoc format;
37
38     /**
39      * Creates a bad execution key format exception.
40      * @param invalidKey the invalid key
41      * @param format the format the key should have been in
42      */

43     public BadlyFormattedFlowExecutionKeyException(String JavaDoc invalidKey, String JavaDoc format) {
44         super("Badly formatted flow execution key '" + invalidKey + "', the expected format is '" + format + "'");
45         this.invalidKey = invalidKey;
46         this.format = format;
47     }
48
49     /**
50      * Creates a bad execution key format exception.
51      * @param invalidKey the invalid key
52      * @param format the format the key should have been in
53      * @param cause the cause
54      */

55     public BadlyFormattedFlowExecutionKeyException(String JavaDoc invalidKey, String JavaDoc format, Throwable JavaDoc cause) {
56         super("Badly formatted flow execution key '" + invalidKey + "', the expected format is '" + format + "'", cause);
57         this.invalidKey = invalidKey;
58         this.format = format;
59     }
60
61     /**
62      * Returns the string key of the flow execution that could not be parsed.
63      */

64     public String JavaDoc getInvalidKey() {
65         return invalidKey;
66     }
67
68     /**
69      * Returns the format the key should have been in.
70      */

71     public String JavaDoc getFormat() {
72         return format;
73     }
74 }
Popular Tags