annotatedelement.html
来自「j2se5-api-zh,java文档的中文版本」· HTML 代码 · 共 312 行 · 第 1/2 页
HTML
312 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_03) on Wed Nov 02 09:50:17 CST 2005 --><META http-equiv="Content-Type" content="text/html; charset=gb2312"><TITLE>AnnotatedElement (Java 2 Platform SE 5.0)</TITLE><META NAME="keywords" CONTENT="java.lang.reflect.AnnotatedElement interface"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="AnnotatedElement (Java 2 Platform SE 5.0)";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="跳过导航链接"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>概述</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>类</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/AnnotatedElement.html"><FONT CLASS="NavBarFont1"><B>使用</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>已过时</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Standard Ed. 5.0</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="AccessibleObject.html" title="java.lang.reflect 中的类"><B>上一个类</B></A> <A HREF="Array.html" title="java.lang.reflect 中的类"><B>下一个类</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html@java_2Flang_2Freflect_2FAnnotatedElement.html" target="_top"><B>框架</B></A> <A HREF="AnnotatedElement.html" target="_top"><B>无框架</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>所有类</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>所有类</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 摘要: 嵌套 | 字段 | 构造方法 | <A HREF="#method_summary">方法</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">详细信息: 字段 | 构造方法 | <A HREF="#method_detail">方法</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">java.lang.reflect</FONT><BR>接口 AnnotatedElement</H2><DL><DT><B>所有已知实现类:</B> <DD><A HREF="AccessibleObject.html" title="java.lang.reflect 中的类">AccessibleObject</A>, <A HREF="../Class.html" title="java.lang 中的类">Class</A>, <A HREF="Constructor.html" title="java.lang.reflect 中的类">Constructor</A>, <A HREF="Field.html" title="java.lang.reflect 中的类">Field</A>, <A HREF="Method.html" title="java.lang.reflect 中的类">Method</A>, <A HREF="../Package.html" title="java.lang 中的类">Package</A></DD></DL><HR><DL><DT><PRE>public interface <B>AnnotatedElement</B></DL></PRE><P>表示目前正在此 VM 中运行的程序的一个已注释元素。该接口允许反射性地读取注释。由此接口中的方法返回的所有注释都是不可变并且可序列化的。调用方可以修改已赋值数组枚举成员的访问器返回的数组;这不会对其他调用方返回的数组产生任何影响。<p>如果此接口中的方法返回的注释(直接或间接地)包含一个已赋值的 <A HREF="../Class.html" title="java.lang 中的类"><CODE>Class</CODE></A> 成员,该成员引用了一个在此 VM 中不可访问的类,则试图通过在返回的注释上调用相关的类返回的方法来读取该类,将导致一个 <A HREF="../TypeNotPresentException.html" title="java.lang 中的类"><CODE>TypeNotPresentException</CODE></A>。<p>类似地,如果注释中的枚举常量不再以枚举类型存在,那么试图读取一个已赋值的枚举成员将导致一个 <A HREF="../EnumConstantNotPresentException.html" title="java.lang 中的类"><CODE>EnumConstantNotPresentException</CODE></A>。 <p>最后,阅读其定义已经引起不兼容性的成员将导致 <A HREF="../annotation/AnnotationTypeMismatchException.html" title="java.lang.annotation 中的类"><CODE>AnnotationTypeMismatchException</CODE></A> 或 <A HREF="../annotation/IncompleteAnnotationException.html" title="java.lang.annotation 中的类"><CODE>IncompleteAnnotationException</CODE></A>。<P><P><DL><DT><B>从以下版本开始:</B></DT> <DD>1.5</DD></DL><HR><P><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>方法摘要</B></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><T extends <A HREF="../annotation/Annotation.html" title="java.lang.annotation 中的接口">Annotation</A>> <BR>T</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="AnnotatedElement.html#getAnnotation(java.lang.Class)">getAnnotation</A></B>(<A HREF="../Class.html" title="java.lang 中的类">Class</A><T> annotationType)</CODE><BR> 如果存在该元素的指定类型的注释,则返回这些注释,否则返回 null。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../annotation/Annotation.html" title="java.lang.annotation 中的接口">Annotation</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="AnnotatedElement.html#getAnnotations()">getAnnotations</A></B>()</CODE><BR> 返回此元素上存在的所有注释。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../annotation/Annotation.html" title="java.lang.annotation 中的接口">Annotation</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="AnnotatedElement.html#getDeclaredAnnotations()">getDeclaredAnnotations</A></B>()</CODE>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?