|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.directory.MultiValueAttributes
public class MultiValueAttributes
Holds many attribute names with associated multiple values under. Access to attributes by their name is case-insensitive.
| Constructor Summary | |
|---|---|
MultiValueAttributes()
Initialize the new instance with default values. |
|
| Method Summary | |
|---|---|
void |
addAttribute(MultiValueAttribute attribute)
Adds the given attribute. |
void |
addValue(java.lang.String attrName,
java.lang.Object value)
Adds the given value to the attribute with the given name. |
void |
addValue(java.lang.String attrName,
java.lang.Object value,
boolean encoded)
Adds the given value to the attribute with the given name. |
MultiValueAttribute |
getAttribute(java.lang.String attrName)
Returns the attribute with the specified name or null if not found |
java.lang.String |
getAttributeAsString(java.lang.String attrName)
Returns the first value of the specified attribute as String. |
java.lang.String[] |
getAttributeAsStringArray(java.lang.String attrName)
Returns the values of the specified attribute as String array. |
java.lang.String[] |
getAttributeNames()
Returns the names of all attributes. |
java.lang.Object |
getAttributeValue(java.lang.String attrName)
Returns the current value of the attribute with the given name. |
MultiValueAttributes |
getCopyOfAttributes(java.lang.String[] attrNames)
Returns a copy of all those attributes that are specified by the given name array and that exist in this object. |
AttributesMetaData |
getMetaData()
|
java.lang.Object |
getValue(java.lang.String attrName)
Returns the first value of the attribute with the given name. |
java.util.List |
getValues(java.lang.String attrName)
Returns the values of the attribute with the given name. |
boolean |
hasAttribute(java.lang.String attrName)
Returns if this object contains an attribute with the specified name. |
boolean |
isEmpty()
Returns true if this object currently contains no attribute at all |
void |
removeAttribute(java.lang.String attrName)
Removes the attribute with the given name and of course also all its associated values. |
void |
removeValue(java.lang.String attrName,
java.lang.Object value)
Removes the given value from the specified attribute. |
void |
setMetaData(AttributesMetaData newValue)
|
int |
size()
Returns the current number of attributes in this object. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MultiValueAttributes()
| Method Detail |
|---|
public AttributesMetaData getMetaData()
public void setMetaData(AttributesMetaData newValue)
public java.lang.Object getValue(java.lang.String attrName)
attrName - The name of the attribute of which the first associated value should be returnedpublic java.util.List getValues(java.lang.String attrName)
attrName - The name of the attribute of which the associated values should be returned
public void addValue(java.lang.String attrName,
java.lang.Object value)
attrName - The name of the attributevalue - The value to be added to the attribute's values
public void addValue(java.lang.String attrName,
java.lang.Object value,
boolean encoded)
attrName - The name of the attributevalue - The value to be added to the attribute's valuesencoded - An indicator that defines whether the values of this attribute have to be encodedpublic void addAttribute(MultiValueAttribute attribute)
attribute - The attribute to addpublic void removeAttribute(java.lang.String attrName)
attrName - The name of the attribute to remove
public void removeValue(java.lang.String attrName,
java.lang.Object value)
attrName - The name of the attributevalue - The value to remove from the attributepublic java.lang.String[] getAttributeNames()
getAttributeNames in interface AttributeReadAccess
public java.lang.Object getAttributeValue(java.lang.String attrName)
throws java.lang.NoSuchFieldException
getAttributeValue in interface AttributeReadAccessattrName - The attribute's name ( case sensitive )
java.lang.NoSuchFieldException - If there is no attribute with the given namepublic MultiValueAttribute getAttribute(java.lang.String attrName)
attrName - The name of the attributepublic boolean hasAttribute(java.lang.String attrName)
public int size()
public boolean isEmpty()
public MultiValueAttributes getCopyOfAttributes(java.lang.String[] attrNames)
attrNames - The names of all attributes to copy (null means to copy all attributes)
public java.lang.String getAttributeAsString(java.lang.String attrName)
throws java.lang.NoSuchFieldException
attrName - The name of the attribute
java.lang.NoSuchFieldException - If no attribute with the specified name can be found
public java.lang.String[] getAttributeAsStringArray(java.lang.String attrName)
throws java.lang.NoSuchFieldException
attrName - The name of the attribute
java.lang.NoSuchFieldException - If no attribute with the specified name can be found
java.lang.ClassCastException - If any value of the attribute is not of type String
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||