This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.naming.directory
interface Attributes

All Superinterfaces:
Serializable
All Known Implementing Classes:
BasicAttributes

Most common ways to construct:

SearchResult sr = …;

Attributes attrs = sr.getAttributes();

Based on 53 examples

 

Attributes attrs = new BasicAttributes(true);

Based on 42 examples


public interface Attributes
extends Serializable

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.


Method Summary
 Object

          Makes a copy of the attribute set.
 Attribute
get(String attrID)

          Retrieves the attribute with the given attribute id from the attribute set.
 NamingEnumeration

          Retrieves an enumeration of the attributes in the attribute set.
 NamingEnumeration

          Retrieves an enumeration of the ids of the attributes in the attribute set.
 boolean

          Determines whether the attribute set ignores the case of attribute identifiers when retrieving or adding attributes.
 Attribute
put(Attribute attr)

          Adds a new attribute to the attribute set.
 Attribute
put(String attrID, Object val)

          Adds a new attribute to the attribute set.
 Attribute
remove(String attrID)

          Removes the attribute with the attribute id 'attrID' from the attribute set.
 int

          Retrieves the number of attributes in the attribute set.
 

Method Detail

clone

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.

Returns:
A non-null copy of this attribute set.

get

public Attribute get(String attrID)
Retrieves the attribute with the given attribute id from the attribute set.

Parameters:
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.
Returns:
The attribute identified by attrID; null if not found.

getAll

public NamingEnumeration getAll()
Retrieves an enumeration of the attributes in the attribute set. The effects of updates to this attribute set on this enumeration are undefined.

Returns:
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.

getIDs

public NamingEnumeration 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.

Returns:
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.

isCaseIgnored

public boolean isCaseIgnored()
Determines whether the attribute set ignores the case of attribute identifiers when retrieving or adding attributes.

Returns:
true if case is ignored; false otherwise.

put

public Attribute put(Attribute attr)
Adds a new attribute to the attribute set.

Parameters:
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.
Returns:
The Attribute with the same ID as attr that was previous in this attribute set; null if no such attribute existed.

put

public Attribute put(String attrID,
                     Object val)
Adds a new attribute to the attribute set.

Parameters:
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.
val - The possibly null value of the attribute to add. If null, the attribute does not have any values.
Returns:
The Attribute with attrID that was previous in this attribute set; null if no such attribute existed.

remove

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:
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.
Returns:
The Attribute with the same ID as attrID that was previous in the attribute set; null if no such attribute existed.

size

public int size()
Retrieves the number of attributes in the attribute set.

Returns:
The nonnegative number of attributes in this attribute set.


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.