|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.management.modelmbean.DescriptorSupport
Support class for creating descriptors.
Descriptor
(src) ,
Serialized FormConstructor Summary | |
DescriptorSupport()
Default constructor. |
|
DescriptorSupport(DescriptorSupport (src) descriptor)
Copy constructor. |
|
DescriptorSupport(int initialSize)
Creates descriptor instance with a given initial size. |
|
DescriptorSupport(java.lang.String xmlString)
Descriptor constructor taking an XML String. |
|
DescriptorSupport(java.lang.String[] fields)
|
|
DescriptorSupport(java.lang.String[] fieldNames,
java.lang.Object[] fieldValues)
Creates descriptor instance with given field names and values.if both field names and field values array contain empty arrays, an empty descriptor is created. |
Method Summary | |
java.lang.Object |
clone()
Returns a descriptor that is a duplicate of this one. |
java.lang.String[] |
getFieldNames()
Returns string array of fields names. |
java.lang.String[] |
getFields()
Returns String array of fields in the format fieldName=fieldValue. |
java.lang.Object |
getFieldValue(java.lang.String inFieldName)
Retrieves the value of a field. |
java.lang.Object[] |
getFieldValues(java.lang.String[] fieldNames)
Returns all the field values in the descriptor as an array of Objects. |
boolean |
isValid()
Returns true if all of the fields have legal values given their names. |
void |
removeField(java.lang.String fieldName)
Remove a field from the descriptor. |
void |
setField(java.lang.String inFieldName,
java.lang.Object fieldValue)
Sets the value of a field. |
void |
setFields(java.lang.String[] fieldNames,
java.lang.Object[] fieldValues)
Sets all Fields in the list to the new value in with the same index in the fieldValue array. |
java.lang.String |
toString()
|
java.lang.String |
toXMLString()
Returns an XML String representing the descriptor. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DescriptorSupport()
public DescriptorSupport(int initialSize) throws MBeanException (src)
initialSize
- initial size of the descriptor
MBeanException (src)
- this exception is never thrown but is declared here
for Sun RI API compatibility
RuntimeOperationsException (src)
- if the initialSize is zero or negative. The target
exception wrapped by this exception is an instace of IllegalArgumentException class.public DescriptorSupport(DescriptorSupport (src) descriptor)
descriptor
- the descriptor to be copied
RuntimeOperationsException (src)
- if descriptor is null. The target exception wrapped by this
exception is an instance of IllegalArgumentException class.public DescriptorSupport(java.lang.String[] fieldNames, java.lang.Object[] fieldValues) throws RuntimeOperationsException (src)
fieldNames
- Contains names for the descriptor fields. This array cannot contain
null references. If both fieldNames and fieldValues
arguments contain null or empty array references then an empty descriptor
is created. The size of the fieldNames array must match the size of
the fieldValues array.fieldValues
- Contains values for the descriptor fields. Null references are allowed.
RuntimeOperationsException (src)
- if array sizes don't matchpublic DescriptorSupport(java.lang.String[] fields)
public DescriptorSupport(java.lang.String xmlString) throws MBeanException (src) , RuntimeOperationsException (src) , XMLParseException (src)
Method Detail |
public java.lang.Object getFieldValue(java.lang.String inFieldName)
Descriptor (src)
getFieldValue
in interface Descriptor (src)
inFieldName
- the name of the field.
public void setField(java.lang.String inFieldName, java.lang.Object fieldValue)
Descriptor (src)
setField
in interface Descriptor (src)
inFieldName
- the name of the field.fieldValue
- the value of the field.public java.lang.String[] getFields()
getFields
in interface Descriptor (src)
public java.lang.String[] getFieldNames()
getFieldNames
in interface Descriptor (src)
public java.lang.Object[] getFieldValues(java.lang.String[] fieldNames)
getFieldValues
in interface Descriptor (src)
fieldNames
- the array of field names to retrieve. Pass null
to retrieve all fields.
public void setFields(java.lang.String[] fieldNames, java.lang.Object[] fieldValues)
setFields
in interface Descriptor (src)
fieldNames
- an array of fieldNames to set. Neither the array
or array elements can be null. The fieldName must exist.fieldValues
- an array of fieldValues to set. Neither the array
or array elements can be null. The fieldValue must be valid for
the corresponding fieldName.public java.lang.Object clone()
Descriptor (src)
clone
in interface Descriptor (src)
public void removeField(java.lang.String fieldName)
Descriptor (src)
removeField
in interface Descriptor (src)
fieldName
- the field to remove. No exception is thrown
when the field is not in the descriptor.public boolean isValid() throws RuntimeOperationsException (src)
isValid
in interface Descriptor (src)
RuntimeOperationsException (src)
- If the validity checking fails for any reason, this exception will be thrown.public java.lang.String toXMLString() throws RuntimeOperationsException (src)
RuntimeOperationsException (src)
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |