public static TypeCategory getCategory ( TypeRepository typeRepository , String typeName ) { try { Class < ? > type = typeRepository . loadClass ( typeName ) ; if ( type . isInterface ( ) ) { return TypeCategory . INTERFACE ; } else if ( type . isEnum ( ) ) { return TypeCategory . ENUM ; } else { if ( Modifier . isAbstract ( type . getModifiers ( ) ) ) { return TypeCategory . ABSTRACT_CLASS ; } else { return TypeCategory . CLASS ; } } } catch ( ClassNotFoundException e ) { log . warn ( "Category for type " + typeName + " could not be found." ) ; return null ; } }
Finds the category of a given type .