public final class AttributeUtils
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
private |
AttributeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
applyModification(Entry entry,
Modification modification)
A method to apply a modification to an existing entry.
|
static boolean |
containsValueCaseIgnore(javax.naming.directory.Attribute attr,
java.lang.Object value)
Check if an attribute contains a value.
|
static java.lang.String |
parseAttribute(byte[] str,
Position pos,
boolean withOption,
boolean relaxed)
Parse an attribute.
|
private static boolean |
parseNumber(byte[] filter,
Position pos)
Parse a number :
number = '0' | '1'..'9' digits
digits = '0'..'9'*
|
private static void |
parseOID(byte[] str,
Position pos)
Parse an OID.
|
private static void |
parseOptions(byte[] str,
Position pos)
Parse attribute's options :
options = *( ';' option )
option = 1*keychar
keychar = 'a'-z' | 'A'-'Z' / '0'-'9' / '-'
|
static Attribute |
toApiAttribute(javax.naming.directory.Attribute jndiAttribute)
Convert a JNDI Attribute to an LDAP API Attribute
|
static javax.naming.directory.Attributes |
toAttributes(Entry entry)
Converts an
Entry to an Attributes. |
static javax.naming.directory.Attributes |
toCaseInsensitive(javax.naming.directory.Attributes attributes)
Check if the attributes is a BasicAttributes, and if so, switch
the case sensitivity to false to avoid tricky problems in the server.
|
static Entry |
toEntry(javax.naming.directory.Attributes attributes,
Dn dn)
Convert a BasicAttributes or a AttributesImpl to an Entry
|
static javax.naming.directory.Attribute |
toJndiAttribute(Attribute attribute)
Converts an
Attribute to a JNDI Attribute. |
public static boolean containsValueCaseIgnore(javax.naming.directory.Attribute attr,
java.lang.Object value)
attr - The attribute to checkvalue - The value to look forpublic static javax.naming.directory.Attributes toCaseInsensitive(javax.naming.directory.Attributes attributes)
attributes - The Attributes to checkprivate static void parseOptions(byte[] str,
Position pos)
throws java.text.ParseException
java.text.ParseExceptionprivate static boolean parseNumber(byte[] filter,
Position pos)
private static void parseOID(byte[] str,
Position pos)
throws java.text.ParseException
str - The OID to parsepos - The current position in the stringjava.text.ParseException - If we don't have a valid OIDpublic static java.lang.String parseAttribute(byte[] str,
Position pos,
boolean withOption,
boolean relaxed)
throws java.text.ParseException
str - The parsed attribute,pos - The position of the attribute in the current stringjava.text.ParseExceptionpublic static void applyModification(Entry entry, Modification modification) throws LdapException
entry - The entry on which we want to apply a modificationmodification - the Modification to be appliedLdapException - if some operation fails.public static Entry toEntry(javax.naming.directory.Attributes attributes, Dn dn) throws LdapException
attributes - the BasicAttributes or AttributesImpl instance to convertdn - The Dn which is needed by the EntryLdapException - If we get an invalid attributepublic static javax.naming.directory.Attributes toAttributes(Entry entry)
Entry to an Attributes.entry - the Entry to convertAttributespublic static javax.naming.directory.Attribute toJndiAttribute(Attribute attribute)
Attribute to a JNDI Attribute.attribute - the Attribute to convertpublic static Attribute toApiAttribute(javax.naming.directory.Attribute jndiAttribute) throws LdapInvalidAttributeValueException
jndiAttribute - the JNDI Attribute instance to convertLdapInvalidAttributeValueException