protected Set < Element > getMembersFromJavaSource ( final String clazzname , final ElementUtilities . ElementAcceptor acceptor ) { final Set < Element > ret = new LinkedHashSet <> ( ) ; JavaSource javaSource = getJavaSourceForClass ( clazzname ) ; if ( javaSource != null ) { try { javaSource . runUserActionTask ( new Task < CompilationController > ( ) { @ Override public void run ( CompilationController controller ) throws IOException { controller . toPhase ( JavaSource . Phase . ELEMENTS_RESOLVED ) ; TypeElement classElem = controller . getElements ( ) . getTypeElement ( clazzname ) ; if ( classElem == null ) { return ; } ElementUtilities eu = controller . getElementUtilities ( ) ; Iterable < ? extends Element > members = eu . getMembers ( classElem . asType ( ) , acceptor ) ; for ( Element e : members ) { ret . add ( e ) ; } } } , false ) ; } catch ( IOException ioe ) { Exceptions . printStackTrace ( ioe ) ; } } return ret ; }
tries to load all members for the given clazzname from javasource files .