KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > binding > expression > SetValueAttempt


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.binding.expression;
17
18 import java.util.Map JavaDoc;
19
20 import org.springframework.core.style.ToStringCreator;
21
22 /**
23  * Records an attempt to set an expression value.
24  * @author Keith Donald
25  */

26 public class SetValueAttempt extends EvaluationAttempt {
27
28     /**
29      * The new value.
30      */

31     private Object JavaDoc value;
32
33     /**
34      * Creates a new set attempt.
35      * @param expression the settable expression
36      * @param target the target of the expression
37      * @param value the value that attempted to be set
38      * @param evaluationAttributes attributes that may have influenced the evaluation and set process
39      */

40     public SetValueAttempt(SettableExpression expression, Object JavaDoc target, Object JavaDoc value, Map JavaDoc evaluationAttributes) {
41         super(expression, target, evaluationAttributes);
42         this.value = value;
43     }
44
45     /**
46      * Returns the value that was attempted to be set.
47      */

48     public Object JavaDoc getValue() {
49         return value;
50     }
51
52     protected ToStringCreator createToString(ToStringCreator creator) {
53         return super.createToString(creator).append("value", value);
54     }
55 }
Popular Tags