Package org.springframework.ldap.core
Class NameAwareAttribute
- java.lang.Object
-
- org.springframework.ldap.core.NameAwareAttribute
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<java.lang.Object>
,javax.naming.directory.Attribute
public final class NameAwareAttribute extends java.lang.Object implements javax.naming.directory.Attribute, java.lang.Iterable<java.lang.Object>
Used internally to make DirContextAdapter properly handle Names as values.- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NameAwareAttribute(java.lang.String id)
Construct a new instance with the specified id and no values.NameAwareAttribute(java.lang.String id, boolean orderMatters)
Construct a new instance with the specified id, no values and order significance as specified.NameAwareAttribute(java.lang.String id, java.lang.Object value)
Construct a new instance with the specified id and one value.NameAwareAttribute(javax.naming.directory.Attribute attribute)
Construct a new instance from the supplied Attribute.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int ix, java.lang.Object attrVal)
boolean
add(java.lang.Object attrVal)
void
clear()
java.lang.Object
clone()
boolean
contains(java.lang.Object attrVal)
boolean
equals(java.lang.Object o)
java.lang.Object
get()
java.lang.Object
get(int ix)
Due to performance reasons it is not advised to iterate over the attribute's values using this method.javax.naming.NamingEnumeration<?>
getAll()
javax.naming.directory.DirContext
getAttributeDefinition()
javax.naming.directory.DirContext
getAttributeSyntaxDefinition()
java.lang.String
getID()
int
hashCode()
boolean
hasValuesAsNames()
void
initValuesAsNames()
boolean
isOrdered()
java.util.Iterator<java.lang.Object>
iterator()
java.lang.Object
remove(int ix)
boolean
remove(java.lang.Object attrval)
java.lang.Object
set(int ix, java.lang.Object attrVal)
int
size()
java.lang.String
toString()
-
-
-
Constructor Detail
-
NameAwareAttribute
public NameAwareAttribute(java.lang.String id, java.lang.Object value)
Construct a new instance with the specified id and one value.- Parameters:
id
- the attribute idvalue
- the value to start off with
-
NameAwareAttribute
public NameAwareAttribute(javax.naming.directory.Attribute attribute)
Construct a new instance from the supplied Attribute.- Parameters:
attribute
- the Attribute to copy.
-
NameAwareAttribute
public NameAwareAttribute(java.lang.String id)
Construct a new instance with the specified id and no values.- Parameters:
id
- the attribute id
-
NameAwareAttribute
public NameAwareAttribute(java.lang.String id, boolean orderMatters)
Construct a new instance with the specified id, no values and order significance as specified.- Parameters:
id
- the attribute idorderMatters
- whether order has significance in this attribute.
-
-
Method Detail
-
getAll
public javax.naming.NamingEnumeration<?> getAll()
- Specified by:
getAll
in interfacejavax.naming.directory.Attribute
-
get
public java.lang.Object get()
- Specified by:
get
in interfacejavax.naming.directory.Attribute
-
size
public int size()
- Specified by:
size
in interfacejavax.naming.directory.Attribute
-
getID
public java.lang.String getID()
- Specified by:
getID
in interfacejavax.naming.directory.Attribute
-
contains
public boolean contains(java.lang.Object attrVal)
- Specified by:
contains
in interfacejavax.naming.directory.Attribute
-
add
public boolean add(java.lang.Object attrVal)
- Specified by:
add
in interfacejavax.naming.directory.Attribute
-
initValuesAsNames
public void initValuesAsNames()
-
hasValuesAsNames
public boolean hasValuesAsNames()
-
remove
public boolean remove(java.lang.Object attrval)
- Specified by:
remove
in interfacejavax.naming.directory.Attribute
-
clear
public void clear()
- Specified by:
clear
in interfacejavax.naming.directory.Attribute
-
getAttributeSyntaxDefinition
public javax.naming.directory.DirContext getAttributeSyntaxDefinition() throws javax.naming.NamingException
- Specified by:
getAttributeSyntaxDefinition
in interfacejavax.naming.directory.Attribute
- Throws:
javax.naming.NamingException
-
getAttributeDefinition
public javax.naming.directory.DirContext getAttributeDefinition() throws javax.naming.NamingException
- Specified by:
getAttributeDefinition
in interfacejavax.naming.directory.Attribute
- Throws:
javax.naming.NamingException
-
isOrdered
public boolean isOrdered()
- Specified by:
isOrdered
in interfacejavax.naming.directory.Attribute
-
get
public java.lang.Object get(int ix) throws javax.naming.NamingException
Due to performance reasons it is not advised to iterate over the attribute's values using this method. Please use the
iterator()
instead.- Specified by:
get
in interfacejavax.naming.directory.Attribute
- Throws:
javax.naming.NamingException
-
remove
public java.lang.Object remove(int ix)
- Specified by:
remove
in interfacejavax.naming.directory.Attribute
-
add
public void add(int ix, java.lang.Object attrVal)
- Specified by:
add
in interfacejavax.naming.directory.Attribute
-
set
public java.lang.Object set(int ix, java.lang.Object attrVal)
- Specified by:
set
in interfacejavax.naming.directory.Attribute
-
clone
public java.lang.Object clone()
- Specified by:
clone
in interfacejavax.naming.directory.Attribute
- Overrides:
clone
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
iterator
public java.util.Iterator<java.lang.Object> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<java.lang.Object>
-
-