View Javadoc

1   /*
2    * $Id: ParameterNameDiscoverer.java 20321 2010-11-24 15:21:24Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  package org.mule.util.generics;
11  
12  import java.lang.reflect.Constructor;
13  import java.lang.reflect.Method;
14  
15  /**
16   * Interface to discover parameter names for methods and constructors.
17   * <p/>
18   * <p>Parameter name discovery is not always possible, but various strategies are
19   * available to try, such as looking for debug information that may have been
20   * emitted at compile time, and looking for argname annotation values optionally
21   * accompanying AspectJ annotated methods.
22   * <p/>
23   * author: Spring
24   */
25  public interface ParameterNameDiscoverer
26  {
27  
28      /**
29       * Return parameter names for this method,
30       * or <code>null</code> if they cannot be determined.
31       *
32       * @param method method to find parameter names for
33       * @return an array of parameter names if the names can be resolved,
34       *         or <code>null</code> if they cannot
35       */
36      String[] getParameterNames(Method method);
37  
38      /**
39       * Return parameter names for this constructor,
40       * or <code>null</code> if they cannot be determined.
41       *
42       * @param ctor constructor to find parameter names for
43       * @return an array of parameter names if the names can be resolved,
44       *         or <code>null</code> if they cannot
45       */
46      String[] getParameterNames(Constructor ctor);
47  
48  }