Skip to main content
summaryrefslogtreecommitdiffstats
blob: 913e39c78012de10dde84fc9b7941b3b13ad41d0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package org.eclipse.jdt.internal.core;

/*
 * (c) Copyright IBM Corp. 2000, 2001.
 * All Rights Reserved.
 */
import org.eclipse.core.resources.*;

import org.eclipse.jdt.internal.codeassist.ISearchRequestor;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;

/**
 *	This class modifies the <code>SearchableEnvironmentRequestor</code>'s 
 *	functionality by only accepting methods with return types that are not void.
 */
public class NonVoidMethodRequestor extends SearchableEnvironmentRequestor {
/**
 * NonVoidMethodRequestor constructor comment.
 * @param requestor org.eclipse.jdt.internal.codeassist.ISearchRequestor
 */
public NonVoidMethodRequestor(ISearchRequestor requestor) {
	super(requestor);
}
public void acceptMethod(IMethod method) {
	try {
		if (!Signature.getReturnType(method.getSignature()).equals("V")) {
			super.acceptMethod(method);
		}
	} catch (JavaModelException npe) {
	}
}
}

Back to the top