01: /*******************************************************************************
02: * Portions created by Sebastian Thomschke are copyright (c) 2005-2007 Sebastian
03: * Thomschke.
04: *
05: * All Rights Reserved. This program and the accompanying materials
06: * are made available under the terms of the Eclipse Public License v1.0
07: * which accompanies this distribution, and is available at
08: * http://www.eclipse.org/legal/epl-v10.html
09: *
10: * Contributors:
11: * Sebastian Thomschke - initial implementation.
12: *******************************************************************************/package net.sf.oval.context;
13:
14: import java.lang.reflect.Method;
15:
16: import net.sf.oval.internal.util.SerializableMethod;
17:
18: /**
19: * @author Sebastian Thomschke
20: */
21: public class MethodReturnValueContext extends OValContext {
22: private static final long serialVersionUID = 1L;
23:
24: private final SerializableMethod method;
25:
26: public MethodReturnValueContext(final Method method) {
27: this .method = SerializableMethod.getInstance(method);
28: }
29:
30: /**
31: * @return Returns the getter.
32: */
33: public Method getMethod() {
34: return method.getMethod();
35: }
36:
37: @Override
38: public String toString() {
39: return method.getDeclaringClass().getName() + "."
40: + method.getName() + "()";
41: }
42: }
|