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.binding.expression;
17:
18: import org.springframework.core.NestedRuntimeException;
19:
20: /**
21: * Indicates an expression evaluation failed.
22: *
23: * @author Keith Donald
24: */
25: public class EvaluationException extends NestedRuntimeException {
26:
27: /**
28: * The evaluation attempt that failed.
29: * Transient because an EvaluationAttempt is not serializable.
30: */
31: private transient EvaluationAttempt evaluationAttempt;
32:
33: /**
34: * Creates a new evaluation exception.
35: * @param evaluationAttempt the evaluation attempt that failed
36: * @param cause the underlying cause of this exception
37: */
38: public EvaluationException(EvaluationAttempt evaluationAttempt,
39: Throwable cause) {
40: super (
41: "Expression "
42: + evaluationAttempt
43: + " failed - make sure the expression is evaluatable on the target object",
44: cause);
45: this .evaluationAttempt = evaluationAttempt;
46: }
47:
48: /**
49: * Returns the evaluation attempt that failed.
50: */
51: public EvaluationAttempt getEvaluationAttempt() {
52: return evaluationAttempt;
53: }
54: }
|