KickJava   Java API By Example, From Geeks To Geeks.

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


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.Constructor JavaDoc;
25
26 import org.jboss.reflect.plugins.ConstructorInfoImpl;
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  * Constructor 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 ReflectConstructorInfoImpl extends ConstructorInfoImpl
39 {
40    /** The serialVersionUID */
41    private static final long serialVersionUID = -7945050116306083175L;
42    
43    /** The constructor */
44    protected Constructor JavaDoc constructor;
45
46    /**
47     * Create a new ConstructorInfo.
48     */

49    public ReflectConstructorInfoImpl()
50    {
51    }
52
53    /**
54     * Create a new ConstructorInfo.
55     *
56     * @param annotations the annotations
57     * @param parameterTypes the parameter types
58     * @param parameterAnnotations the parameter annotations
59     * @param exceptionTypes the exception types
60     * @param modifiers the modifiers
61     * @param declaring the declaring class
62     */

63    public ReflectConstructorInfoImpl(AnnotationValue[] annotations, TypeInfo[] parameterTypes, AnnotationValue[][] parameterAnnotations, ClassInfo[] exceptionTypes, int modifiers, ClassInfo declaring)
64    {
65       super(annotations, parameterTypes, parameterAnnotations, exceptionTypes, modifiers, declaring);
66    }
67
68    /**
69     * Create a new ConstructorInfo.
70     *
71     * @param annotations the annotations
72     * @param parameters the parameters
73     * @param exceptionTypes the exception types
74     * @param modifiers the modifiers
75     * @param declaring the declaring class
76     */

77    public ReflectConstructorInfoImpl(AnnotationValue[] annotations, ParameterInfo[] parameters, ClassInfo[] exceptionTypes, int modifiers, ClassInfo declaring)
78    {
79       super(annotations, parameters, exceptionTypes, modifiers, declaring);
80    }
81
82    /**
83     * Set the constructor
84     *
85     * @param constructor the constructor
86     */

87    public void setConstructor(Constructor JavaDoc constructor)
88    {
89       this.constructor = constructor;
90    }
91
92    /**
93     * Get the constructor
94     *
95     * @return the constructor
96     */

97    public Constructor JavaDoc getConstructor()
98    {
99       return constructor;
100    }
101
102    public Object JavaDoc newInstance(Object JavaDoc[] args) throws Throwable JavaDoc
103    {
104       return ReflectionUtils.newInstance(constructor, args);
105    }
106 }
107
Popular Tags