method.html
来自「j2se5-api-zh,java文档的中文版本」· HTML 代码 · 共 882 行 · 第 1/4 页
HTML
882 行
<!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:23 CST 2005 --><META http-equiv="Content-Type" content="text/html; charset=gb2312"><TITLE>Method (Java 2 Platform SE 5.0)</TITLE><META NAME="keywords" CONTENT="java.lang.reflect.Method class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="Method (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/Method.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="Member.html" title="java.lang.reflect 中的接口"><B>上一个类</B></A> <A HREF="Modifier.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_2FMethod.html" target="_top"><B>框架</B></A> <A HREF="Method.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>类 Method</H2><PRE><A HREF="../Object.html" title="java.lang 中的类">java.lang.Object</A> <IMG SRC="../../../resources/inherit.gif" ALT="继承者 "><A HREF="AccessibleObject.html" title="java.lang.reflect 中的类">java.lang.reflect.AccessibleObject</A> <IMG SRC="../../../resources/inherit.gif" ALT="继承者 "><B>java.lang.reflect.Method</B></PRE><DL><DT><B>所有已实现的接口:</B> <DD><A HREF="AnnotatedElement.html" title="java.lang.reflect 中的接口">AnnotatedElement</A>, <A HREF="GenericDeclaration.html" title="java.lang.reflect 中的接口">GenericDeclaration</A>, <A HREF="Member.html" title="java.lang.reflect 中的接口">Member</A></DD></DL><HR><DL><DT><PRE>public final class <B>Method</B><DT>extends <A HREF="AccessibleObject.html" title="java.lang.reflect 中的类">AccessibleObject</A><DT>implements <A HREF="GenericDeclaration.html" title="java.lang.reflect 中的接口">GenericDeclaration</A>, <A HREF="Member.html" title="java.lang.reflect 中的接口">Member</A></DL></PRE><P><code>Method</code> 提供关于类或接口上单独某个方法(以及如何访问该方法)的信息。所反映的方法可能是类方法或实例方法(包括抽象方法)。<p><code>Method</code> 允许在匹配要调用的实参与基础方法的形参时进行扩展转换;但如果要进行收缩转换,则会抛出 <code>IllegalArgumentException</code>。<P><P><DL><DT><B>另请参见:</B><DD><A HREF="Member.html" title="java.lang.reflect 中的接口"><CODE>Member</CODE></A>, <A HREF="../Class.html" title="java.lang 中的类"><CODE>Class</CODE></A>, <A HREF="../Class.html#getMethods()"><CODE>Class.getMethods()</CODE></A>, <A HREF="../Class.html#getMethod(java.lang.String, java.lang.Class...)"><CODE>Class.getMethod(String, Class[])</CODE></A>, <A HREF="../Class.html#getDeclaredMethods()"><CODE>Class.getDeclaredMethods()</CODE></A>, <A HREF="../Class.html#getDeclaredMethod(java.lang.String, java.lang.Class...)"><CODE>Class.getDeclaredMethod(String, Class[])</CODE></A></DL><HR><P><!-- =========== FIELD SUMMARY =========== --><A NAME="field_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></TABLE> <A NAME="fields_inherited_from_class_java.lang.reflect.Member"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>从接口 java.lang.reflect.<A HREF="Member.html" title="java.lang.reflect 中的接口">Member</A> 继承的字段</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="Member.html#DECLARED">DECLARED</A>, <A HREF="Member.html#PUBLIC">PUBLIC</A></CODE></TD></TR></TABLE> <!-- ========== 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> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="Method.html#equals(java.lang.Object)">equals</A></B>(<A HREF="../Object.html" title="java.lang 中的类">Object</A> obj)</CODE><BR> 将此 <code>Method</code> 与指定对象进行比较。</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><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="Method.html#getAnnotation(java.lang.Class)">getAnnotation</A></B>(<A HREF="../Class.html" title="java.lang 中的类">Class</A><T> annotationClass)</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="Method.html#getDeclaredAnnotations()">getDeclaredAnnotations</A></B>()</CODE><BR> 返回直接存在于此元素上的所有注释。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../Class.html" title="java.lang 中的类">Class</A><?></CODE></FONT></TD><TD><CODE><B><A HREF="Method.html#getDeclaringClass()">getDeclaringClass</A></B>()</CODE><BR> 返回表示声明由此 <code>Method</code> 对象表示的方法的类或接口的 <code>Class</code> 对象。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../Object.html" title="java.lang 中的类">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="Method.html#getDefaultValue()">getDefaultValue</A></B>()</CODE><BR> 返回由此 <tt>Method</tt> 实例表示的注释成员的默认值。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../Class.html" title="java.lang 中的类">Class</A><?>[]</CODE></FONT></TD><TD><CODE><B><A HREF="Method.html#getExceptionTypes()">getExceptionTypes</A></B>()</CODE><BR> 返回 <code>Class</code> 对象的数组,这些对象描述了声明将此 <code>Method</code> 对象表示的基础方法抛出的异常类型。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="Type.html" title="java.lang.reflect 中的接口">Type</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="Method.html#getGenericExceptionTypes()">getGenericExceptionTypes</A></B>()</CODE><BR> 返回 <tt>Type</tt> 对象数组,这些对象描述了声明由此 <tt>Method</tt> 对象抛出的异常。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="Type.html" title="java.lang.reflect 中的接口">Type</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="Method.html#getGenericParameterTypes()">getGenericParameterTypes</A></B>()</CODE><BR> 按照声明顺序返回 <tt>Type</tt> 对象的数组,这些对象描述了此 <tt>Method</tt> 对象所表示的方法的形参类型的。</TD></TR>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?