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.style.ToStringCreator;
19:
20: /**
21: * Records an attempt to set an expression value.
22: *
23: * @author Keith Donald
24: */
25: public class SetValueAttempt extends EvaluationAttempt {
26:
27: /**
28: * The new value.
29: */
30: private Object value;
31:
32: /**
33: * Creates a new set attempt.
34: * @param expression the settable expression
35: * @param target the target of the expression
36: * @param value the value that was attempted to be set
37: * @param context context attributes that may have influenced the evaluation and set process
38: */
39: public SetValueAttempt(SettableExpression expression,
40: Object target, Object value, EvaluationContext context) {
41: super (expression, target, context);
42: this .value = value;
43: }
44:
45: /**
46: * Returns the value that was attempted to be set.
47: */
48: public Object getValue() {
49: return value;
50: }
51:
52: protected ToStringCreator createToString(ToStringCreator creator) {
53: return super .createToString(creator).append("value", value);
54: }
55: }
|