A descriptor consists of a collection of fields. Each field is in fieldname=fieldvalue format. Field names are not case sensitive, case will be preserved on field values.
All field names and values are not predefined. New fields can be defined and added by any program. Some fields have been predefined for consistency of implementation and support by the ModelMBeanInfo, ModelMBeanAttributeInfo, ModelMBeanConstructorInfo, ModelMBeanNotificationInfo, ModelMBeanOperationInfo and ModelMBean classes.
The serialVersionUID of this class is -6292969195866300415L.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private transient SortedMap | |
| private static final ObjectStreamField[] | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | DescriptorSupport(int
The initial capacity of the Map that
stores the descriptor fields. initNumFields)Descriptor constructor. |
| public | DescriptorSupport(DescriptorSupport
the descriptor to be used to initialize the
constructed descriptor. If it is null or contains no descriptor
fields, an empty Descriptor will be created. inDescr)Descriptor constructor taking a Descriptor as parameter. |
| public | DescriptorSupport(String[]
String array of field names. No elements of
this array can be null. fieldNames, Object[] Object array of the corresponding field
values. Elements of the array can be null. The
fieldValues)fieldValue must be valid for the
fieldName (as defined in method isValid)Note array sizes of parameters should match. If both arrays are empty, then an empty descriptor is created. Constructor taking field names and field values. |
| public | DescriptorSupport(String...
String array with each element containing a
field name and value. If this array is null or empty, then the
default constructor will be executed. Null strings or empty
strings will be ignored.
fields)All field values should be Strings. If the field values are not Strings, the programmer will have to reset or convert these fields correctly. Note Each string should be of the form
fieldName=fieldValue. The field name
ends at the first Constructor taking fields in the fieldName=fieldValue format. |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized Object | clone()
Overrides java. Implements javax. Returns a new Descriptor which is a duplicate of the Descriptor. |
| public synchronized boolean | equals(Object o)
Overrides java. Implements javax. Compares this descriptor to the given object. |
| public synchronized String[] | getFieldNames()
Implements javax. Returns all the field names in the descriptor. |
| public synchronized String[] | getFields()
Implements javax. Returns all of the fields contained in this descriptor as a string array. |
| public synchronized Object | getFieldValue(String fieldName)
Implements javax. Returns the value for a specific field name, or null if no value is present for that name. |
| public synchronized Object[] | getFieldValues(String... fieldNames)
Implements javax. Returns all the field values in the descriptor as an array of Objects. |
| public synchronized int | hashCode()
Overrides java. Implements javax. Returns the hash code value for this descriptor. |
| private void | |
| public synchronized boolean | isValid()
Implements javax. Returns true if all of the fields have legal values given their names. |
| private void | |
| public synchronized void | removeField(String fieldName)
Implements javax. Removes a field from the descriptor. |
| public synchronized void | setField(String fieldName, Object fieldValue)
Implements javax. Sets the value for a specific field name. |
| public synchronized void | setFields(String[] fieldNames, Object[] fieldValues)
Implements javax. Sets all fields in the field names array to the new value with the same index in the field values array. |
| private long | |
| public synchronized String | toString()
Overrides java. Returns a human readable string representing the descriptor. |
| private boolean | |
| private void |
| currClass | back to summary |
|---|---|
| private static final String currClass | |
| descriptorMap | back to summary |
|---|---|
| private transient SortedMap<String, Object> descriptorMap | |
| serialPersistentFields | back to summary |
|---|---|
private static final ObjectStreamField[] serialPersistentFields
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| DescriptorSupport | back to summary |
|---|---|
| public DescriptorSupport() Descriptor default constructor.
Default initial descriptor size is 20. It will grow as needed. | |
| DescriptorSupport | back to summary |
|---|---|
| public DescriptorSupport(int initNumFields) throws MBeanException, RuntimeOperationsException Descriptor constructor. Takes as parameter the initial
capacity of the Map that stores the descriptor fields.
Capacity will grow as needed.
| |
| DescriptorSupport | back to summary |
|---|---|
| public DescriptorSupport(DescriptorSupport inDescr) Descriptor constructor taking a Descriptor as parameter. Creates a new descriptor initialized to the values of the descriptor passed in parameter.
| |
| DescriptorSupport | back to summary |
|---|---|
| public DescriptorSupport(String[] fieldNames, Object[] fieldValues) throws RuntimeOperationsException Constructor taking field names and field values. Neither array can be null.
| |
| DescriptorSupport | back to summary |
|---|---|
| public DescriptorSupport(String... fields) Constructor taking fields in the fieldName=fieldValue format.
| |
| clone | back to summary |
|---|---|
| public synchronized Object clone() throws RuntimeOperationsException Overrides java. Implements javax. Returns a new Descriptor which is a duplicate of the Descriptor.
| |
| equals | back to summary |
|---|---|
| public synchronized boolean equals(Object o) Overrides java. Implements javax. Doc from javax. Compares this descriptor to the given object. The objects are equal if the given object is also a Descriptor, and if the two Descriptors have the same field names (possibly differing in case) and the same associated values. The respective values for a field in the two Descriptors are equal if the following conditions hold:
| |
| getFieldNames | back to summary |
|---|---|
| public synchronized String[] getFieldNames() Implements javax. Doc from javax. Returns all the field names in the descriptor. | |
| getFields | back to summary |
|---|---|
| public synchronized String[] getFields() Implements javax. Doc from javax. Returns all of the fields contained in this descriptor as a string array. | |
| getFieldValue | back to summary |
|---|---|
| public synchronized Object getFieldValue(String fieldName) throws RuntimeOperationsException Implements javax. Doc from javax. Returns the value for a specific field name, or null if no value is present for that name.
| |
| getFieldValues | back to summary |
|---|---|
| public synchronized Object[] getFieldValues(String... fieldNames) Implements javax. Doc from javax. Returns all the field values in the descriptor as an array of Objects. The
returned values are in the same order as the | |
| hashCode | back to summary |
|---|---|
| public synchronized int hashCode() Overrides java. Implements javax. Doc from javax. Returns the hash code value for this descriptor. The hash
code is computed as the sum of the hash codes for each field in
the descriptor. The hash code of a field with name
| |
| init | back to summary |
|---|---|
| private void init(Map<String, ?> initMap) | |
| isValid | back to summary |
|---|---|
| public synchronized boolean isValid() throws RuntimeOperationsException Implements javax. Returns true if all of the fields have legal values given their names. This implementation does not support interoperating with a directory or lookup service. Thus, conforming to the specification, no checking is done on the "export" field. Otherwise this implementation returns false if:
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException Deserializes a | |
| removeField | back to summary |
|---|---|
| public synchronized void removeField(String fieldName) Implements javax. Doc from javax. Removes a field from the descriptor. | |
| setField | back to summary |
|---|---|
| public synchronized void setField(String fieldName, Object fieldValue) throws RuntimeOperationsException Implements javax. Doc from javax. Sets the value for a specific field name. This will modify an existing field or add a new field. The field value will be validated before it is set. If it is not valid, then an exception will be thrown. The meaning of validity is dependent on the descriptor implementation.
| |
| setFields | back to summary |
|---|---|
| public synchronized void setFields(String[] fieldNames, Object[] fieldValues) throws RuntimeOperationsException Implements javax. Doc from javax. Sets all fields in the field names array to the new value with the same index in the field values array. Array sizes must match. The field value will be validated before it is set. If it is not valid, then an exception will be thrown. If the arrays are empty, then no change will take effect.
| |
| toNumeric | back to summary |
|---|---|
| private long toNumeric(String inStr) | |
| toString | back to summary |
|---|---|
| public synchronized String toString() Overrides java. Returns a human readable string representing the
descriptor. The string will be in the format of
"fieldName=fieldValue,fieldName2=fieldValue2,..."
| |
| validateField | back to summary |
|---|---|
| private boolean validateField(String fldName, Object fldValue) | |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream out) throws IOException Serializes a | |