KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > reflect > plugins > introspection > ReflectMethodInfoImpl


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2006, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.reflect.plugins.introspection;
23
24 import java.lang.reflect.Method JavaDoc;
25
26 import org.jboss.reflect.plugins.MethodInfoImpl;
27 import org.jboss.reflect.spi.AnnotationValue;
28 import org.jboss.reflect.spi.ClassInfo;
29 import org.jboss.reflect.spi.ParameterInfo;
30 import org.jboss.reflect.spi.TypeInfo;
31
32 /**
33  * Method info
34  *
35  * @author <a HREF="mailto:bill@jboss.org">Bill Burke</a>
36  * @author <a HREF="mailto:adrian@jboss.org">Adrian Brock</a>
37  */

38 public class ReflectMethodInfoImpl extends MethodInfoImpl
39 {
40    /** The serialVersionUID */
41    private static final long serialVersionUID = -7215834088396065347L;
42    
43    /** The method */
44    protected Method JavaDoc method;
45
46    /**
47     * Create a new method info
48     */

49    public ReflectMethodInfoImpl()
50    {
51    }
52
53    /**
54     * Create a new MethodInfo.
55     *
56     * @param annotations the annotations
57     * @param name the method name
58     * @param returnType the return type
59     * @param parameterTypes the parameter types
60     * @param parameterAnnotations the parameter annotations
61     * @param exceptionTypes the exception types
62     * @param modifiers the modifiers
63     * @param declaring the declaring class
64     */

65    public ReflectMethodInfoImpl(AnnotationValue[] annotations, String JavaDoc name, TypeInfo returnType, TypeInfo[] parameterTypes, AnnotationValue[][] parameterAnnotations, ClassInfo[] exceptionTypes, int modifiers, ClassInfo declaring)
66    {
67       super(annotations, name, returnType, parameterTypes, parameterAnnotations, exceptionTypes, modifiers, declaring);
68    }
69
70    /**
71     * Create a new MethodInfo.
72     *
73     * @param annotations the annotations
74     * @param name the method name
75     * @param returnType the return type
76     * @param parameters the parameters
77     * @param exceptionTypes the exception types
78     * @param modifiers the modifiers
79     * @param declaring the declaring class
80     */

81    public ReflectMethodInfoImpl(AnnotationValue[] annotations, String JavaDoc name, TypeInfo returnType, ParameterInfo[] parameters, ClassInfo[] exceptionTypes, int modifiers, ClassInfo declaring)
82    {
83       super(annotations, name, returnType, parameters, exceptionTypes, modifiers, declaring);
84    }
85
86    /**
87     * Set the method
88     *
89     * @param method the method
90     */

91    public void setMethod(Method JavaDoc method)
92    {
93       this.method = method;
94    }
95
96    /**
97     * Get the method
98     *
99     * @return the method
100     */

101    public Method JavaDoc getMethod()
102    {
103       return method;
104    }
105    
106    public Object JavaDoc invoke(Object JavaDoc target, Object JavaDoc[] args) throws Throwable JavaDoc
107    {
108       return ReflectionUtils.invoke(method, target, args);
109    }
110 }
111
Popular Tags