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, DirContext#modifyAttributes, DirContext#bind, DirContext#rebind, DirContext#createSubcontext, DirContext#search
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | |
| pack-priv class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv transient Hashtable | |
| private boolean | ignoreCase
Indicates whether case of attribute ids is ignored. |
| private static final long | serialVersionUID
Use serialVersionUID from JNDI 1.1.1 for interoperability. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | BasicAttributes(boolean
true means this attribute set will ignore
the case of its attribute identifiers
when retrieving or adding attributes;
false means case is respected. ignoreCase)Constructs a new instance of Attributes. |
| public | BasicAttributes(String
non-null The id of the attribute to add. attrID, Object The value of the attribute to add. If null, a null
value is added to the attribute. val)Constructs a new instance of Attributes with one attribute. |
| public | BasicAttributes(String
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. attrID, Object The value of the attribute to add. If null, a null
value is added to the attribute. val, boolean true means this attribute set will ignore
the case of its attribute identifiers
when retrieving or adding attributes;
false means case is respected. ignoreCase)Constructs a new instance of Attributes with one attribute. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | clone()
Overrides java. Implements javax. Makes a copy of the attribute set. |
| public boolean | Returns: true If obj is equal to this BasicAttributes.the possibly null object to compare against. obj)Overrides java. Determines whether this |
| public Attribute | get(String attrID)
Implements javax. Retrieves the attribute with the given attribute id from the attribute set. |
| public NamingEnumeration | getAll()
Implements javax. Retrieves an enumeration of the attributes in the attribute set. |
| public NamingEnumeration | getIDs()
Implements javax. Retrieves an enumeration of the ids of the attributes in the attribute set. |
| public int | Returns: an int representing the hash code of this BasicAttributes instance.Overrides java. Calculates the hash code of this BasicAttributes. |
| public boolean | isCaseIgnored()
Implements javax. Determines whether the attribute set ignores the case of attribute identifiers when retrieving or adding attributes. |
| public Attribute | put(String attrID, Object val)
Implements javax. Adds a new attribute to the attribute set. |
| public Attribute | put(Attribute attr)
Implements javax. Adds a new attribute to the attribute set. |
| private void | readObject(ObjectInputStream
the s)ObjectInputStream to read fromThe readObject method is called to restore the state of
the |
| public Attribute | remove(String attrID)
Implements javax. Removes the attribute with the attribute id 'attrID' from the attribute set. |
| public int | size()
Implements javax. Retrieves the number of attributes in the attribute set. |
| public String | Returns: A non-null string listing the contents of this attribute set.Overrides java. Generates the string representation of this attribute set. |
| private void | writeObject(ObjectOutputStream
the s)ObjectOutputStream to write toThe writeObject method is called to save the state of the
|
| attrs | back to summary |
|---|---|
| pack-priv transient Hashtable<String, Attribute> attrs | |
| ignoreCase | back to summary |
|---|---|
| private boolean ignoreCase Indicates whether case of attribute ids is ignored. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Use serialVersionUID from JNDI 1.1.1 for interoperability. | |
| BasicAttributes | back to summary |
|---|---|
| public BasicAttributes() Constructs a new instance of Attributes. The character case of attribute identifiers is significant when subsequently retrieving or adding attributes. | |
| BasicAttributes | back to summary |
|---|---|
| public BasicAttributes(boolean ignoreCase) Constructs a new instance of Attributes.
If
| |
| BasicAttributes | back to summary |
|---|---|
| public BasicAttributes(String attrID, Object val) Constructs a new instance of Attributes with one attribute. The attribute specified by attrID and val are added to the newly created attribute. The character case of attribute identifiers is significant when subsequently retrieving or adding attributes. | |
| BasicAttributes | back to summary |
|---|---|
| public BasicAttributes(String attrID, Object val, boolean ignoreCase) Constructs a new instance of Attributes with one attribute.
The attribute specified by attrID and val are added to the newly
created attribute.
If
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Implements javax. Doc from javax. 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.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Determines whether this | |
| get | back to summary |
|---|---|
| public Attribute get(String attrID) Implements javax. Doc from javax. Retrieves the attribute with the given attribute id from the attribute set. | |
| getAll | back to summary |
|---|---|
| public NamingEnumeration Implements javax. Doc from javax. Retrieves an enumeration of the attributes in the attribute set. The effects of updates to this attribute set on this enumeration are undefined. | |
| getIDs | back to summary |
|---|---|
| public NamingEnumeration Implements javax. Doc from javax. 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. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Calculates the hash code of this BasicAttributes.
The hash code is computed by adding the hash code of
the attributes of this object. If this BasicAttributes
ignores case of its attribute IDs, one is added to the hash code.
If a subclass overrides
| |
| isCaseIgnored | back to summary |
|---|---|
| public boolean isCaseIgnored() Implements javax. Doc from javax. Determines whether the attribute set ignores the case of attribute identifiers when retrieving or adding attributes. | |
| put | back to summary |
|---|---|
| public Attribute put(String attrID, Object val) Implements javax. Doc from javax. Adds a new attribute to the attribute set. | |
| put | back to summary |
|---|---|
| public Attribute put(Attribute attr) Implements javax. Doc from javax. Adds a new attribute to the attribute set. | |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException The readObject method is called to restore the state of
the
| |
| remove | back to summary |
|---|---|
| public Attribute remove(String attrID) Implements javax. Doc from javax. Removes the attribute with the attribute id 'attrID' from the attribute set. If the attribute does not exist, ignore. | |
| size | back to summary |
|---|---|
| public int size() Implements javax. Doc from javax. Retrieves the number of attributes in the attribute set. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Generates the string representation of this attribute set. The string consists of each attribute identifier and the contents of each attribute. The contents of this string is useful for debugging and is not meant to be interpreted programmatically.
| |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream s) throws IOException The writeObject method is called to save the state of the
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Enumeration |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public boolean | hasMore()
Implements javax. Determines whether there are any more elements in the enumeration. |
| public boolean | hasMoreElements()
Implements java. Tests if this enumeration contains more elements. |
| public Attribute | next()
Implements javax. Retrieves the next element in the enumeration. |
| public Attribute | nextElement()
Implements java. Returns the next element of this enumeration if this enumeration object has at least one more element to provide. |
| elements | back to summary |
|---|---|
| pack-priv Enumeration<Attribute> elements | |
| AttrEnumImpl | back to summary |
|---|---|
| public AttrEnumImpl() | |
| close | back to summary |
|---|---|
| public void close() throws NamingException Implements javax. Doc from javax. Closes this enumeration.
After this method has been invoked on this enumeration, the
enumeration becomes invalid and subsequent invocation of any of
its methods will yield undefined results.
This method is intended for aborting an enumeration to free up resources.
If an enumeration proceeds to the end--that is, until
This method indicates to the service provider that it is free
to release resources associated with the enumeration, and can
notify servers to cancel any outstanding requests. The
| |
| hasMore | back to summary |
|---|---|
| public boolean hasMore() throws NamingException Implements javax. Doc from javax. Determines whether there are any more elements in the enumeration. This method allows naming exceptions encountered while determining whether there are more elements to be caught and handled by the application.
| |
| hasMoreElements | back to summary |
|---|---|
| public boolean hasMoreElements() Implements java. Doc from java. Tests if this enumeration contains more elements. | |
| next | back to summary |
|---|---|
| public Attribute next() throws NamingException Implements javax. Doc from javax. Retrieves the next element in the enumeration. This method allows naming exceptions encountered while retrieving the next element to be caught and handled by the application.
Note that
| |
| nextElement | back to summary |
|---|---|
| public Attribute nextElement() Implements java. Doc from java. Returns the next element of this enumeration if this enumeration object has at least one more element to provide. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Enumeration |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public boolean | hasMore()
Implements javax. Determines whether there are any more elements in the enumeration. |
| public boolean | hasMoreElements()
Implements java. Tests if this enumeration contains more elements. |
| public String | next()
Implements javax. Retrieves the next element in the enumeration. |
| public String | nextElement()
Implements java. Returns the next element of this enumeration if this enumeration object has at least one more element to provide. |
| elements | back to summary |
|---|---|
| pack-priv Enumeration<Attribute> elements | |
| IDEnumImpl | back to summary |
|---|---|
| public IDEnumImpl() | |
| close | back to summary |
|---|---|
| public void close() throws NamingException Implements javax. Doc from javax. Closes this enumeration.
After this method has been invoked on this enumeration, the
enumeration becomes invalid and subsequent invocation of any of
its methods will yield undefined results.
This method is intended for aborting an enumeration to free up resources.
If an enumeration proceeds to the end--that is, until
This method indicates to the service provider that it is free
to release resources associated with the enumeration, and can
notify servers to cancel any outstanding requests. The
| |
| hasMore | back to summary |
|---|---|
| public boolean hasMore() throws NamingException Implements javax. Doc from javax. Determines whether there are any more elements in the enumeration. This method allows naming exceptions encountered while determining whether there are more elements to be caught and handled by the application.
| |
| hasMoreElements | back to summary |
|---|---|
| public boolean hasMoreElements() Implements java. Doc from java. Tests if this enumeration contains more elements. | |
| next | back to summary |
|---|---|
| public String next() throws NamingException Implements javax. Doc from javax. Retrieves the next element in the enumeration. This method allows naming exceptions encountered while retrieving the next element to be caught and handled by the application.
Note that
| |
| nextElement | back to summary |
|---|---|
| public String nextElement() Implements java. Doc from java. Returns the next element of this enumeration if this enumeration object has at least one more element to provide. | |