|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.management.modelmbean.DescriptorSupport
Support class for creating descriptors.
Revisions:
20020320 Juha Lindfors:
20020525 Juha Lindfors:
20020715 Adrian Brock:
Descriptor
,
Serialized FormConstructor Summary | |
DescriptorSupport()
Default constructor. |
|
DescriptorSupport(DescriptorSupport descriptor)
Copy constructor. |
|
DescriptorSupport(int initialSize)
Creates descriptor instance with a given initial size. |
|
DescriptorSupport(String xmlString)
|
|
DescriptorSupport(String[] fields)
|
|
DescriptorSupport(String[] fieldNames,
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 | |
Object |
clone()
Returns a descriptor that is a duplicate of this one. |
String[] |
getFieldNames()
Retrieves all the field names in this descriptor. |
String[] |
getFields()
Retrieves all the fields in this descriptor. |
Object |
getFieldValue(String inFieldName)
Retrieves the value of a field. |
Object[] |
getFieldValues(String[] fieldNames)
Retrieves all the field values for the passed field names. |
boolean |
isValid()
Checks to see that this descriptor is valid. |
void |
removeField(String fieldName)
Remove a field from the descriptor. |
void |
setField(String inFieldName,
Object fieldValue)
Sets the value of a field. |
void |
setFields(String[] fieldNames,
Object[] fieldValues)
Set multiple fields in this descriptor. |
String |
toString()
|
String |
toXMLString()
|
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
initialSize
- initial size of the descriptor
MBeanException
- this exception is never thrown but is declared here
for Sun RI API compatibility
RuntimeOperationsException
- if the initialSize is zero or negative. The target
exception wrapped by this exception is an instace of IllegalArgumentException class.public DescriptorSupport(DescriptorSupport descriptor)
descriptor
- the descriptor to be copied
RuntimeOperationsException
- if descriptor is null. The target exception wrapped by this
exception is an instance of IllegalArgumentException class.public DescriptorSupport(String[] fieldNames, Object[] fieldValues) throws RuntimeOperationsException
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
- if array sizes don't matchpublic DescriptorSupport(String[] fields)
public DescriptorSupport(String xmlString) throws MBeanException, RuntimeOperationsException, XMLParseException
Method Detail |
public Object getFieldValue(String inFieldName)
Descriptor
getFieldValue
in interface Descriptor
inFieldName
- the name of the field.
public void setField(String inFieldName, Object fieldValue)
Descriptor
setField
in interface Descriptor
inFieldName
- the name of the field.fieldValue
- the value of the field.public String[] getFields()
Descriptor
getFields
in interface Descriptor
public String[] getFieldNames()
Descriptor
getFieldNames
in interface Descriptor
public Object[] getFieldValues(String[] fieldNames)
Descriptor
When a fieldName does not exist, the corresponding element of the returned array is null.
getFieldValues
in interface Descriptor
fieldNames
- the array of field names to retrieve. Pass null
to retrieve all fields.
public void setFields(String[] fieldNames, Object[] fieldValues)
Descriptor
setFields
in interface Descriptor
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 Object clone()
Descriptor
clone
in interface Descriptor
public void removeField(String fieldName)
Descriptor
removeField
in interface Descriptor
fieldName
- the field to remove. No exception is thrown
when the field is not in the descriptor.public boolean isValid() throws RuntimeOperationsException
Descriptor
isValid
in interface Descriptor
RuntimeOperationsException
- for any error performing
the validation.public String toXMLString() throws RuntimeOperationsException
RuntimeOperationsException
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |