1
국기 및 기타 정보로 declared methods
을 검색하고 싶습니다.AccessFlags로 찾기 방법
예를 들어, 방법 public final void ae(StringTokenizer);
을 검색하고 싶습니다.
private CtMethod findMethod(CtClass clazz, int access, String returns, String[] parameters) throws NotFoundException {
/*
returns = null = void, other String for returned class name
parameters = easy names of parameters
*/
CtMethod found = null;
for(CtMethod method : clazz.getDeclaredMethods()) {
// Check here all flags and informations - If found, set the `found` variable and return
}
return found;
}
은 샘플의 호출입니다 : 여기
어떻게 그것을 검색 할 샘플 방법입니다 내가 샘플AccessFlag.FINAL | AccessFlag.PUBLIC
를 들어, 명시 적으로 플래그를 확인할 수있는 방법
CtMethod inputMethod = this.findMethod(theClass, AccessFlag.FINAL, null, new String[] { "StringTokenizer" });
?