📄 descriptorsupport.html
字号:
</DD></DL><HR><A NAME="getFieldValues(java.lang.String[])"><!-- --></A><H3>getFieldValues</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>[] <B>getFieldValues</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] fieldNames)</PRE><DL><DD>Returns all the field values in the descriptor as an array of Objects. The returned values are in the same order as the fieldNames String array parameter.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/management/Descriptor.html#getFieldValues(java.lang.String[])">getFieldValues</A></CODE> in interface <CODE><A HREF="../../../javax/management/Descriptor.html" title="interface in javax.management">Descriptor</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>fieldNames</CODE> - String array of the names of the fields that the values should be returned for.<br> If the array is empty then an empty array will be returned.<br> If the array is 'null' then all values will be returned. The order is not the order in which the fields were set.<br> If a field name in the array does not exist, then null is returned for the matching array element being returned.<DT><B>Returns:</B><DD>Object array of field values. If the descriptor is empty, you will get an empty array.</DL></DD></DL><HR><A NAME="setFields(java.lang.String[], java.lang.Object[])"><!-- --></A><H3>setFields</H3><PRE>public void <B>setFields</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] fieldNames, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>[] fieldValues) throws <A HREF="../../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</A></PRE><DL><DD>Sets all Fields in the list to the new value in with the same index in the fieldValue array. Array sizes must match. The field value will be validated before it is set (by calling the method <A HREF="../../../javax/management/modelmbean/DescriptorSupport.html#isValid()"><CODE>isValid</CODE></A>) If it is not valid, then an exception will be thrown. If the arrays are empty, then no change will take effect.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/management/Descriptor.html#setFields(java.lang.String[], java.lang.Object[])">setFields</A></CODE> in interface <CODE><A HREF="../../../javax/management/Descriptor.html" title="interface in javax.management">Descriptor</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>fieldNames</CODE> - String array of field names. The array and array elements cannot be null.<DD><CODE>fieldValues</CODE> - Object array of the corresponding field values. The array cannot be null. Elements of the array can be null.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</A></CODE> - for illegal value for field Names or field Values. Neither can be null. The array lengths must be equal.<DT><B>See Also:</B><DD><A HREF="../../../javax/management/modelmbean/DescriptorSupport.html#getFields()"><CODE>getFields()</CODE></A></DL></DD></DL><HR><A NAME="clone()"><!-- --></A><H3>clone</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>clone</B>() throws <A HREF="../../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</A></PRE><DL><DD>Returns a new Descriptor which is a duplicate of the Descriptor.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/management/Descriptor.html#clone()">clone</A></CODE> in interface <CODE><A HREF="../../../javax/management/Descriptor.html" title="interface in javax.management">Descriptor</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</A></CODE> - for illegal value for field Names or field Values. If the descriptor construction fails for any reason, this exception will be thrown.</DL></DD></DL><HR><A NAME="removeField(java.lang.String)"><!-- --></A><H3>removeField</H3><PRE>public void <B>removeField</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> fieldName)</PRE><DL><DD>Removes a field from the descriptor.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/management/Descriptor.html#removeField(java.lang.String)">removeField</A></CODE> in interface <CODE><A HREF="../../../javax/management/Descriptor.html" title="interface in javax.management">Descriptor</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>fieldName</CODE> - String name of the field to be removed. If the field is not found no exception is thrown.</DL></DD></DL><HR><A NAME="isValid()"><!-- --></A><H3>isValid</H3><PRE>public boolean <B>isValid</B>() throws <A HREF="../../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</A></PRE><DL><DD>Returns true if all of the fields have legal values given their names. <P> This implementation does not support interopreating with a directory or lookup service. Thus, conforming to the specification, no checking is done on the <i>"export"</i> field. <P> Otherwise this implementation returns false if: <P> <UL> <LI> name and descriptorType fieldNames are not defined, or null, or empty, or not String <LI> class, role, getMethod, setMethod fieldNames, if defined, are null or not String <LI> persistPeriod, currencyTimeLimit, lastUpdatedTimeStamp, lastReturnedTimeStamp if defined, are null, or not a Numeric String or not a Numeric Value >= -1 <LI> log fieldName, if defined, is null, or not a Boolean or not a String with value "t", "f", "true", "false". These String values must not be case sensitive. <LI> visibility fieldName, if defined, is null, or not a Numeric String or a not Numeric Value >= 1 and <= 4 <LI> severity fieldName, if defined, is null, or not a Numeric String or not a Numeric Value >= 1 and <= 5<br> <LI> persistPolicy fieldName, if defined, is null, or not a following String :<br> "OnUpdate", "OnTimer", "NoMoreOftenThan", "Always", "Never". These String values must not be case sensitive.<br> </UL><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/management/Descriptor.html#isValid()">isValid</A></CODE> in interface <CODE><A HREF="../../../javax/management/Descriptor.html" title="interface in javax.management">Descriptor</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the values are legal.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</A></CODE> - If the validity checking fails for any reason, this exception will be thrown.</DL></DD></DL><HR><A NAME="toXMLString()"><!-- --></A><H3>toXMLString</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>toXMLString</B>()</PRE><DL><DD><p>Returns an XML String representing the descriptor.</p> <p>The format is not defined, but an implementation must ensure that the string returned by this method can be used to build an equivalent descriptor when instantiated using the constructor <A HREF="../../../javax/management/modelmbean/DescriptorSupport.html#DescriptorSupport(java.lang.String)"><CODE>DescriptorSupport(String inStr)</CODE></A>.</p> <p>Fields which are not String objects will have toString() called on them to create the value. The value will be enclosed in parentheses. It is not guaranteed that you can reconstruct these objects unless they have been specifically set up to support toString() in a meaningful format and have a matching constructor that accepts a String in the same format.</p> <p>If the descriptor is empty the following String is returned: <Descriptor></Descriptor></p><P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the XML string.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</A></CODE> - for illegal value for field Names or field Values. If the XML formated string construction fails for any reason, this exception will be thrown.</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>toString</B>()</PRE><DL><DD>Returns <pv>a human readable string representing the descriptor</pv>. The string will be in the format of "fieldName=fieldValue,fieldName2=fieldValue2,..."<br> If there are no fields in the descriptor, then an empty String is returned.<br> If a fieldValue is an object then the toString() method is called on it and its returned value is used as the value for the field enclosed in parenthesis.<P><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</A></CODE> - for illegal value for field Names or field Values. If the descriptor string fails for any reason, this exception will be thrown.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_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>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="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-all.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>Ent. Ed. v1.4</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../../javax/management/modelmbean/ModelMBeanAttributeInfo.html" title="class in javax.management.modelmbean"><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="DescriptorSupport.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | 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><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2003 Sun Microsystems, Inc. All rights reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -