public Type findFieldGenericType() {
    if (method != null) {
      return null;
    } else {
      if (field.getGenericType() instanceof ParameterizedType) {
        ParameterizedType p = (ParameterizedType) field.getGenericType();
        Type cls = p.getActualTypeArguments()[0];
        if (cls instanceof Class) {
          return cls;
        } else if ( cls instanceof WildcardType) {
          WildcardType wildcardType = (WildcardType)cls;
          if (wildcardType.getLowerBounds().length > 0) {
            return wildcardType.getLowerBounds()[0];
          }
          if (wildcardType.getUpperBounds().length > 0) {
            return wildcardType.getUpperBounds()[0];
          }
        }
      }
    }

    return null;
  }
public Type findFieldGenericType ( ) { if ( method != null ) { return null ; } else { if ( field . getGenericType ( ) instanceof ParameterizedType ) { ParameterizedType p = ( ParameterizedType ) field . getGenericType ( ) ; Type cls = p . getActualTypeArguments ( ) [ 0 ] ; if ( cls instanceof Class ) { return cls ; } else if ( cls instanceof WildcardType ) { WildcardType wildcardType = ( WildcardType ) cls ; if ( wildcardType . getLowerBounds ( ) . length > 0 ) { return wildcardType . getLowerBounds ( ) [ 0 ] ; } if ( wildcardType . getUpperBounds ( ) . length > 0 ) { return wildcardType . getUpperBounds ( ) [ 0 ] ; } } } } return null ; }
@return the generic type of the collection for this field, or null if not applicable.