View Javadoc
1   /*******************************************************************************
2    * Portions created by Sebastian Thomschke are copyright (c) 2005-2011 Sebastian
3    * Thomschke.
4    * 
5    * All Rights Reserved. This program and the accompanying materials
6    * are made available under the terms of the Eclipse Public License v1.0
7    * which accompanies this distribution, and is available at
8    * http://www.eclipse.org/legal/epl-v10.html
9    * 
10   * Contributors:
11   *     Sebastian Thomschke - initial implementation.
12   *******************************************************************************/
13  package net.sf.oval.guard;
14  
15  import java.lang.reflect.Constructor;
16  import java.lang.reflect.Method;
17  
18  import net.sf.oval.exception.ReflectionException;
19  
20  /**
21   * @author Sebastian Thomschke
22   */
23  public interface ParameterNameResolver
24  {
25  	/**
26  	 * Returns an empty String array if no parameters are declared.
27  	 * @param constructor the constructor
28  	 * @return an array holding the parameter names of the given constructor.
29  	 * @throws ReflectionException in case retrieving the parameter names fails
30  	 */
31  	String[] getParameterNames(Constructor< ? > constructor) throws ReflectionException;
32  
33  	/**
34  	 * Returns an empty String array if no parameters are declared
35  	 * @param method the method
36  	 * @return an array holding the parameter names of the given method.
37  	 * @throws ReflectionException in case retrieving the parameter names fails
38  	 */
39  	String[] getParameterNames(Method method) throws ReflectionException;
40  }