Interface: javax.naming.directory.Attributes

This interface represents a collection of attributes.

In a directory, named objects can have associated with them attributes. The Attributes interface represents a collection of attributes. For example, you can request from the directory the attributes associated with an object. Those attributes are returned in an object that implements the Attributes interface.

Attributes in an object that implements the Attributes interface are unordered. The object can have zero or more attributes. Attributes is either case-sensitive or case-insensitive (case-ignore). This property is determined at the time the Attributes object is created. (see BasicAttributes constructor for example). In a case-insensitive Attributes, the case of its attribute identifiers is ignored when searching for an attribute, or adding attributes. In a case-sensitive Attributes, the case is significant.

Note that updates to Attributes (such as adding or removing an attribute) do not affect the corresponding representation in the directory. Updates to the directory can only be effected using operations in the DirContext interface.

Authors:
@author Rosanna Lee
@author Scott Seligman
See:
@see javax.naming.directory.DirContext.getAttributes(javax.naming.Name)
@see javax.naming.directory.DirContext.modifyAttributes(javax.naming.Name, int, javax.naming.directory.Attributes)
@see javax.naming.directory.DirContext.bind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes)
@see javax.naming.directory.DirContext.rebind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes)
@see javax.naming.directory.DirContext.createSubcontext(javax.naming.Name, javax.naming.directory.Attributes)
@see javax.naming.directory.DirContext.search(javax.naming.Name, javax.naming.directory.Attributes, java.lang.String[])
@see javax.naming.directory.BasicAttributes
Since:
@since 1.3

Inheritance

Implements:

Methods

  • clonetop

    public Object clone()
    Makes a copy of the attribute set. The new set contains the same attributes as the original set: the attributes are not themselves cloned. Changes to the copy will not affect the original and vice versa.
    Return:
    @return A non-null copy of this attribute set.
    Google Code Search
    Stack Overflow
  • gettop

    public Attribute get(String attrID)
    Retrieves the attribute with the given attribute id from the attribute set.
    Parameters:
    @param 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.
    Return:
    @return The attribute identified by attrID; null if not found.
    See:
    @see javax.naming.directory.Attributes.put(java.lang.String, java.lang.Object)
    @see javax.naming.directory.Attributes.remove(java.lang.String)
    Google Code Search
    Stack Overflow
  • getAlltop

    public NamingEnumeration<? extends Attribute> getAll()
    Retrieves an enumeration of the attributes in the attribute set. The effects of updates to this attribute set on this enumeration are undefined.
    Return:
    @return A non-null enumeration of the attributes in this attribute set. Each element of the enumeration is of class Attribute. If attribute set has zero attributes, an empty enumeration is returned.
    Google Code Search
    Stack Overflow
  • getIDstop

    public NamingEnumeration<String> getIDs()
    Retrieves an enumeration of the ids of the attributes in the attribute set. The effects of updates to this attribute set on this enumeration are undefined.
    Return:
    @return A non-null enumeration of the attributes' ids in this attribute set. Each element of the enumeration is of class String. If attribute set has zero attributes, an empty enumeration is returned.
    Google Code Search
    Stack Overflow
  • isCaseIgnoredtop

    public boolean isCaseIgnored()
    Determines whether the attribute set ignores the case of attribute identifiers when retrieving or adding attributes.
    Return:
    @return true if case is ignored; false otherwise.
    Google Code Search
    Stack Overflow
  • puttop

    public Attribute put(String attrID, Object val)
    Adds a new attribute to the attribute set.
    Parameters:
    @param attrID non-null The id of the attribute to add. If the attribute set ignores the character case of its attribute ids, the case of attrID is ignored.
    @param val The possibly null value of the attribute to add. If null, the attribute does not have any values.
    Return:
    @return The Attribute with attrID that was previous in this attribute set; null if no such attribute existed.
    See:
    @see javax.naming.directory.Attributes.remove(java.lang.String)
    Google Code Search
    Stack Overflow
  • puttop

    public Attribute put(Attribute attr)
    Adds a new attribute to the attribute set.
    Parameters:
    @param attr The non-null attribute to add. If the attribute set ignores the character case of its attribute ids, the case of attr's identifier is ignored.
    Return:
    @return The Attribute with the same ID as attr that was previous in this attribute set; null if no such attribute existed.
    See:
    @see javax.naming.directory.Attributes.remove(java.lang.String)
    Google Code Search
    Stack Overflow
  • removetop

    public Attribute remove(String attrID)
    Removes the attribute with the attribute id 'attrID' from the attribute set. If the attribute does not exist, ignore.
    Parameters:
    @param attrID The non-null id of the attribute to remove. If the attribute set ignores the character case of its attribute ids, the case of attrID is ignored.
    Return:
    @return The Attribute with the same ID as attrID that was previous in the attribute set; null if no such attribute existed.
    Google Code Search
    Stack Overflow
  • sizetop

    public int size()
    Retrieves the number of attributes in the attribute set.
    Return:
    @return The nonnegative number of attributes in this attribute set.
    Google Code Search
    Stack Overflow