If you are willing to use additional libraries you can use Reflections Project that allows you to search for classes listed in a package.
Reflections reflections = new Reflections("my.package.prefix");
//or
Reflections reflections = new Reflections(ClasspathHelper.forPackage("my.package.prefix"),
new SubTypesScanner(), new TypesAnnotationScanner(), new FilterBuilder().includePackage(...), ...);
//or using the ConfigurationBuilder
new Reflections(new ConfigurationBuilder()
.filterInputsBy(new FilterBuilder().includePackage("my.project.prefix"))
.setUrls(ClasspathHelper.forPackage("my.project.prefix"))
.setScanners(new SubTypesScanner(), new TypeAnnotationsScanner().filterResultsBy(optionalFilter), ...));
//then query, for example:
Set<Class<? extends Module>> modules = reflections.getSubTypesOf(com.google.inject.Module.class);
Set<Class<?>> singletons = reflections.getTypesAnnotatedWith(javax.inject.Singleton.class);
Set<String> properties = reflections.getResources(Pattern.compile(".*\\.properties"));
Set<Constructor> injectables = reflections.getConstructorsAnnotatedWith(javax.inject.Inject.class);
Set<Method> deprecateds = reflections.getMethodsAnnotatedWith(javax.ws.rs.Path.class);
Set<Field> ids = reflections.getFieldsAnnotatedWith(javax.persistence.Id.class);
Set<Method> someMethods = reflections.getMethodsMatchParams(long.class, int.class);
Set<Method> voidMethods = reflections.getMethodsReturn(void.class);
Set<Method> pathParamMethods = reflections.getMethodsWithAnyParamAnnotated(PathParam.class);
Set<Method> floatToString = reflections.getConverters(Float.class, String.class);
As you can see you can search with different filters. I don't think you can't do for java file but you can search all the classes for package name.