|
JNDI 1.1.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.naming.directory.BasicAttributes
This class provides a basic implementation of the Attributes interface.
BasicAttributes is either case-sensitive or case-insensitive (case-ignore). This property is determined at the time the BasicAttributes constructor is called. In a case-insensitive BasicAttributes, the case of its attribute identifiers is ignored when searching for an attribute, or adding attributes. In a case-sensitive BasicAttributes, the case is significant.
When the BasicAttributes class needs to create an Attribute, it uses BasicAttribute. There is no other dependency on BasicAttribute.
Note that updates to BasicAttributes (such as adding or removing an attribute) does not affect the corresponding representation in the directory. Updates to the directory can only be effected using operations in the DirContext interface.
A BasicAttributes instance is not synchronized against concurrent multithreaded access. Multiple threads trying to access and modify a single BasicAttributes instance should lock the object.
DirContext.getAttributes(javax.naming.Name)
,
DirContext.modifyAttributes(javax.naming.Name, int, javax.naming.directory.Attributes)
,
DirContext.bind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes)
,
DirContext.rebind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes)
,
DirContext.createSubcontext(javax.naming.Name, javax.naming.directory.Attributes)
,
DirContext.search(javax.naming.Name, javax.naming.directory.Attributes, java.lang.String[])
, Serialized FormConstructor Summary | |
BasicAttributes()
Constructs a new instance of Attributes. |
|
BasicAttributes(boolean ignoreCase)
Constructs a new instance of Attributes. |
|
BasicAttributes(java.lang.String attrID,
java.lang.Object val)
Constructs a new instance of Attributes with one attribute. |
|
BasicAttributes(java.lang.String attrID,
java.lang.Object val,
boolean ignoreCase)
Constructs a new instance of Attributes with one attribute. |
Method Summary | |
java.lang.Object |
clone()
Makes a copy of this attribute set. |
Attribute |
get(java.lang.String attrID)
Retrieves the attribute with the given attribute id from this set. |
NamingEnumeration |
getAll()
Retrieves an enumeration of the attributes in this attribute set. |
NamingEnumeration |
getIDs()
Retrieves an enumeration of the ids of the attributes in this attribute set. |
boolean |
isCaseIgnored()
Determines whether this attribute set ignores the case of attribute identifiers when retrieving or adding attributes. |
Attribute |
put(Attribute attr)
Adds a new attribute to this attribute set. |
Attribute |
put(java.lang.String attrID,
java.lang.Object val)
Adds a new attribute to this attribute set. |
Attribute |
remove(java.lang.String attrID)
Removes the attribute with the attribute id 'attrID' from this attribute set. |
int |
size()
Retrieves the number of attributes in this attribute set. |
java.lang.String |
toString()
Generates the string representation of this attribute set. |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public BasicAttributes()
public BasicAttributes(boolean ignoreCase)
ignoreCase
is true, the character case of attribute
identifiers is ignored; otherwise the case is significant.ignoreCase
- true means this attribute set will ignore
the case of its attribute identifiers
when retrieving or adding attributes;
false means case is respected.public BasicAttributes(java.lang.String attrID, java.lang.Object val)
attrID
- non-null The id of the attribute to add.
If this attribute set ignores the character
case of its attribute ids, the case of attrID
is ignored.val
- The value of the attribute to add. If null, a null
value is added to the attribute.public BasicAttributes(java.lang.String attrID, java.lang.Object val, boolean ignoreCase)
ignoreCase
is true, the character case of attribute
identifiers is ignored; otherwise the case is significant.attrID
- non-null The id of the attribute to add.
If this attribute set ignores the character
case of its attribute ids, the case of attrID
is ignored.val
- The value of the attribute to add. If null, a null
value is added to the attribute.ignoreCase
- true means this attribute set will ignore
the case of its attribute identifiers
when retrieving or adding attributes;
false means case is respected.Method Detail |
public java.lang.Object clone()
public boolean isCaseIgnored()
public int size()
public Attribute get(java.lang.String attrID)
attrID
- The non-null id of the attribute to retrieve.
If this attribute set ignores the character
case of its attribute ids, the case of attrID
is ignored.put(java.lang.String, java.lang.Object)
,
remove(java.lang.String)
public NamingEnumeration getAll()
public NamingEnumeration getIDs()
public Attribute put(java.lang.String attrID, java.lang.Object val)
attrID
- non-null The id of the attribute to add.
If this attribute set ignores the character
case of its attribute ids, the case of attrID
is ignored.val
- The possibly null value of the attribute to add.
If null, the attribute does not have any values.remove(java.lang.String)
public Attribute put(Attribute attr)
attr
- The non-null attribute to add.
If this attribute set ignores the character
case of its attribute ids, the case of
attr's identifier is ignored.remove(java.lang.String)
public Attribute remove(java.lang.String attrID)
attrID
- The non-null id of the attribute to remove.
If this attribute set ignores the character
case of its attribute ids, the case of
attrID is ignored.public java.lang.String toString()
|
JNDI 1.1.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |