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: import net.sf.oval.internal.util.StringUtils;
18:
19: /**
20: * @author Sebastian Thomschke
21: */
22: public class MethodEntryContext extends OValContext {
23: private static final long serialVersionUID = 1L;
24:
25: private final SerializableMethod method;
26:
27: public MethodEntryContext(final Method method) {
28: this .method = SerializableMethod.getInstance(method);
29: }
30:
31: /**
32: * @return Returns the method.
33: */
34: public Method getMethod() {
35: return method.getMethod();
36: }
37:
38: @Override
39: public String toString() {
40: return method.getDeclaringClass().getName() + "."
41: + method.getName() + "("
42: + StringUtils.implode(method.getParameterTypes(), ",")
43: + ")";
44: }
45: }
|