|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.isode.dsapi.Attribute
public class Attribute
Representation of an attribute. An Attribute has an AttributeType and a collection of AttributeValues (which may be empty).
| Field Summary | |
|---|---|
protected AttributeType |
attrType
Attribute type. |
| Constructor Summary | |
|---|---|
protected |
Attribute()
Used by the native library when creating a new empty object |
|
Attribute(AttributeType attrType)
Create an empty new Attribute object. |
| Method Summary | |
|---|---|
void |
addValue(AttributeValue value)
Add a value to the list of values for this Attribute. |
void |
addValue(String valueString)
Add a value to the list of values for this attribute. |
void |
clearValuesList()
|
int |
compareTo(Attribute oo)
Compare this Attribute with another one, returning an ordering based on syntax-specific comparisons. |
boolean |
equals(Object other)
Test whether two Attributes are equal according to syntax-specific comparisons: tests whether they have the same attribute type and all the same values (although perhaps in a different order). |
int |
exactCompareTo(Attribute oo)
Compare this Attribute with another one, returning an ordering based on comparisons on the exact values (without using syntax-specific comparisons). |
boolean |
exactEquals(Object other)
Test whether two Attributes are exactly equal according to matching the strings, binary values or BER values exactly: tests whether they have the same attribute type and exactly the same values (although perhaps in a different order). |
protected void |
finalize()
Releases any native structures associated with this object. |
String |
getAttributeName()
Returns a String representing the attribute type name. |
AttributeType |
getAttributeType()
Get the attribute type. |
Attribute |
getNormalizedAttribute()
Return a new Attribute containing normalized versions of all the values contained in this Attribute. |
int |
getSyntaxID()
Returns the integer representing the syntax ID for this Attribute. |
String |
getSyntaxName()
Returns a String representing the syntax for this object. |
AttributeValue |
getValue(int pos)
Get a specific AttributeValue from the set of values associated with this Attribute. |
int |
getValueCount()
Get value count. |
boolean |
hasAttributeType(AttributeType otherAttrType)
Determine if this object has a particular AttributeType. |
int |
hashCode()
Calculate a hash-code consistent with the equals() method. |
boolean |
hasSyntax(int syntax)
Check if this Attribute has a particular syntax. |
Iterator<AttributeValue> |
iterator()
Returns an iterator over the values in this Attribute |
Attribute |
relocate(DN... source_target_list)
If this Attribute contains DNs, and one or more of those DNs are within one of the subtrees indicated by the arguments, then those DN are relocated to the same relative location within the corresponding 'target' subtree (using DN.getRelocatedDN()), and a new Attribute is created and returned. |
Attribute |
relocate(DN source,
DN target)
If this Attribute contains DNs, and one or more of those DNs are within the subtree indicated by 'source', then they are relocated to the same relative location within the 'target' subtree (using DN.getRelocatedDN()), and a new Attribute is created and returned. |
String |
toString()
Return a String representation of this Attribute. |
| Methods inherited from class java.lang.Object |
|---|
clone, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected AttributeType attrType
| Constructor Detail |
|---|
protected Attribute()
public Attribute(AttributeType attrType)
throws NativeLibraryException
attrType - attribute type
NativeLibraryException - if an unrecoverable error was detected
by the native library| Method Detail |
|---|
protected void finalize()
throws Throwable
finalize in class ObjectThrowablepublic void clearValuesList()
public AttributeType getAttributeType()
public boolean hasAttributeType(AttributeType otherAttrType)
otherAttrType - an AttributeType.
public boolean hasSyntax(int syntax)
throws NativeLibraryException
syntax - An integer representing a syntax id, as may be
obtained from DSapi.nameToSyntaxID(String)
NativeLibraryException - if an unrecoverable error was detected
by the native librarygetSyntaxID()
public void addValue(AttributeValue value)
throws BadSyntaxException,
NativeLibraryException
value - AttributeValue to add.
BadSyntaxException - if the syntax of value
is not valid for this attribute.
NativeLibraryException - if an unrecoverable error was detected
by the native libraryaddValue(String)
public void addValue(String valueString)
throws BadValueException
AttributeValue object using the appropriate
AttributeType and adds it to the list of values.
valueString - a String representation of an attribute value
BadValueException - if valueString is not a
valid string representation for a value of
this object's AttributeType.addValue(AttributeValue)public AttributeValue getValue(int pos)
pos - Position of value in list, which is numbered starting from
zero to getValueCount()-1.
ArrayIndexOutOfBoundsException - if pos is out
of range.
NativeLibraryException - if an inconsistent
data structure is detected.getValueCount()public int getValueCount()
getValue(int)
public String getAttributeName()
throws NativeLibraryException
NativeLibraryException - if an unrecoverable error was detected
by the native libraryAttributeType.getAttributeTypeName(),
AttributeType.getAlias(String)
public String getSyntaxName()
throws NativeLibraryException
NativeLibraryException - if an unrecoverable error was
detected by the native library.AttributeType.getSyntaxName(),
DSapi.nameToSyntaxID(String)
public int getSyntaxID()
throws NativeLibraryException
NativeLibraryException - if an unrecoverable error was
detected by the native library.AttributeType.getSyntaxID(),
DSapi.syntaxIDToName(int)
public Attribute getNormalizedAttribute()
throws NativeLibraryException
NativeLibraryExceptionAttributeValue.getNormalizedValue()public int hashCode()
hashCode in class Objectpublic boolean equals(Object other)
equals in class Objectpublic int compareTo(Attribute oo)
compareTo in interface Comparable<Attribute>public boolean exactEquals(Object other)
public int exactCompareTo(Attribute oo)
public String toString()
toString in class Objectpublic Iterator<AttributeValue> iterator()
iterator in interface Iterable<AttributeValue>
public Attribute relocate(DN source,
DN target)
At the moment this only relocates DN-syntax values, but in the future it may be expanded to relocate ORNames and other types.
source - DN of base of source subtreetarget - DN of base of target subtree
public Attribute relocate(DN... source_target_list)
At the moment this only relocates DN-syntax values, but in the future it may be expanded to relocate ORNames and other types.
source_target_list - Array of an even number of DNs,
handled in pairs. Of each pair, the first is treated as a
source subtree, and the second as a target subtree. The DN is
matched against source DNs in the list from the start to the
end, and the first pair that it matches is the relocation that
is performed. If there are no matches the DN is left
unchanged.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Version: 15.2v7-0
Copyright (c) 2008-2013 Isode