annotation.html

来自「j2se5-api-zh,java文档的中文版本」· HTML 代码 · 共 602 行 · 第 1/3 页

HTML
602
字号
<CODE>&nbsp;<A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A>[]</CODE></FONT></TD><TD><CODE><B>Package.</B><B><A HREF="../../Package.html#getAnnotations()">getAnnotations</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A>[]</CODE></FONT></TD><TD><CODE><B>Class.</B><B><A HREF="../../Class.html#getDeclaredAnnotations()">getDeclaredAnnotations</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回直接存在于此元素上的所有注释。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A>[]</CODE></FONT></TD><TD><CODE><B>Package.</B><B><A HREF="../../Package.html#getDeclaredAnnotations()">getDeclaredAnnotations</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2">类型变量类型为 <A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A> 的 <A HREF="../../package-summary.html">java.lang</A> 中的方法参数</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B>Class.</B><B><A HREF="../../Class.html#isAnnotationPresent(java.lang.Class)">isAnnotationPresent</A></B>(<A HREF="../../Class.html" title="java.lang 中的类">Class</A>&lt;? extends <A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A>&gt;&nbsp;annotationClass)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果指定类型的注释存在于此元素上,则返回 true,否则返回 false。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B>Package.</B><B><A HREF="../../Package.html#isAnnotationPresent(java.lang.Class)">isAnnotationPresent</A></B>(<A HREF="../../Class.html" title="java.lang 中的类">Class</A>&lt;? extends <A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A>&gt;&nbsp;annotationClass)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR></TABLE>&nbsp;<P><A NAME="java.lang.annotation"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><A HREF="../package-summary.html">java.lang.annotation</A> 中 <A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A> 的使用</FONT></TH></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2">实现 <A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A> 的 <A HREF="../package-summary.html">java.lang.annotation</A> 中的类</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;interface</CODE></FONT></TD><TD><CODE><B><A HREF="../Documented.html" title="java.lang.annotation 中的注释">Documented</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;指示某一类型的注释将通过 javadoc 和类似的默认工具进行文档化。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;interface</CODE></FONT></TD><TD><CODE><B><A HREF="../Inherited.html" title="java.lang.annotation 中的注释">Inherited</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;指示注释类型被自动继承。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;interface</CODE></FONT></TD><TD><CODE><B><A HREF="../Retention.html" title="java.lang.annotation 中的注释">Retention</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;指示注释类型的注释要保留多久。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;interface</CODE></FONT></TD><TD><CODE><B><A HREF="../Target.html" title="java.lang.annotation 中的注释">Target</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;指示注释类型所适用的程序元素的种类。</TD></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2">返回变量类型为 <A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A> 的类型的 <A HREF="../package-summary.html">java.lang.annotation</A> 中的方法</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../Class.html" title="java.lang 中的类">Class</A>&lt;? extends <A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A>&gt;</CODE></FONT></TD><TD><CODE><B>Annotation.</B><B><A HREF="../Annotation.html#annotationType()">annotationType</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回此 annotation 的注释类型。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../Class.html" title="java.lang 中的类">Class</A>&lt;? extends <A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A>&gt;</CODE></FONT></TD><TD><CODE><B>IncompleteAnnotationException.</B><B><A HREF="../IncompleteAnnotationException.html#annotationType()">annotationType</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回带有缺少元素的注释类型的 Class 对象。</TD></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2">类型变量类型为 <A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A> 的 <A HREF="../package-summary.html">java.lang.annotation</A> 中的构造方法参数</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../IncompleteAnnotationException.html#IncompleteAnnotationException(java.lang.Class, java.lang.String)">IncompleteAnnotationException</A></B>(<A HREF="../../Class.html" title="java.lang 中的类">Class</A>&lt;? extends <A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A>&gt;&nbsp;annotationType,                              <A HREF="../../String.html" title="java.lang 中的类">String</A>&nbsp;elementName)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;构造一个指示指定注释类型中缺少指定元素的 IncompleteAnnotationException。</TD></TR></TABLE>&nbsp;<P><A NAME="java.lang.reflect"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><A HREF="../../reflect/package-summary.html">java.lang.reflect</A> 中 <A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A> 的使用</FONT></TH></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2">类型参数类型为 <A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A> 的 <A HREF="../../reflect/package-summary.html">java.lang.reflect</A> 中的方法</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T extends <A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A>&gt; <BR>T</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B>AnnotatedElement.</B><B><A HREF="../../reflect/AnnotatedElement.html#getAnnotation(java.lang.Class)">getAnnotation</A></B>(<A HREF="../../Class.html" title="java.lang 中的类">Class</A>&lt;T&gt;&nbsp;annotationType)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果存在该元素的指定类型的注释,则返回这些注释,否则返回 null。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T extends <A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A>&gt; <BR>T</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B>AccessibleObject.</B><B><A HREF="../../reflect/AccessibleObject.html#getAnnotation(java.lang.Class)">getAnnotation</A></B>(<A HREF="../../Class.html" title="java.lang 中的类">Class</A>&lt;T&gt;&nbsp;annotationClass)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T extends <A HREF="../Annotation.html" title="java.lang.annotation 中的接口">Annotation</A>&gt; <BR>T</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B>Field.</B><B><A HREF="../../reflect/Field.html#getAnnotation(java.lang.Class)">getAnnotation</A></B>(<A HREF="../../Class.html" title="java.lang 中的类">Class</A>&lt;T&gt;&nbsp;annotationClass)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?