📄 propertydescriptor.html
字号:
</TABLE><A NAME="PropertyDescriptor(java.lang.String, java.lang.Class)"><!-- --></A><H3>PropertyDescriptor</H3><PRE>public <B>PropertyDescriptor</B>(<A HREF="../../java/lang/String.html">String</A> propertyName, <A HREF="../../java/lang/Class.html">Class</A> beanClass) throws <A HREF="../../java/beans/IntrospectionException.html">IntrospectionException</A></PRE><DL><DD>Constructs a PropertyDescriptor for a property that follows the standard Java convention by having getFoo and setFoo accessor methods. Thus if the argument name is "fred", it will assume that the writer method is "setFred" and the reader method is "getFred" (or "isFred" for a boolean property). Note that the property name should start with a lower case character, which will be capitalized in the method names.<DD><DL><DT><B>Parameters:</B><DD><CODE>propertyName</CODE> - The programmatic name of the property.<DD><CODE>beanClass</CODE> - The Class object for the target bean. For example sun.beans.OurButton.class.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/beans/IntrospectionException.html">IntrospectionException</A></CODE> - if an exception occurs during introspection.</DL></DD></DL><HR><A NAME="PropertyDescriptor(java.lang.String, java.lang.Class, java.lang.String, java.lang.String)"><!-- --></A><H3>PropertyDescriptor</H3><PRE>public <B>PropertyDescriptor</B>(<A HREF="../../java/lang/String.html">String</A> propertyName, <A HREF="../../java/lang/Class.html">Class</A> beanClass, <A HREF="../../java/lang/String.html">String</A> getterName, <A HREF="../../java/lang/String.html">String</A> setterName) throws <A HREF="../../java/beans/IntrospectionException.html">IntrospectionException</A></PRE><DL><DD>This constructor takes the name of a simple property, and method names for reading and writing the property.<DD><DL><DT><B>Parameters:</B><DD><CODE>propertyName</CODE> - The programmatic name of the property.<DD><CODE>beanClass</CODE> - The Class object for the target bean. For example sun.beans.OurButton.class.<DD><CODE>getterName</CODE> - The name of the method used for reading the property value. May be null if the property is write-only.<DD><CODE>setterName</CODE> - The name of the method used for writing the property value. May be null if the property is read-only.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/beans/IntrospectionException.html">IntrospectionException</A></CODE> - if an exception occurs during introspection.</DL></DD></DL><HR><A NAME="PropertyDescriptor(java.lang.String, java.lang.reflect.Method, java.lang.reflect.Method)"><!-- --></A><H3>PropertyDescriptor</H3><PRE>public <B>PropertyDescriptor</B>(<A HREF="../../java/lang/String.html">String</A> propertyName, <A HREF="../../java/lang/reflect/Method.html">Method</A> getter, <A HREF="../../java/lang/reflect/Method.html">Method</A> setter) throws <A HREF="../../java/beans/IntrospectionException.html">IntrospectionException</A></PRE><DL><DD>This constructor takes the name of a simple property, and Method objects for reading and writing the property.<DD><DL><DT><B>Parameters:</B><DD><CODE>propertyName</CODE> - The programmatic name of the property.<DD><CODE>getter</CODE> - The method used for reading the property value. May be null if the property is write-only.<DD><CODE>setter</CODE> - The method used for writing the property value. May be null if the property is read-only.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/beans/IntrospectionException.html">IntrospectionException</A></CODE> - if an exception occurs during introspection.</DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getPropertyType()"><!-- --></A><H3>getPropertyType</H3><PRE>public <A HREF="../../java/lang/Class.html">Class</A> <B>getPropertyType</B>()</PRE><DL><DD>Gets the Class object for the property.<DD><DL><DT><B>Returns:</B><DD>The Java type info for the property. Note that the "Class" object may describe a built-in Java type such as "int". The result may be "null" if this is an indexed property that does not support non-indexed access. <p> This is the type that will be returned by the ReadMethod.</DL></DD></DL><HR><A NAME="getReadMethod()"><!-- --></A><H3>getReadMethod</H3><PRE>public <A HREF="../../java/lang/reflect/Method.html">Method</A> <B>getReadMethod</B>()</PRE><DL><DD>Gets the method that should be used to read the property value.<DD><DL><DT><B>Returns:</B><DD>The method that should be used to read the property value. May return null if the property can't be read.</DL></DD></DL><HR><A NAME="setReadMethod(java.lang.reflect.Method)"><!-- --></A><H3>setReadMethod</H3><PRE>public void <B>setReadMethod</B>(<A HREF="../../java/lang/reflect/Method.html">Method</A> getter) throws <A HREF="../../java/beans/IntrospectionException.html">IntrospectionException</A></PRE><DL><DD>Sets the method that should be used to read the property value.<DD><DL><DT><B>Parameters:</B><DD><CODE>getter</CODE> - The new getter method.</DL></DD></DL><HR><A NAME="getWriteMethod()"><!-- --></A><H3>getWriteMethod</H3><PRE>public <A HREF="../../java/lang/reflect/Method.html">Method</A> <B>getWriteMethod</B>()</PRE><DL><DD>Gets the method that should be used to write the property value.<DD><DL><DT><B>Returns:</B><DD>The method that should be used to write the property value. May return null if the property can't be written.</DL></DD></DL><HR><A NAME="setWriteMethod(java.lang.reflect.Method)"><!-- --></A><H3>setWriteMethod</H3><PRE>public void <B>setWriteMethod</B>(<A HREF="../../java/lang/reflect/Method.html">Method</A> setter) throws <A HREF="../../java/beans/IntrospectionException.html">IntrospectionException</A></PRE><DL><DD>Sets the method that should be used to write the property value.<DD><DL><DT><B>Parameters:</B><DD><CODE>setter</CODE> - The new setter method.</DL></DD></DL><HR><A NAME="isBound()"><!-- --></A><H3>isBound</H3><PRE>public boolean <B>isBound</B>()</PRE><DL><DD>Updates to "bound" properties will cause a "PropertyChange" event to get fired when the property is changed.<DD><DL><DT><B>Returns:</B><DD>True if this is a bound property.</DL></DD></DL><HR><A NAME="setBound(boolean)"><!-- --></A><H3>setBound</H3><PRE>public void <B>setBound</B>(boolean bound)</PRE><DL><DD>Updates to "bound" properties will cause a "PropertyChange" event to get fired when the property is changed.<DD><DL><DT><B>Parameters:</B><DD><CODE>bound</CODE> - True if this is a bound property.</DL></DD></DL><HR><A NAME="isConstrained()"><!-- --></A><H3>isConstrained</H3><PRE>public boolean <B>isConstrained</B>()</PRE><DL><DD>Attempted updates to "Constrained" properties will cause a "VetoableChange" event to get fired when the property is changed.<DD><DL><DT><B>Returns:</B><DD>True if this is a constrained property.</DL></DD></DL><HR><A NAME="setConstrained(boolean)"><!-- --></A><H3>setConstrained</H3><PRE>public void <B>setConstrained</B>(boolean constrained)</PRE><DL><DD>Attempted updates to "Constrained" properties will cause a "VetoableChange" event to get fired when the property is changed.<DD><DL><DT><B>Parameters:</B><DD><CODE>constrained</CODE> - True if this is a constrained property.</DL></DD></DL><HR><A NAME="setPropertyEditorClass(java.lang.Class)"><!-- --></A><H3>setPropertyEditorClass</H3><PRE>public void <B>setPropertyEditorClass</B>(<A HREF="../../java/lang/Class.html">Class</A> propertyEditorClass)</PRE><DL><DD>Normally PropertyEditors will be found using the PropertyEditorManager. However if for some reason you want to associate a particular PropertyEditor with a given property, then you can do it with this method.<DD><DL><DT><B>Parameters:</B><DD><CODE>propertyEditorClass</CODE> - The Class for the desired PropertyEditor.</DL></DD></DL><HR><A NAME="getPropertyEditorClass()"><!-- --></A><H3>getPropertyEditorClass</H3><PRE>public <A HREF="../../java/lang/Class.html">Class</A> <B>getPropertyEditorClass</B>()</PRE><DL><DD>Gets any explicit PropertyEditor Class that has been registered for this property.<DD><DL><DT><B>Returns:</B><DD>Any explicit PropertyEditor Class that has been registered for this property. Normally this will return "null", indicating that no special editor has been registered, so the PropertyEditorManager should be used to locate a suitable PropertyEditor.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/PropertyDescriptor.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</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>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../java/beans/PropertyChangeSupport.html"><B>PREV CLASS</B></A> <A HREF="../../java/beans/PropertyEditorManager.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="PropertyDescriptor.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -