View Javadoc

1   /*
2    * EL4J, the Extension Library for the J2EE, adds incremental enhancements to
3    * the spring framework, http://el4j.sf.net
4    * Copyright (C) 2005 by ELCA Informatique SA, Av. de la Harpe 22-24,
5    * 1000 Lausanne, Switzerland, http://www.elca.ch
6    *
7    * EL4J is published under the GNU Lesser General Public License (LGPL)
8    * Version 2.1. See http://www.gnu.org/licenses/
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13   * GNU Lesser General Public License for more details.
14   *
15   * For alternative licensing, please contact info@elca.ch
16   */
17  
18  package ch.elca.el4j.util.interfaceenrichment;
19  
20  /**
21   * Class to describe a method. This is used to decorate methods.
22   *
23   * @svnLink $Revision: 3881 $;$Date: 2009-08-04 15:22:05 +0200 (Di, 04. Aug 2009) $;$Author: swismer $;$URL: https://el4j.svn.sourceforge.net/svnroot/el4j/branches/el4j_3_1/el4j/framework/modules/core/src/main/java/ch/elca/el4j/util/interfaceenrichment/MethodDescriptor.java $
24   *
25   * @author Martin Zeltner (MZE)
26   */
27  public class MethodDescriptor {
28  	/**
29  	 * Name of the method.
30  	 */
31  	protected String m_methodName;
32  	
33  	/**
34  	 * Parameter names.
35  	 */
36  	protected String[] m_parameterNames;
37  	
38  	/**
39  	 * Parameter types.
40  	 */
41  	protected Class<?>[] m_parameterTypes;
42  	
43  	/**
44  	 * Exceptions which this method can throw.
45  	 */
46  	protected Class<?>[] m_thrownExceptions;
47  	
48  	/**
49  	 * The return type of this method.
50  	 */
51  	protected Class<?> m_returnType;
52  
53  	/**
54  	 * @return Returns the m_methodName.
55  	 */
56  	public String getMethodName() {
57  		return m_methodName;
58  	}
59  
60  	/**
61  	 * @param name
62  	 *            The m_methodName to set.
63  	 */
64  	public void setMethodName(String name) {
65  		m_methodName = name;
66  	}
67  
68  	/**
69  	 * @return Returns the m_parameterTypes.
70  	 */
71  	public Class<?>[] getParameterTypes() {
72  		return m_parameterTypes;
73  	}
74  
75  	/**
76  	 * @param types
77  	 *            The m_parameterTypes to set.
78  	 */
79  	public void setParameterTypes(Class<?>[] types) {
80  		m_parameterTypes = types;
81  	}
82  
83  	/**
84  	 * @return Returns the m_returnType.
85  	 */
86  	public Class<?> getReturnType() {
87  		return m_returnType;
88  	}
89  
90  	/**
91  	 * @param type
92  	 *            The m_returnType to set.
93  	 */
94  	public void setReturnType(Class<?> type) {
95  		m_returnType = type;
96  	}
97  
98  	/**
99  	 * @return Returns the m_thrownExceptions.
100 	 */
101 	public Class<?>[] getThrownExceptions() {
102 		return m_thrownExceptions;
103 	}
104 
105 	/**
106 	 * @param exceptions
107 	 *            The m_thrownExceptions to set.
108 	 */
109 	public void setThrownExceptions(Class<?>[] exceptions) {
110 		m_thrownExceptions = exceptions;
111 	}
112 
113 	/**
114 	 * This may not be the real names (e.g. when we use reflection)
115 	 *
116 	 * @return Returns the m_parameterNames.
117 	 */
118 	public String[] getParameterNames() {
119 		return m_parameterNames;
120 	}
121 
122 	/**
123 	 * This may not be the real names (e.g. when we use reflection)
124 	 *
125 	 * @param names
126 	 *            The m_parameterNames to set.
127 	 */
128 	public void setParameterNames(String[] names) {
129 		m_parameterNames = names;
130 	}
131 }