protected TypeData findSubclassTypeData ( final Class type ) { final Class < ? extends Annotation > defaultAnnotation = jsonAnnotation ; if ( type . getAnnotation ( defaultAnnotation ) != null ) { // current type has annotation, don't find anything, let type data be created return null ; } ClassDescriptor cd = ClassIntrospector . get ( ) . lookup ( type ) ; // lookup superclasses Class [ ] superClasses = cd . getAllSuperclasses ( ) ; for ( Class superClass : superClasses ) { if ( superClass . getAnnotation ( defaultAnnotation ) != null ) { // annotated subclass founded! return _lookupTypeData ( superClass ) ; } } Class [ ] interfaces = cd . getAllInterfaces ( ) ; for ( Class interfaze : interfaces ) { if ( interfaze . getAnnotation ( defaultAnnotation ) != null ) { // annotated subclass founded! return _lookupTypeData ( interfaze ) ; } } return null ; }
Finds type data of first annotated superclass or interface .