Module java.base

Interface AnnotatedParameterizedType

所有超级接口:
AnnotatedElement, AnnotatedType

public interface AnnotatedParameterizedType extends AnnotatedType
AnnotatedParameterizedType表示参数化类型的潜在注释使用,其类型参数本身可能代表类型的注释使用。
参见 Java 语言规范:
4.5 参数化类型
自版本:
1.8
  • Method Details

    • getAnnotatedActualTypeArguments

      AnnotatedType[] getAnnotatedActualTypeArguments()
      返回此参数化类型的潜在注释实际类型参数。

      请注意,在某些情况下,返回的数组可能为空。如果此注释类型表示嵌套在参数化类型中的非参数化类型,则可能会发生这种情况。

      返回:
      此参数化类型的潜在注释实际类型参数
      参见:
    • getAnnotatedOwnerType

      AnnotatedType getAnnotatedOwnerType()
      返回此类型是其成员的潜在注释类型,如果此类型表示嵌套类型。例如,如果此类型是 @TA O<T>.I<S>,则返回表示 @TA O<T> 的表示。

      如果此 AnnotatedType 表示顶级类或接口,或本地类或匿名类,或原始类型,或 void,则返回 null

      指定者:
      getAnnotatedOwnerType 在接口 AnnotatedType
      返回:
      表示此类型是其成员的潜在注释类型的 AnnotatedType 对象,或 null
      抛出:
      TypeNotPresentException - 如果所有者类型引用不存在的类或接口声明
      MalformedParameterizedTypeException - 如果所有者类型引用由于任何原因无法实例化的参数化类型
      自版本:
      9