private int processRemoterElements ( TypeSpec . Builder classBuilder , Element element , int methodIndex , ElementVisitor elementVisitor , MethodSpec . Builder methodBuilder ) { if ( element instanceof TypeElement ) { for ( TypeMirror typeMirror : ( ( TypeElement ) element ) . getInterfaces ( ) ) { if ( typeMirror instanceof DeclaredType ) { Element superElement = ( ( DeclaredType ) typeMirror ) . asElement ( ) ; methodIndex = processRemoterElements ( classBuilder , superElement , methodIndex , elementVisitor , methodBuilder ) ; } } for ( Element member : element . getEnclosedElements ( ) ) { if ( member . getKind ( ) == ElementKind . METHOD ) { elementVisitor . visitElement ( classBuilder , member , methodIndex , methodBuilder ) ; methodIndex ++ ; } } } return methodIndex ; }
Recursevely Visit extended elements