public static TypeElement enclosingClass ( final Element elem ) { Element result = elem ; while ( result != null && ! result . getKind ( ) . isClass ( ) && ! result . getKind ( ) . isInterface ( ) ) { Element encl = result . getEnclosingElement ( ) ; result = encl ; } return ( TypeElement ) result ; }
Returns the innermost type element enclosing the given element