public static boolean isEnum ( String className ) { try { // is it an enum? TypeElement element = BindTypeSubProcessor . elementUtils . getTypeElement ( className ) ; if ( element instanceof TypeElement ) { TypeElement typeElement = element ; TypeMirror superclass = typeElement . getSuperclass ( ) ; if ( superclass instanceof DeclaredType ) { DeclaredType superclassDeclaredType = ( DeclaredType ) superclass ; if ( JAVA_LANG_ENUM . equals ( getCanonicalTypeName ( superclassDeclaredType ) ) ) { return true ; } } } return false ; } catch ( Throwable e ) { return false ; } }
Checks if is enum .