|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.management.modelmbean.DescriptorSupport
Support class for creating descriptors.
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)
Descriptor constructor taking an XML String. |
|
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()
Returns string array of fields names. |
String[] |
getFields()
Returns String array of fields in the format fieldName=fieldValue. |
Object |
getFieldValue(String inFieldName)
Retrieves the value of a field. |
Object[] |
getFieldValues(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(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)
Sets all Fields in the list to the new value in with the same index in the fieldValue array. |
String |
toString()
|
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
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()
getFields
in interface Descriptor
public String[] getFieldNames()
getFieldNames
in interface Descriptor
public Object[] getFieldValues(String[] fieldNames)
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)
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
isValid
in interface Descriptor
RuntimeOperationsException
- If the validity checking fails for any reason, this exception will be thrown.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 |