|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.shared.ldap.util.AttributeUtils
public class AttributeUtils
A set of utility fuctions for working with Attributes.
| Constructor Summary | |
|---|---|
AttributeUtils()
|
|
| Method Summary | |
|---|---|
static void |
applyModification(javax.naming.directory.Attributes entry,
javax.naming.directory.ModificationItem modification)
A method to apply a modification to an existing entry. |
static java.lang.Object |
cloneValue(java.lang.Object value)
Clone the value. |
static boolean |
containsAnyValues(javax.naming.directory.Attribute attr,
java.lang.Object[] compared,
AttributeType type)
|
static boolean |
containsValue(javax.naming.directory.Attribute attr,
java.lang.Object compared,
AttributeType type)
Check if an attribute contains a specific value, using the associated matchingRule for that |
static boolean |
containsValueCaseIgnore(javax.naming.directory.Attribute attr,
java.lang.Object value)
Check if an attribute contains a value. |
static boolean |
equals(java.lang.Object value1,
java.lang.Object value2)
Compare two values and return true if they are equal. |
static javax.naming.directory.Attribute |
getAttribute(javax.naming.directory.Attributes attrs,
AttributeType type)
Utility method to extract an attribute from Attributes object using all combinationos of the name including aliases. |
static javax.naming.directory.Attribute |
getDifference(javax.naming.directory.Attribute attr0,
javax.naming.directory.Attribute attr1)
Creates a new attribute which contains the values representing the difference of two attributes. |
static javax.naming.directory.ModificationItem |
getModificationItem(java.util.List<ModificationItemImpl> mods,
AttributeType type)
Utility method to extract a modification item from an array of modifications. |
static javax.naming.directory.Attribute |
getUnion(javax.naming.directory.Attribute attr0,
javax.naming.directory.Attribute attr1)
Creates a new attribute which contains the values representing the union of two attributes. |
static java.lang.String |
parseAttribute(java.lang.String str,
Position pos,
boolean withOption)
Parse an attribute. |
static void |
parseOID(java.lang.String str,
Position pos)
Parse an OID. |
static javax.naming.directory.Attribute |
removeAttribute(AttributeType type,
javax.naming.directory.Attributes entry)
Correctly removes an attribute from an entry using it's attributeType information. |
static java.lang.Object |
removeValue(javax.naming.directory.Attribute attr,
java.lang.Object compared,
AttributeType type)
Check if an attribute contains a specific value and remove it using the associated matchingRule for the attribute type supplied. |
static javax.naming.directory.Attribute |
toAttributeImpl(javax.naming.directory.Attribute attribute)
Switch from a BasicAttribute to a AttributeImpl. |
static javax.naming.directory.Attributes |
toAttributesImpl(javax.naming.directory.Attributes attributes)
Switch from a BasicAttributes to a AttributesImpl. |
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 java.lang.String |
toString(javax.naming.directory.Attribute attribute)
Return a string representing the attribute |
static java.lang.String |
toString(javax.naming.directory.Attributes attributes)
Return a string representing the attributes |
static java.lang.String |
toString(java.lang.String tabs,
javax.naming.directory.Attribute attribute)
Return a string representing the attributes with tabs in front of the string |
static java.lang.String |
toString(java.lang.String tabs,
javax.naming.directory.Attributes attributes)
Return a string representing the attributes with tabs in front of the string |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AttributeUtils()
| Method Detail |
|---|
public static javax.naming.directory.Attribute removeAttribute(AttributeType type,
javax.naming.directory.Attributes entry)
type - the attributeType of the attribute to removeentry - the entry to remove the attribute from
public static final boolean equals(java.lang.Object value1,
java.lang.Object value2)
value1 - The first valuevalue2 - The second value
public static java.lang.Object cloneValue(java.lang.Object value)
value - The value to clone
public static final javax.naming.directory.Attribute toAttributeImpl(javax.naming.directory.Attribute attribute)
attribute - The attribute to transform
public static final javax.naming.directory.Attributes toAttributesImpl(javax.naming.directory.Attributes attributes)
attributes - The attributes to transform
public static final javax.naming.directory.Attribute getAttribute(javax.naming.directory.Attributes attrs,
AttributeType type)
attrs - the Attributes to get the Attribute object fromtype - the attribute type specification
public static final javax.naming.directory.ModificationItem getModificationItem(java.util.List<ModificationItemImpl> mods,
AttributeType type)
mods - the array of ModificationItems to extract the Attribute from.type - the attributeType spec of the Attribute to extract
public static boolean containsValue(javax.naming.directory.Attribute attr,
java.lang.Object compared,
AttributeType type)
throws javax.naming.NamingException
attr - The attribute we are searching incompared - The object we are looking fortype - The attribute type
true if the value exists in the attribute
javax.naming.NamingException - If something went wrong while accessing the data
public static boolean containsValueCaseIgnore(javax.naming.directory.Attribute attr,
java.lang.Object value)
attr - The attribute to checkvalue - The value to look for
public static boolean containsAnyValues(javax.naming.directory.Attribute attr,
java.lang.Object[] compared,
AttributeType type)
throws javax.naming.NamingException
javax.naming.NamingException
public static javax.naming.directory.Attribute getDifference(javax.naming.directory.Attribute attr0,
javax.naming.directory.Attribute attr1)
throws javax.naming.NamingException
IllegalArgumentException is
raised. Note that the order of arguments makes a difference.
attr0 - the first attributeattr1 - the second attribute
javax.naming.NamingException - if there are problems accessing attribute values
public static javax.naming.directory.Attribute getUnion(javax.naming.directory.Attribute attr0,
javax.naming.directory.Attribute attr1)
throws javax.naming.NamingException
IllegalArgumentException
is raised.
attr0 - the first attributeattr1 - the second attribute
javax.naming.NamingException - if there are problems accessing attribute valuespublic static javax.naming.directory.Attributes toCaseInsensitive(javax.naming.directory.Attributes attributes)
attributes - The Attributes to check
public static java.lang.String toString(java.lang.String tabs,
javax.naming.directory.Attribute attribute)
tabs - Spaces to be added before the stringattribute - The attribute to print
public static java.lang.String toString(javax.naming.directory.Attribute attribute)
attribute - The attribute to print
public static java.lang.String toString(java.lang.String tabs,
javax.naming.directory.Attributes attributes)
tabs - Spaces to be added before the stringattributes - The attributes to print
public static void parseOID(java.lang.String str,
Position pos)
throws java.text.ParseException
str - The OID to parsepos - The current position in the string
java.text.ParseException - If we don't have a valid OID
public static java.lang.String parseAttribute(java.lang.String str,
Position pos,
boolean withOption)
throws java.text.ParseException
str - The parsed attribute,pos - The position of the attribute in the current string
java.text.ParseExceptionpublic static java.lang.String toString(javax.naming.directory.Attributes attributes)
attributes - The attributes to print
public static void applyModification(javax.naming.directory.Attributes entry,
javax.naming.directory.ModificationItem modification)
throws javax.naming.NamingException
entry - The entry on which we want to apply a modificationmodification - the Modification to be applied
javax.naming.NamingException - if some operation fails.
public static java.lang.Object removeValue(javax.naming.directory.Attribute attr,
java.lang.Object compared,
AttributeType type)
throws javax.naming.NamingException
attr - the attribute we are searching incompared - the object we are looking fortype - the attribute type
javax.naming.NamingException - if something went wrong while removing the value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||