IJavaProject javaProject = javaElement.getJavaProject(); IClasspathEntry[] rawClasspath = javaProject.getRawClasspath(); for (IClasspathEntry classpath : rawClasspath) { System.out.println(classpath.getClass()); System.out.println(" contentKind: " + classpath.getContentKind()); System.out.println(" source?: " + (classpath.getEntryKind() == IClasspathEntry.CPE_SOURCE)); System.out.println(" path: " + classpath.getPath()); }
getEntryKindで返ってくる数字で、ソースフォルダなのかとかがとれる。
定数は、IClasspathEntryに切られてるCPE_*