@ Deprecated protected Class < ? > getGenericRole ( Field field ) { Type type = field . getGenericType ( ) ; if ( type instanceof ParameterizedType ) { ParameterizedType pType = ( ParameterizedType ) type ; Type [ ] types = pType . getActualTypeArguments ( ) ; if ( types . length > 0 && types [ types . length - 1 ] instanceof Class ) { return ( Class ) types [ types . length - 1 ] ; } } return null ; }
Extract generic type from the list field .