|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface defines behavioral and runtime metadata for ModelMBeans. A descriptor is a set of name-value pairs.
The DescriptorAccess
interface defines how to get and set
Descriptors for a ModelMBean's metadata classes.
The implementation must implement the following constructors.
Descriptor() returns an empty descriptor.
Descriptor(Descriptor) returns a copy of the decriptor.
Descriptor(String[], Object[]) a constructor that verifies the field names include a descriptorType and that predefined fields contain valid values.
DescriptorAccess
,
ModelMBean
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 fieldName)
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 fieldName,
Object fieldValue)
Sets the value of a field. |
void |
setFields(String[] fieldNames,
Object[] fieldValues)
Set multiple fields in this descriptor. |
Method Detail |
public Object getFieldValue(String fieldName) throws RuntimeOperationsException
fieldName
- the name of the field.
RuntimeOperationsException
- when the field name is not
valid.public void setField(String fieldName, Object fieldValue) throws RuntimeOperationsException
fieldName
- the name of the field.fieldValue
- the value of the field.
RuntimeOperationsException
- when the field name or value
is not valid.public String[] getFields()
public String[] getFieldNames()
public Object[] getFieldValues(String[] fieldNames)
When a fieldName does not exist, the corresponding element of the returned array is null.
fieldNames
- the array of field names to retrieve. Pass null
to retrieve all fields.
public void removeField(String fieldName)
fieldName
- the field to remove. No exception is thrown
when the field is not in the descriptor.public void setFields(String[] fieldNames, Object[] fieldValues) throws RuntimeOperationsException
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.
RuntimeOperationsException
- for not existent or fieldNames,
invalid or null fieldValues, the two arrays are different sizes or
the contructor fails for any reason.public Object clone() throws RuntimeOperationsException
RuntimeOperationsException
- for invalid fieldNames,
fieldValues or the contructor fails for any reason.public boolean isValid() throws RuntimeOperationsException
RuntimeOperationsException
- for any error performing
the validation.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |