|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.mentata.l3d.L3DAttribute
A container within an object for representing entry attribute values. This class can be extended by various attribute types that all implement the same basic functionality. Attributes are created and configured from within an object and can correspond with a specific attribute for the associated object class in the directory schema. A given L3DAttribute is configured to be optional or required and to have a single value or multiple values, not necessarily in accordance with the schema definition. Attributes can be populated with values from a corresponding entry in the directory database or manipulated with methods to initialize, set, add, or remove values. The class includes supporting methods for comparing values, sorting values, setting a limit on the number of values, setting a length limit for each value, accessing the containing object, accessing a bound connection for the containing object, and getting directory connections directly from the containing context. For its original implementation, this class stores and compares its values as simple, case-insensitive Unicode strings.
| Constructor Summary | |
L3DAttribute()
Constructs an empty attribute. |
|
| Method Summary | |
void |
addValue(String value)
Adds a value to the attribute. |
int |
compare(Object one,
Object two)
Sorts given values by locale specific string collation. |
protected L3DAttribute |
getAttribute(String name)
Returns another attribute from the containing object. |
protected LDAPConnection |
getBind()
Returns the bound connection from the containing object. |
protected L3DContext |
getContext()
Returns the context of the containing object. |
String |
getLabel()
Returns the attribute's assigned label. |
int |
getLengthThreshold()
Returns the maximum number of characters an attribute value may contain. |
String |
getName()
Returns the name of the attribute in the containing object. |
protected L3DObject |
getObject()
Returns the containing object. |
protected L3DObject |
getObject(String classname)
Returns an object from the containing context. |
String[] |
getPrerequisites()
Returns the attribute names in the named list. |
String[] |
getShortValues()
Returns the attribute's values as translated to a shortened text format. |
int |
getSize()
Returns the number of values for the attribute. |
int |
getThreshold()
Returns the number of values the attribute may contain. |
String[] |
getValues()
Returns the attribute's values. |
void |
initialize(String[] initializers)
Sets the attribute's values to those submitted. |
boolean |
isBound()
Identifies if the containing object has an associated connection. |
boolean |
isExceeded()
Identifies if the attribute exceeds its size threshold. |
boolean |
isGenerated()
Records the existence of assigned values for the attribute. |
boolean |
isLengthExceeded()
Identifies if an attribute value exceeds its length threshold. |
boolean |
isMultivalue()
Identifies if the attribute may contain multiple values. |
boolean |
isRequired()
Identifies if the attribute is required. |
void |
removeValue(String value)
Removes a value from the attribute. |
boolean |
same(String one,
String two)
Determines if the given values are considered equal for this attribute type. |
void |
setGenerated(boolean value)
Records the existence of assigned values for the attribute. |
void |
setLabel(String label)
Assigns a label to the attribute. |
void |
setLengthThreshold(int threshold)
Sets a threshold for the number of characters an attribute value can contain. |
protected void |
setPrerequisites(String[] prerequisites)
Sets prerequisite attributes for this attribute. |
void |
setThreshold(int threshold)
Sets a threshold for the number of values the attribute can contain. |
protected void |
setValues(String[] values)
Sets the attribute's values. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Comparator |
equals |
| Constructor Detail |
public L3DAttribute()
| Method Detail |
public String getName()
public final boolean isMultivalue()
public final boolean isRequired()
protected final L3DObject getObject()
protected final L3DContext getContext()
protected final L3DObject getObject(String classname)
throws L3DException
L3DException - if the containing requested object are undefined
protected final L3DAttribute getAttribute(String name)
throws L3DException
L3DException - if the containing object or requested attribute are undefined
public final boolean isBound()
throws L3DException
L3DException
protected final LDAPConnection getBind()
throws L3DException
null if there isn't one
L3DException - if the containing object is undefinedpublic void setLabel(String label)
label - a clear description of the attributepublic String getLabel()
public void setGenerated(boolean value)
value - whether values are assignedpublic boolean isGenerated()
protected final void setValues(String[] values)
values - new string valuespublic final String[] getValues()
public final int getSize()
public void setThreshold(int threshold)
threshold - the number of values permitted for the attributepublic int getThreshold()
public boolean isExceeded()
public void setLengthThreshold(int threshold)
threshold - the number of characters permitted for an attribute valuepublic int getLengthThreshold()
public boolean isLengthExceeded()
public boolean same(String one,
String two)
one - one value to comparetwo - the other value to compare
public int compare(Object one,
Object two)
compare in interface Comparatorone - first value for comparisontwo - second value for comparison
public String[] getShortValues()
public void addValue(String value)
throws L3DException
value - new value to add
L3DExceptionpublic void removeValue(String value)
value - the value to remove if currently a value for the attribute
public void initialize(String[] initializers)
throws L3DException
initializers - strings representing values
L3DException - in subclasses onlyprotected final void setPrerequisites(String[] prerequisites)
prerequisites - a list of required attributespublic final String[] getPrerequisites()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||