001/* 002 * Copyright 2002-2012 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.core; 018 019import java.lang.reflect.Constructor; 020import java.lang.reflect.Method; 021 022/** 023 * Interface to discover parameter names for methods and constructors. 024 * 025 * <p>Parameter name discovery is not always possible, but various strategies are 026 * available to try, such as looking for debug information that may have been 027 * emitted at compile time, and looking for argname annotation values optionally 028 * accompanying AspectJ annotated methods. 029 * 030 * @author Rod Johnson 031 * @author Adrian Colyer 032 * @since 2.0 033 */ 034public interface ParameterNameDiscoverer { 035 036 /** 037 * Return parameter names for this method, 038 * or {@code null} if they cannot be determined. 039 * @param method method to find parameter names for 040 * @return an array of parameter names if the names can be resolved, 041 * or {@code null} if they cannot 042 */ 043 String[] getParameterNames(Method method); 044 045 /** 046 * Return parameter names for this constructor, 047 * or {@code null} if they cannot be determined. 048 * @param ctor constructor to find parameter names for 049 * @return an array of parameter names if the names can be resolved, 050 * or {@code null} if they cannot 051 */ 052 String[] getParameterNames(Constructor<?> ctor); 053 054}