Name

Attribute

Synopsis

This interface represents an attribute associated with a directory entry. The directory schema determines the classes of attributes that a directory entry with a certain object class definition is permitted to have. The class of a particular attribute is called the attribute type definition. The name of an attribute, called the attribute ID, is determined by the attribute type definition and has a String representation that refers to that particular attribute. Each attribute can have zero or more values of a particular class. The class of values an attribute is permitted to have is called the attribute syntax definition.

The directory schema, and therefore the attribute type and syntax definitions, depend on the underlying directory your JNDI application is using. You can use getAttributeDefinition() to determine the type definition for a particular attribute and getAttributeSyntaxDefinition() to determine the attribute syntax definition.

The get() method returns a single attribute value as a java.lang.Object, while getAll() returns multiple attribute values as a javax.naming.NamingEnumeration of objects. If the attribute has only a single value, get() returns that value. If the attribute has multiple values, the service provider determines the value that is returned.

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

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.