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 voidadd(int ix, java.lang.Object attrVal)booleanadd(java.lang.Object attrVal)voidclear()java.lang.Objectclone()booleancontains(java.lang.Object attrVal)booleanequals(java.lang.Object o)java.lang.Objectget()java.lang.Objectget(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.DirContextgetAttributeDefinition()javax.naming.directory.DirContextgetAttributeSyntaxDefinition()java.lang.StringgetID()inthashCode()booleanhasValuesAsNames()voidinitValuesAsNames()booleanisOrdered()java.util.Iterator<java.lang.Object>iterator()java.lang.Objectremove(int ix)booleanremove(java.lang.Object attrval)java.lang.Objectset(int ix, java.lang.Object attrVal)intsize()java.lang.StringtoString()
-
-
-
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:
getAllin interfacejavax.naming.directory.Attribute
-
get
public java.lang.Object get()
- Specified by:
getin interfacejavax.naming.directory.Attribute
-
size
public int size()
- Specified by:
sizein interfacejavax.naming.directory.Attribute
-
getID
public java.lang.String getID()
- Specified by:
getIDin interfacejavax.naming.directory.Attribute
-
contains
public boolean contains(java.lang.Object attrVal)
- Specified by:
containsin interfacejavax.naming.directory.Attribute
-
add
public boolean add(java.lang.Object attrVal)
- Specified by:
addin interfacejavax.naming.directory.Attribute
-
initValuesAsNames
public void initValuesAsNames()
-
hasValuesAsNames
public boolean hasValuesAsNames()
-
remove
public boolean remove(java.lang.Object attrval)
- Specified by:
removein interfacejavax.naming.directory.Attribute
-
clear
public void clear()
- Specified by:
clearin interfacejavax.naming.directory.Attribute
-
getAttributeSyntaxDefinition
public javax.naming.directory.DirContext getAttributeSyntaxDefinition() throws javax.naming.NamingException- Specified by:
getAttributeSyntaxDefinitionin interfacejavax.naming.directory.Attribute- Throws:
javax.naming.NamingException
-
getAttributeDefinition
public javax.naming.directory.DirContext getAttributeDefinition() throws javax.naming.NamingException- Specified by:
getAttributeDefinitionin interfacejavax.naming.directory.Attribute- Throws:
javax.naming.NamingException
-
isOrdered
public boolean isOrdered()
- Specified by:
isOrderedin interfacejavax.naming.directory.Attribute
-
get
public java.lang.Object get(int ix) throws javax.naming.NamingExceptionDue to performance reasons it is not advised to iterate over the attribute's values using this method. Please use the
iterator()instead.- Specified by:
getin interfacejavax.naming.directory.Attribute- Throws:
javax.naming.NamingException
-
remove
public java.lang.Object remove(int ix)
- Specified by:
removein interfacejavax.naming.directory.Attribute
-
add
public void add(int ix, java.lang.Object attrVal)- Specified by:
addin interfacejavax.naming.directory.Attribute
-
set
public java.lang.Object set(int ix, java.lang.Object attrVal)- Specified by:
setin interfacejavax.naming.directory.Attribute
-
clone
public java.lang.Object clone()
- Specified by:
clonein interfacejavax.naming.directory.Attribute- Overrides:
clonein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
iterator
public java.util.Iterator<java.lang.Object> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.Object>
-
-