Code example for Member

Methods: getDeclaringClass

0
 * @since 2.2.7 
 */ 
public abstract class AutowireUtils { 
 
	public static IJavaElement getJavaElement(IResource project, Member member, int index) {
		IType type = JdtUtils.getJavaType(project.getProject(), member.getDeclaringClass().getName());
		IJavaElement source = null;
		if (member instanceof Method) {
			source = JdtUtils.getMethod(type, ((Method) member).getName(), ((Method) member).getParameterTypes());
		} 
		else if (member instanceof Field) {
			source = JdtUtils.getField(type, ((Field) member).getName());
		} 
		else if (member instanceof Constructor<?>) {
			source = JdtUtils.getConstructor(type, ((Constructor<?>) member).getParameterTypes());
		} 
		return source;
	} 
	 
}