Name

Attributes

Synopsis

This interface represents a collection of attributes associated with a directory entry. Individual attributes are unordered, and the Attributes object can have zero or more attributes. The getAll() method returns an enumeration of Attribute objects, while getIDs() returns an enumeration of just the attribute names (or IDs) for the directory entry. If you know the attribute you want, you can specify the attribute name in a call to the get() method, which returns a single Attribute object.

An Attributes object can be case-sensitive or insensitive. In an LDAP or NDS directory, a case-insensitive attribute corresponds to “case ignore string.” This means when searching for a particular attribute or comparing two attributes, case sensitivity can affect the results.

Updates performed on an Attributes object do not affect the directory entry. To modify the directory entry, you must call the modifyAttributes() method of DirContext using the updated Attributes object.

When creating a set of attributes for use in an application, you typically use a BasicAttributes object.

                  
public interface Attributes extends Cloneable, Serializable {
// Public Instance Methods
   public abstract Object clone();  
   public abstract javax.naming.directory.Attribute get(
        String attrID);  
   public abstract NamingEnumeration getAll();  
   public abstract NamingEnumeration getIDs(); public abstract boolean ...

Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.