501 lines
40 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="header">
<div class="subTitle">
compact3
</div>
<div class="subTitle">
javax.management
</div>
<h2 class="title" title="Interface Descriptor">Interface Descriptor</h2>
</div><div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>
All Superinterfaces:
</dt>
<dd>
<span><a href="../../java/lang/Cloneable.html" title="java.lang中的接口">Cloneable</a> <a href="../../java/io/Serializable.html" title="java.io中的接口">Serializable</a></span>
</dd>
</dl>
<dl>
<dt>
所有已知实现类:
</dt>
<dd>
<span><a href="../../javax/management/modelmbean/DescriptorSupport.html" title="javax.management.modelmbean中的类">DescriptorSupport</a> <a href="../../javax/management/ImmutableDescriptor.html" title="javax.management中的类">ImmutableDescriptor</a></span>
</dd>
</dl>
<hr/> <br/> <pre>public interface <span class="typeNameLabel">Descriptor</span>
extends <a href="../../java/io/Serializable.html" title="interface in java.io">Serializable</a>, <a href="../../java/lang/Cloneable.html" title="interface in java.lang">Cloneable</a></pre>
<div class="block">
<p> <span>JMX元素的附加元数据。</span> <span>A <code>Descriptor</code><a href="../../javax/management/MBeanInfo.html" title="javax.management中的类"><code>MBeanInfo</code>,<code>MBeanAttributeInfo</code></a>等相关<a href="../../javax/management/MBeanAttributeInfo.html" title="javax.management中的类"></a> 。它由一系列字段组成。</span> <span>字段是名称和关联值。</span> </p>
<p> <span>字段名称不区分大小写。</span> <span>名称<code>descriptorType</code> <code>descriptortype</code><code>DESCRIPTORTYPE</code>都是等效的。</span> <span>但是,首先设置字段时使用的情况在<a href="../../javax/management/Descriptor.html#getFields--"><code>getFields()</code></a><a href="../../javax/management/Descriptor.html#getFieldNames--"><code>getFieldNames()</code></a>方法的结果中<a href="../../javax/management/Descriptor.html#getFieldNames--">保留</a></span> </p>
<p> <span>并非所有字段名称和值都是预定义的。</span> <span>任何程序都可以定义和添加新的字段。</span> </p>
<p> <span>描述符可以是可变的或不可变的。</span> <span>一个不可变的描述符,一旦创建,永远不会改变。</span> <span>可以修改描述<code>Descriptor</code>内容的Descriptor方法将抛出一个不可变描述符的异常。</span> <span>不可变描述符通常是<a href="../../javax/management/ImmutableDescriptor.html" title="javax.management中的类"><code>ImmutableDescriptor</code></a>或子类的<a href="../../javax/management/ImmutableDescriptor.html" title="javax.management中的类">实例</a></span> <span>可变描述符通常是<a href="../../javax/management/modelmbean/DescriptorSupport.html" title="javax.management.modelmbean中的类"><code>DescriptorSupport</code></a>或子类的<a href="../../javax/management/modelmbean/DescriptorSupport.html" title="javax.management.modelmbean中的类">实例</a></span> </p>
<p> <span>某些字段由JMX实现使用。</span> <span>这意味着该字段的存在可能会改变JMX API的行为或者可以在JMX API返回的描述符中设置该字段。</span> <span>这些字段在下表中以<i>斜体显示</i> ,并且每个字段在<a href="../../javax/management/JMX.html" title="javax.management中的类"><code>JMX</code></a>类中都有一个对应的常量。</span> <span>例如,该字段<code>defaultValue</code>由恒定表示<a href="../../javax/management/JMX.html#DEFAULT_VALUE_FIELD"><code>JMX.DEFAULT_VALUE_FIELD</code></a></span> </p>
<p> <span>某些其他字段具有下表中描述的常规含义但不需要由JMX实现来理解或设置。</span> </p>
<p> <span>在此版本和所有将来的版本中由JMX规范定义的字段名称将永远不会包含句点</span> <span>用户可以通过在名称中包含一段时间来安全地创建自己的字段并确保这些名称不会与任何将来版本的JMX API相冲突。</span> <span>建议遵循Java包命名约定以避免来自不同来源的字段名称之间的冲突。</span> <span>例如, <code>example.com</code>创建的<code>example.com</code>可能具有名称<code>com.example.interestLevel</code></span> </p>
<p> <span>需要注意的是,在值<code>defaultValue</code> <code>legalValues</code> <code>maxValue</code><code>minValue</code>领域应该由返回的类型一致<code>getType()</code>方法相关<code>MBeanAttributeInfo</code><code>MBeanParameterInfo</code></span> <span>对于MXBeans这意味着它们应该是<a href="MXBean.html#mapping-rules">MXBean type mapping rules</a>中的映射Java类型称为<em>opendata</em> J</span> </p>
<span> Name Type Used in Meaning <i>defaultValue</i> Object MBeanAttributeInfo<br/>MBeanParameterInfo Default value for an attribute or parameter. See <a href="../../javax/management/openmbean/package-summary.html"><code>javax.management.openmbean</code></a>. deprecated String Any An indication that this element of the information model is no longer recommended for use. A set of MBeans defined by an application is collectively called an <em>information model</em>. The convention is for the value of this field to contain a string that is the version of the model in which the element was first deprecated, followed by a space, followed by an explanation of the deprecation, for example <code>"1.3 Replaced by the Capacity attribute"</code>. descriptionResource<br/> BundleBaseName String Any The base name for the <a href="../../java/util/ResourceBundle.html" title="class in java.util"><code>ResourceBundle</code></a> in which the key given in the <code>descriptionResourceKey</code> field can be found, for example <code>"com.example.myapp.MBeanResources"</code>. The meaning of this field is defined by this specification but the field is not set or used by the JMX API itself. descriptionResourceKey String Any A resource key for the description of this element. In conjunction with the <code>descriptionResourceBundleBaseName</code>, this can be used to find a localized version of the description. The meaning of this field is defined by this specification but the field is not set or used by the JMX API itself. enabled String MBeanAttributeInfo<br/>MBeanNotificationInfo<br/>MBeanOperationInfo The string <code>"true"</code> or <code>"false"</code> according as this item is enabled. When an attribute or operation is not enabled, it exists but cannot currently be accessed. A user interface might present it as a greyed-out item. For example, an attribute might only be meaningful after the <code>start()</code> method of an MBean has been called, and is otherwise disabled. Likewise, a notification might be disabled if it cannot currently be emitted but could be in other circumstances. exceptions String[] MBeanAttributeInfo, MBeanConstructorInfo, MBeanOperationInfo The class names of the exceptions that can be thrown when invoking a constructor or operation, or getting an attribute. The meaning of this field is defined by this specification but the field is not set or used by the JMX API itself. Exceptions thrown when setting an attribute are specified by the field <a href="#setExceptions"><code>setExceptions</code></a>. <i>immutableInfo</i> String MBeanInfo The string <code>"true"</code> or <code>"false"</code> according as this MBean's MBeanInfo is <em>immutable</em>. When this field is true, the MBeanInfo for the given MBean is guaranteed not to change over the lifetime of the MBean. Hence, a client can read it once and cache the read value. When this field is false or absent, there is no such guarantee, although that does not mean that the MBeanInfo will necessarily change. See also the <a href="MBeanInfo.html#info-changed"><code>"jmx.mbean.info.changed"</code></a> notification. infoTimeout String<br/>Long MBeanInfo The time in milli-seconds that the MBeanInfo can reasonably be expected to be unchanged. The value can be a <code>Long</code> or a decimal string. This provides a hint from a DynamicMBean or any MBean that does not define <code>immutableInfo</code> as <code>true</code> that the MBeanInfo is not likely to change within this period and therefore can be cached. When this field is missing or has the value zero, it is not recommended to cache the MBeanInfo unless it has the <code>immutableInfo</code> set to <code>true</code> or it has <a href="MBeanInfo.html#info-changed"><code>"jmx.mbean.info.changed"</code></a> in its <a href="../../javax/management/MBeanNotificationInfo.html" title="class in javax.management"><code>MBeanNotificationInfo</code></a> array. <i>interfaceClassName</i> String MBeanInfo The Java interface name for a Standard MBean or MXBean, as returned by <a href="../../java/lang/Class.html#getName--"><code>Class.getName()</code></a>. A Standard MBean or MXBean registered directly in the MBean Server or created using the <a href="../../javax/management/StandardMBean.html" title="class in javax.management"><code>StandardMBean</code></a> class will have this field in its MBeanInfo Descriptor. <i>legalValues</i> Set&lt;?&gt; MBeanAttributeInfo<br/>MBeanParameterInfo Legal values for an attribute or parameter. See <a href="../../javax/management/openmbean/package-summary.html"><code>javax.management.openmbean</code></a>. locale String Any The <a href="../../java/util/Locale.html" title="class in java.util">locale</a> of the description in this <code>MBeanInfo</code>, <code>MBeanAttributeInfo</code>, etc, as returned by <a href="../../java/util/Locale.html#toString--"><code>Locale.toString()</code></a>. <i>maxValue</i> Object MBeanAttributeInfo<br/>MBeanParameterInfo Maximum legal value for an attribute or parameter. See <a href="../../javax/management/openmbean/package-summary.html"><code>javax.management.openmbean</code></a>. metricType String MBeanAttributeInfo<br/>MBeanOperationInfo The type of a metric, one of the strings "counter" or "gauge". A metric is a measurement exported by an MBean, usually an attribute but sometimes the result of an operation. A metric that is a <em>counter</em> has a value that never decreases except by being reset to a starting value. Counter metrics are almost always non-negative integers. An example might be the number of requests received. A metric that is a <em>gauge</em> has a numeric value that can increase or decrease. Examples might be the number of open connections or a cache hit rate or a temperature reading. <i>minValue</i> Object MBeanAttributeInfo<br/>MBeanParameterInfo Minimum legal value for an attribute or parameter. See <a href="../../javax/management/openmbean/package-summary.html"><code>javax.management.openmbean</code></a>. <i>mxbean</i> String MBeanInfo The string <code>"true"</code> or <code>"false"</code> according as this MBean is an <a href="../../javax/management/MXBean.html" title="annotation in javax.management"><code>MXBean</code></a>. A Standard MBean or MXBean registered directly with the MBean Server or created using the <a href="../../javax/management/StandardMBean.html" title="class in javax.management"><code>StandardMBean</code></a> class will have this field in its MBeanInfo Descriptor. <i>openType</i> <a href="../../javax/management/openmbean/OpenType.html" title="class in javax.management.openmbean"><code>OpenType</code></a> MBeanAttributeInfo<br/>MBeanOperationInfo<br/>MBeanParameterInfo <p>The Open Type of this element. In the case of <code>MBeanAttributeInfo</code> and <code>MBeanParameterInfo</code>, this is the Open Type of the attribute or parameter. In the case of <code>MBeanOperationInfo</code>, it is the Open Type of the return value. This field is set in the Descriptor for all instances of <a href="../../javax/management/openmbean/OpenMBeanAttributeInfoSupport.html" title="class in javax.management.openmbean"><code>OpenMBeanAttributeInfoSupport</code></a>, <a href="../../javax/management/openmbean/OpenMBeanOperationInfoSupport.html" title="class in javax.management.openmbean"><code>OpenMBeanOperationInfoSupport</code></a>, and <a href="../../javax/management/openmbean/OpenMBeanParameterInfoSupport.html" title="class in javax.management.openmbean"><code>OpenMBeanParameterInfoSupport</code></a>. It is also set for attributes, operations, and parameters of MXBeans.</p> <p>This field can be set for an <code>MBeanNotificationInfo</code>, in which case it indicates the Open Type that the <a href="../../javax/management/Notification.html#getUserData--"><code>user data</code></a> will have.</p> <i>originalType</i> String MBeanAttributeInfo<br/>MBeanOperationInfo<br/>MBeanParameterInfo <p>The original Java type of this element as it appeared in the <a href="../../javax/management/MXBean.html" title="annotation in javax.management"><code>MXBean</code></a> interface method that produced this <code>MBeanAttributeInfo</code> (etc). For example, a method<br/> <code>public </code> <a href="../../java/lang/management/MemoryUsage.html" title="class in java.lang.management"><code>MemoryUsage</code></a><code> getHeapMemoryUsage();</code><br/> in an MXBean interface defines an attribute called <code>HeapMemoryUsage</code> of type <a href="../../javax/management/openmbean/CompositeData.html" title="interface in javax.management.openmbean"><code>CompositeData</code></a>. The <code>originalType</code> field in the Descriptor for this attribute will have the value <code>"java.lang.management.MemoryUsage"</code>. </p><p>The format of this string is described in the section <a href="MXBean.html#type-names">Type Names</a> of the MXBean specification.</p> <i>setExceptions</i> String[] MBeanAttributeInfo The class names of the exceptions that can be thrown when setting an attribute. The meaning of this field is defined by this specification but the field is not set or used by the JMX API itself. Exceptions thrown when getting an attribute are specified by the field <a href="#exceptions"><code>exceptions</code></a>. severity String<br/>Integer MBeanNotificationInfo The severity of this notification. It can be 0 to mean unknown severity or a value from 1 to 6 representing decreasing levels of severity. It can be represented as a decimal string or an <code>Integer</code>. since String Any The version of the information model in which this element was introduced. A set of MBeans defined by an application is collectively called an <em>information model</em>. The application may also define versions of this model, and use the <code>"since"</code> field to record the version in which an element first appeared. units String MBeanAttributeInfo<br/>MBeanParameterInfo<br/>MBeanOperationInfo The units in which an attribute, parameter, or operation return value is measured, for example <code>"bytes"</code> or <code>"seconds"</code>. </span>
<table border="1" cellpadding="5" summary="Descriptor Fields">
</table>
<p> <span>一些其他字段由模型MBean定义。</span> <span>请参阅信息<a href="modelmbean/ModelMBeanInfo.html#descriptor">
<!--
--><code>ModelMBeanInfo</code></a> <a href="modelmbean/ModelMBeanAttributeInfo.html#descriptor">
<!--
--><code>ModelMBeanAttributeInfo</code></a> <a href="modelmbean/ModelMBeanConstructorInfo.html#descriptor">
<!--
--><code>ModelMBeanConstructorInfo</code></a> <a href="modelmbean/ModelMBeanNotificationInfo.html#descriptor">
<!--
--><code>ModelMBeanNotificationInfo</code></a><a href="modelmbean/ModelMBeanOperationInfo.html#descriptor">
<!--
--><code>ModelMBeanOperationInfo</code></a> 以及该章的“模型MBean” <a href="http://www.oracle.com/technetwork/java/javase/tech/javamanagement-140525.html">JMX Specification</a></span> <span>下表总结了这些字段。</span> <span>请注意当该表中的Type为Number时也可以使用Long的十进制表示形式的String。</span> </p>
<p> <span>没有什么可以阻止在不是MBean的MBean中使用这些字段。</span> <span><a href="#displayName">例如</a> <a href="#severity">displayName,
<!--
-->severity</a><a href="#visibility">visibility</a>字段在模型MBean之外是感兴趣的。</span> <span>但是只有模型MBean具有这些字段的预定义行为。</span> </p>
<span> Name Type Used in Meaning class String ModelMBeanOperationInfo Class where method is defined (fully qualified). currencyTimeLimit Number ModelMBeanInfo<br/>ModelMBeanAttributeInfo<br/>ModelMBeanOperationInfo How long cached value is valid: &lt;0 never, =0 always, &gt;0 seconds. default Object ModelMBeanAttributeInfo Default value for attribute. descriptorType String Any Type of descriptor, "mbean", "attribute", "constructor", "operation", or "notification". displayName String Any Human readable name of this item. export String ModelMBeanInfo Name to be used to export/expose this MBean so that it is findable by other JMX Agents. getMethod String ModelMBeanAttributeInfo Name of operation descriptor for get method. lastUpdatedTimeStamp Number ModelMBeanAttributeInfo<br/>ModelMBeanOperationInfo When <a href="#value-field">value</a> was set. log String ModelMBeanInfo<br/>ModelMBeanNotificationInfo t or T: log all notifications, f or F: log no notifications. logFile String ModelMBeanInfo<br/>ModelMBeanNotificationInfo Fully qualified filename to log events to. messageID String ModelMBeanNotificationInfo Unique key for message text (to allow translation, analysis). messageText String ModelMBeanNotificationInfo Text of notification. name String Any Name of this item. persistFile String ModelMBeanInfo File name into which the MBean should be persisted. persistLocation String ModelMBeanInfo The fully qualified directory name where the MBean should be persisted (if appropriate). persistPeriod Number ModelMBeanInfo<br/>ModelMBeanAttributeInfo Frequency of persist cycle in seconds. Used when persistPolicy is "OnTimer" or "NoMoreOftenThan". persistPolicy String ModelMBeanInfo<br/>ModelMBeanAttributeInfo One of: OnUpdate|OnTimer|NoMoreOftenThan|OnUnregister|Always|Never. See the section "MBean Descriptor Fields" in the JMX specification document. presentationString String Any XML formatted string to allow presentation of data. protocolMap Descriptor ModelMBeanAttributeInfo See the section "Protocol Map Support" in the JMX specification document. Mappings must be appropriate for the attribute and entries can be updated or augmented at runtime. role String ModelMBeanConstructorInfo<br/>ModelMBeanOperationInfo One of "constructor", "operation", "getter", or "setter". setMethod String ModelMBeanAttributeInfo Name of operation descriptor for set method. severity Number ModelMBeanNotificationInfo 0-6 where 0: unknown; 1: non-recoverable; 2: critical, failure; 3: major, severe; 4: minor, marginal, error; 5: warning; 6: normal, cleared, informative targetObject Object ModelMBeanOperationInfo Object on which to execute this method. targetType String ModelMBeanOperationInfo type of object reference for targetObject. Can be: ObjectReference | Handle | EJBHandle | IOR | RMIReference. value Object ModelMBeanAttributeInfo<br/>ModelMBeanOperationInfo Current (cached) value for attribute or operation. visibility Number Any 1-4 where 1: always visible, 4: rarely visible. </span>
<table border="1" cellpadding="5" summary="ModelMBean Fields">
</table>
</div>
<dl>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.5
</dd>
</dl> </li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- --> </a> <h3>方法摘要</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Method Summary table, listing methods, and an explanation">
<caption>
<span class="activeTableTab" id="t0"><span>所有方法</span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t2"><span><a href="javascript:show(2);">接口方法</a></span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t3"><span><a href="javascript:show(4);">抽象方法</a></span><span class="tabEnd"> </span></span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor" id="i0">
<td class="colFirst"><code><a href="../../java/lang/Object.html" title="class in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/management/Descriptor.html#clone--">clone</a></span>()</code>
<div class="block">
返回一个等于该描述符的描述符。
</div> </td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/management/Descriptor.html#equals-java.lang.Object-">equals</a></span>(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a> obj)</code>
<div class="block">
将此描述符与给定对象进行比较。
</div> </td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code><a href="../../java/lang/String.html" title="class in java.lang">String</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/management/Descriptor.html#getFieldNames--">getFieldNames</a></span>()</code>
<div class="block">
返回描述符中的所有字段名。
</div> </td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code><a href="../../java/lang/String.html" title="class in java.lang">String</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/management/Descriptor.html#getFields--">getFields</a></span>()</code>
<div class="block">
以字符串数组的形式返回此描述符中包含的所有字段。
</div> </td>
</tr>
<tr class="altColor" id="i4">
<td class="colFirst"><code><a href="../../java/lang/Object.html" title="class in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/management/Descriptor.html#getFieldValue-java.lang.String-">getFieldValue</a></span>(<a href="../../java/lang/String.html" title="class in java.lang">String</a> fieldName)</code>
<div class="block">
返回特定字段名称的值如果该名称没有值则返回null。
</div> </td>
</tr>
<tr class="rowColor" id="i5">
<td class="colFirst"><code><a href="../../java/lang/Object.html" title="class in java.lang">Object</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/management/Descriptor.html#getFieldValues-java.lang.String...-">getFieldValues</a></span>(<a href="../../java/lang/String.html" title="class in java.lang">String</a>... fieldNames)</code>
<div class="block">
将描述符中的所有字段值作为对象数组返回。
</div> </td>
</tr>
<tr class="altColor" id="i6">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/management/Descriptor.html#hashCode--">hashCode</a></span>()</code>
<div class="block">
返回此描述符的哈希码值。
</div> </td>
</tr>
<tr class="rowColor" id="i7">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/management/Descriptor.html#isValid--">isValid</a></span>()</code>
<div class="block">
如果所有字段都具有给定名称的合法值则返回true。
</div> </td>
</tr>
<tr class="altColor" id="i8">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/management/Descriptor.html#removeField-java.lang.String-">removeField</a></span>(<a href="../../java/lang/String.html" title="class in java.lang">String</a> fieldName)</code>
<div class="block">
从描述符中删除一个字段。
</div> </td>
</tr>
<tr class="rowColor" id="i9">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/management/Descriptor.html#setField-java.lang.String-java.lang.Object-">setField</a></span>(<a href="../../java/lang/String.html" title="class in java.lang">String</a> fieldName, <a href="../../java/lang/Object.html" title="class in java.lang">Object</a> fieldValue)</code>
<div class="block">
设置特定字段名称的值。
</div> </td>
</tr>
<tr class="altColor" id="i10">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/management/Descriptor.html#setFields-java.lang.String:A-java.lang.Object:A-">setFields</a></span>(<a href="../../java/lang/String.html" title="class in java.lang">String</a>[] fieldNames, <a href="../../java/lang/Object.html" title="class in java.lang">Object</a>[] fieldValues)</code>
<div class="block">
将字段名称数组中的所有字段设置为字段值数组中具有相同索引的新值。
</div> </td>
</tr>
</tbody>
</table> </li>
</ul> </li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- --> </a> <h3>方法详细信息</h3> <a name="getFieldValue-java.lang.String-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getFieldValue</h4> <pre><a href="../../java/lang/Object.html" title="class in java.lang">Object</a> getFieldValue(<a href="../../java/lang/String.html" title="class in java.lang">String</a> fieldName)
throws <a href="../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</a></pre>
<div class="block">
返回特定字段名称的值如果该名称没有值则返回null。
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>fieldName</code> - 字段名称。
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
相应的值如果该字段不存在则返回null。
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</a></code> - 如果字段名称是非法的。
</dd>
</dl> </li>
</ul> <a name="setField-java.lang.String-java.lang.Object-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>setField</h4> <pre>void setField(<a href="../../java/lang/String.html" title="class in java.lang">String</a> fieldName,
<a href="../../java/lang/Object.html" title="class in java.lang">Object</a> fieldValue)
throws <a href="../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</a></pre>
<div class="block">
<p> <span>设置特定字段名称的值。</span> <span>这将修改现有字段或添加新字段。</span> </p>
<p> <span>字段值在设置之前将被验证。</span> <span>如果它无效,那么将抛出异常。</span> <span>有效性的含义取决于描述符的实现。</span> </p>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<span><code>fieldName</code> - 要设置的字段名称。</span>
<span>不能为null或为空。</span>
</dd>
<dd>
<span><code>fieldValue</code> - 要为字段名称设置的字段值。</span>
<span>如果该值是该字段的有效值则可以为null。</span>
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<span><code><a href="../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</a></code> - 如果字段名称或字段值是非法的(包装异常是<a href="../../java/lang/IllegalArgumentException.html" title="java.lang中的类"><code>IllegalArgumentException</code></a> ;</span>
<span>或者描述符是不可变的(包装异常是<a href="../../java/lang/UnsupportedOperationException.html" title="java.lang中的类"><code>UnsupportedOperationException</code></a> )。</span>
</dd>
</dl> </li>
</ul> <a name="getFields--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getFields</h4> <pre><a href="../../java/lang/String.html" title="class in java.lang">String</a>[] getFields()</pre>
<div class="block">
以字符串数组的形式返回此描述符中包含的所有字段。
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<span>字符串数组的字段格式为<i>fieldName = fieldValue</i></span>
<br/>
<span>如果字段的值不是String那么将调用toString方法并将包含在括号中的返回值用作返回数组中字段的值。</span>
<span>如果一个字段的值为null那么返回的数组中的字段的值将为空。</span>
<span>如果描述符为空,您将获得一个空数组。</span>
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/management/Descriptor.html#setFields-java.lang.String:A-java.lang.Object:A-"><code>setFields(java.lang.String[], java.lang.Object[])</code></a>
</dd>
</dl> </li>
</ul> <a name="getFieldNames--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getFieldNames</h4> <pre><a href="../../java/lang/String.html" title="class in java.lang">String</a>[] getFieldNames()</pre>
<div class="block">
返回描述符中的所有字段名。
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<span>字符串数组字段名称。</span>
<span>如果描述符为空,您将获得一个空数组。</span>
</dd>
</dl> </li>
</ul> <a name="getFieldValues-java.lang.String...-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getFieldValues</h4> <pre><a href="../../java/lang/Object.html" title="class in java.lang">Object</a>[] getFieldValues(<a href="../../java/lang/String.html" title="class in java.lang">String</a>... fieldNames)</pre>
<div class="block">
<span>将描述符中的所有字段值作为对象数组返回。</span>
<span>返回的值与<code>fieldNames</code> String数组参数的顺序相同。</span>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<span><code>fieldNames</code> - 应返回值的字段名称的字符串数组。</span>
<span>如果数组为空,那么将返回一个空数组。</span>
<span>如果数组为空,那么将返回所有值,就像该参数是由<a href="../../javax/management/Descriptor.html#getFieldNames--"><code>getFieldNames()</code></a>返回的数组<a href="../../javax/management/Descriptor.html#getFieldNames--">一样</a></span>
<span>如果数组中的字段名称不存在包括其为空或空字符串的情况那么返回的匹配数组元素将返回null。</span>
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<span>字段值的对象数组。</span>
<span>如果<code>fieldNames</code>的列表为空,您将获得一个空数组。</span>
</dd>
</dl> </li>
</ul> <a name="removeField-java.lang.String-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>removeField</h4> <pre>void removeField(<a href="../../java/lang/String.html" title="class in java.lang">String</a> fieldName)</pre>
<div class="block">
从描述符中删除一个字段。
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<span><code>fieldName</code> - 要删除的字段的字符串名称。</span>
<span>如果字段名称是非法的或没有找到该字段,则不会抛出异常。</span>
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<span><code><a href="../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</a></code> - 如果给定名称的字段存在且描述符是不可变的。</span>
<span>包装的例外将是<a href="../../java/lang/UnsupportedOperationException.html" title="java.lang中的类"><code>UnsupportedOperationException</code></a></span>
</dd>
</dl> </li>
</ul> <a name="setFields-java.lang.String:A-java.lang.Object:A-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>setFields</h4> <pre>void setFields(<a href="../../java/lang/String.html" title="class in java.lang">String</a>[] fieldNames,
<a href="../../java/lang/Object.html" title="class in java.lang">Object</a>[] fieldValues)
throws <a href="../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</a></pre>
<div class="block">
<p> <span>将字段名称数组中的所有字段设置为字段值数组中具有相同索引的新值。</span> <span>阵列大小必须匹配。</span> </p>
<p> <span>字段值在设置之前将被验证。</span> <span>如果它无效,那么将抛出异常。</span> <span>如果数组为空,那么没有更改将生效。</span> </p>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<span><code>fieldNames</code> - 字段名称的字符串数组。</span>
<span>数组和数组元素不能为空。</span>
</dd>
<dd>
<span><code>fieldValues</code> - 相应字段值的对象数组。</span>
<span>数组不能为null。</span>
<span>数组的元素可以为空。</span>
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<span><code><a href="../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</a></code> - 如果由于任何原因更改失败。</span>
<span>如果<code>fieldNames</code><code>fieldValues</code>为空,或者如果数组的长度不同,或者其中之一中有非法值,则包装的异常为<a href="../../java/lang/IllegalArgumentException.html" title="java.lang中的类"><code>IllegalArgumentException</code></a></span>
<span>包装的异常是<a href="../../java/lang/UnsupportedOperationException.html" title="java.lang中的类"><code>UnsupportedOperationException</code></a>如果描述符是不可变的,而调用将更改其内容。</span>
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/management/Descriptor.html#getFields--"><code>getFields()</code></a>
</dd>
</dl> </li>
</ul> <a name="clone--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>clone</h4> <pre><a href="../../java/lang/Object.html" title="class in java.lang">Object</a> clone()
throws <a href="../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</a></pre>
<div class="block">
<p> <span>返回一个等于该描述符的描述符。</span> <span>返回的描述符的更改对此描述符没有影响,反之亦然。</span> <span>如果这个描述符是不可变的,它可以通过返回自己来实现这个条件。</span> </p>
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
与该描述符相等的描述符。
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<span><code><a href="../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</a></code> - 用于字段名称或字段值的非法值。</span>
<span>如果由于任何原因描述符构造失败,将抛出此异常。</span>
</dd>
</dl> </li>
</ul> <a name="isValid--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>isValid</h4> <pre>boolean isValid()
throws <a href="../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</a></pre>
<div class="block">
如果所有字段都具有给定名称的合法值则返回true。
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
如果值合法,则为真。
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<span><code><a href="../../javax/management/RuntimeOperationsException.html" title="class in javax.management">RuntimeOperationsException</a></code> - 如果由于任何原因有效性检查失败,将抛出此异常。</span>
<span>如果描述符无效该方法返回false但如果尝试确定有效性失败则返回此异常。</span>
</dd>
</dl> </li>
</ul> <a name="equals-java.lang.Object-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>equals</h4> <pre>boolean equals(<a href="../../java/lang/Object.html" title="class in java.lang">Object</a> obj)</pre>
<div class="block">
<p> <span>将此描述符与给定对象进行比较。</span> <span>如果给定的对象也是描述符,并且两个描述符具有相同的字段名称(可能在不同情况下)和相同的关联值,则对象是相等的。</span> <span>如果满足以下条件,两个描述符中的字段的相应值相等:</span> </p>
<ul>
<li> <span>如果一个值为null那么另一个值也是。</span> </li>
<li> <span>如果一个值是原始数组,则另一个值必须是具有相同元素的相同类型的原始数组。</span> </li>
<li> <span>如果一个值是对象数组,则另一个值必须也是,并且<a href="../../java/util/Arrays.html#deepEquals-java.lang.Object:A-java.lang.Object:A-"><code>Arrays.deepEquals(Object[],Object[])</code></a>必须返回true。</span> </li>
<li> <span>否则<a href="../../java/lang/Object.html#equals-java.lang.Object-"><code>Object.equals(Object)</code></a>必须返回true。</span> </li>
</ul>
</div>
<dl>
<dt>
<span class="overrideSpecifyLabel">重写:</span>
</dt>
<dd>
<code><a href="../../java/lang/Object.html#equals-java.lang.Object-">equals</a></code>在类别
<code><a href="../../java/lang/Object.html" title="class in java.lang">Object</a></code>
</dd>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>obj</code> - 要比较的对象。
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<span><code>true</code>如果对象相同;</span>
<span><code>false</code>否则。</span>
</dd>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.6
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<span><a href="../../java/lang/Object.html#hashCode--"><code>Object.hashCode()</code></a> <a href="../../java/util/HashMap.html" title="java.util中的类"><code>HashMap</code></a></span>
</dd>
</dl> </li>
</ul> <a name="hashCode--">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>hashCode</h4> <pre>int hashCode()</pre>
<div class="block">
<p> <span>返回此描述符的哈希码值。</span> <span>哈希码被计算为描述符中每个字段的哈希码的和。</span> <span>名称为<code>n</code> ,值为<code>v</code>的字段的哈希码为<code>n.toLowerCase().hashCode() ^ h</code></span> <span>这里<code>h</code>是哈希码<code>v</code> ,计算如下:</span> </p>
<ul>
<li> <span>如果<code>v</code>为null<code>h</code>为0。</span> </li>
<li> <span>如果<code>v</code>是原始数组那么使用java.util.Arrays.hashCode的适当<code>h</code>来计算<code>java.util.Arrays.hashCode</code></span> </li>
<li> <span>如果<code>v</code>是一个对象数组然后<code>h</code>使用计算<a href="../../java/util/Arrays.html#deepHashCode-java.lang.Object:A-"><code>Arrays.deepHashCode(Object[])</code></a></span> </li>
<li> <span>否则<code>h</code><code>v.hashCode()</code></span> </li>
</ul>
</div>
<dl>
<dt>
<span class="overrideSpecifyLabel">重写:</span>
</dt>
<dd>
<code><a href="../../java/lang/Object.html#hashCode--">hashCode</a></code>在类别
<code><a href="../../java/lang/Object.html" title="class in java.lang">Object</a></code>
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
此对象的哈希码值。
</dd>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.6
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../java/lang/Object.html#equals-java.lang.Object-"><code>Object.equals(java.lang.Object)</code></a>
<a href="../../java/lang/System.html#identityHashCode-java.lang.Object-"><code>System.identityHashCode(java.lang.Object)</code></a>
</dd>
</dl> </li>
</ul> </li>
</ul> </li>
</ul>
</div>
</div>