|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Base interface from which all Value objects must be derived. Represents both an attribute dirty marker and a generic attribute accessor. Classes implementing a value interface provide several ways to access the attributes:
public Object getAttributeValue(String attributeName)
public void setAttributeValue(String attributeName, Object newValue)
public String[] getAttributeNames()
.
An attribute may or may not be populated with a value.
An attribute is populated by calling public void setAttributeValue(...)
.
A client can determine if an attribute is populated by calling
public boolean isPopulated(String attributeName)
.
Method Summary | |
java.util.Map |
getAllPopulatedAttributes()
Get all populated attribute values. |
java.lang.String[] |
getAttributeNames()
Return all attribute names, which are available in this value object. |
java.lang.Object |
getAttributeValue(java.lang.String attributeName)
Return the value of the specified attribute. |
java.util.Map |
getAttributeValues(java.lang.String[] attributeNames)
Get multiple attribute values given an array of attribute names. |
java.lang.String[] |
getPopulatedAttributeNames()
Get the names of all populated attributes. |
java.lang.String[] |
getSupportedOptionalAttributeNames()
Provide run-time support for the discovery of optional attributes. |
boolean |
isFullyPopulated()
Return true, if all attributes in this value object are populated. |
boolean |
isPopulated(java.lang.String attributeName)
Check if a specific attribute is populated. |
void |
setAttributeValue(java.lang.String attributeName,
java.lang.Object value)
Assign a new value to an attribute. |
void |
setAttributeValues(java.util.Map attributeNamesAndValuePairs)
Set multiple attribute values. |
void |
unpopulateAllAttributes()
Reset all the attributes to unpopulated. |
void |
unpopulateAttribute(java.lang.String attributeName)
Mark a single attribute as unpopulated. |
Method Detail |
public java.util.Map getAttributeValues(java.lang.String[] attributeNames) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, UnsupportedAttributeException
attributeNames
-
java.lang.IllegalArgumentException
- (if null array is provided or if one of the attributes is not recognized)
java.lang.IllegalStateException
- (if one of the attributes is not populated)
UnsupportedAttributeException
- (if one of the attributes is not supported)public void setAttributeValues(java.util.Map attributeNamesAndValuePairs) throws java.lang.IllegalArgumentException, UnsupportedAttributeException
attributeNamesAndValuePairs
-
java.lang.IllegalArgumentException
- (one of the attributes is not well formed or unrecognized)
UnsupportedAttributeException
- (one of the attributes is optional and is not supported)public java.util.Map getAllPopulatedAttributes()
public java.lang.Object getAttributeValue(java.lang.String attributeName) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, UnsupportedAttributeException
attributeName
- the attribute's name
java.lang.IllegalArgumentException
- (the attribute name is null or is not recognized)
java.lang.IllegalStateException
- (the attribute is not populated)
UnsupportedAttributeException
- (the attribute is optional and not supported)public void setAttributeValue(java.lang.String attributeName, java.lang.Object value) throws java.lang.IllegalArgumentException, UnsupportedAttributeException
Even though some attributes
may be read-only in the server implementation, they can be set here nonetheless.
This is because value objects are also used as templates for a "query by template".
To see which attributes can be set in the server implementation, the client needs to call
getSettableAttributeNames()
.
attributeName
- The attribute's name which shall be changedvalue
- The attribute's new value. This can either be:
attributeName
Integer
wrapping an int
java.lang.IllegalArgumentException
- (the attribute name is null or is not recognized, or the value is bad)
UnsupportedAttributeException
- (the attribute is optional and is not supported)public java.lang.String[] getAttributeNames()
The returned names may be used as arguments to the generic methods getAttributeValue(...)
and setAttributeValue(...)
.
This method may be used by generic clients to obtain information on the attributes. It does not say anything about the state of an attribute, i.e. if it is populated or not.
public java.lang.String[] getPopulatedAttributeNames()
Although an attribute is populated, it can be null
!
getAttributeNames()
.public boolean isPopulated(java.lang.String attributeName) throws java.lang.IllegalArgumentException
attributeName
- the name of the attribute which is to be checked for population.
java.lang.IllegalArgumentException
- when there is no attribute with this name.isFullyPopulated()
public boolean isFullyPopulated()
isPopulated(String attribute)
public void unpopulateAllAttributes()
public void unpopulateAttribute(java.lang.String attributeName) throws java.lang.IllegalArgumentException
attributeName
- name of the attribute to be unpopulated.
java.lang.IllegalArgumentException
- if this is not a valid attribute name.unpopulateAllAttributes()
public java.lang.String[] getSupportedOptionalAttributeNames()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |