class JavaSourceVisitor extends ResourceReferenceCollector {

    public void visit(JavaSource javaSource) {

        // Imports
        List<Import> imports = javaSource.getImports();
        for (Import javaImport : imports) {
            visit(javaImport);
        }

        if (javaSource instanceof Body) {
            visit((Body) javaSource);
        } else if (javaSource instanceof JavaAnnotationSource) {
            visit((JavaAnnotationSource) javaSource);
        } else if (javaSource instanceof JavaClassSource) {
            visit((JavaClassSource) javaSource);
        } else if (javaSource instanceof JavaEnumSource) {
            visit((JavaEnumSource) javaSource);
        } else if (javaSource instanceof JavaInterfaceSource) {
            visit((JavaInterfaceSource) javaSource);
        }
    }

    public  JavaSourceVisitor(JavaSource javaSource, ClassLoader classLoader, Resource resParts);

}