|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.ldap.name.AttributeTypeAndValue
public class AttributeTypeAndValue
A Attribute Type And Value, which is the basis of all RDN. It contains a type, and a value. The type must not be case sensitive. Superfluous leading and trailing spaces MUST have been trimmed before. The value MUST be in UTF8 format, according to RFC 2253. If the type is in OID form, then the value must be a hexadecimal string prefixed by a '#' character. Otherwise, the string must respect the RC 2253 grammar. No further normalization will be done, because we don't have any knowledge of the Schema definition in the parser. We will also keep a User Provided form of the atav (Attribute Type And Value), called upName.
Constructor Summary | |
---|---|
AttributeTypeAndValue()
Construct an empty AttributeTypeAndValue |
|
AttributeTypeAndValue(java.lang.String upType,
java.lang.String normType,
java.lang.Object upValue,
java.lang.Object normValue)
Construct an AttributeTypeAndValue. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Implements the cloning. |
int |
compareTo(java.lang.Object object)
Compares two NameComponents. |
int |
compareToIgnoreCase(java.lang.Object object)
Compares two NameComponents. |
boolean |
equals(java.lang.Object obj)
|
int |
getLength()
Get the upName length |
java.lang.String |
getNormalizedValue()
Get the normalized Value of a AttributeTypeAndValue |
java.lang.String |
getNormType()
Get the normalized type of a AttributeTypeAndValue |
java.lang.Object |
getNormValue()
Get the Value of a AttributeTypeAndValue |
int |
getStart()
get the position in the original upName where this atav starts. |
java.lang.String |
getUpName()
Get the user provided form of this attribute type and value |
java.lang.String |
getUpType()
Get the user provided type of a AttributeTypeAndValue |
java.lang.Object |
getUpValue()
Get the User Provided Value of a AttributeTypeAndValue |
int |
hashCode()
Gets the hashcode of this object. |
java.lang.String |
normalize()
A Normalized String representation of a AttributeTypeAndValue : - type is trimed and lowercased - value is trimed and lowercased, and special characters are escaped if needed. |
void |
readExternal(java.io.ObjectInput in)
|
void |
setType(java.lang.String upType,
java.lang.String type)
Store a new type |
void |
setTypeNormalized(java.lang.String type)
Store the type, after having trimmed and lowercased it. |
void |
setValue(java.lang.Object upValue,
java.lang.Object normValue)
Store the value of a AttributeTypeAndValue. |
void |
setValueNormalized(java.lang.String value)
Store the value of a AttributeTypeAndValue, after having trimmed it. |
java.lang.String |
toString()
A String representation of a AttributeTypeAndValue. |
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AttributeTypeAndValue()
public AttributeTypeAndValue(java.lang.String upType, java.lang.String normType, java.lang.Object upValue, java.lang.Object normValue) throws javax.naming.InvalidNameException
Note that the upValue should not be null or empty, or resolved to an empty string after having trimmed it.
upType
- The Usrr Provided typenormType
- The normalized typeupValue
- The User Provided valuenormValue
- The normalized value
javax.naming.InvalidNameException
Method Detail |
---|
public java.lang.String getNormType()
public java.lang.String getUpType()
public void setType(java.lang.String upType, java.lang.String type) throws javax.naming.InvalidNameException
upType
- The AttributeTypeAndValue User Provided typetype
- The AttributeTypeAndValue type
javax.naming.InvalidNameException
- if the type or upType are empty or null.
If the upName is invalid.public void setTypeNormalized(java.lang.String type) throws javax.naming.InvalidNameException
type
- The AttributeTypeAndValue type
javax.naming.InvalidNameException
public java.lang.Object getNormValue()
public java.lang.Object getUpValue()
public java.lang.String getNormalizedValue()
public void setValue(java.lang.Object upValue, java.lang.Object normValue)
value
- The user provided value of the AttributeTypeAndValuenormValue
- The normalized valuepublic int getLength()
public int getStart()
public java.lang.String getUpName()
public void setValueNormalized(java.lang.String value)
value
- The value of the AttributeTypeAndValuepublic java.lang.Object clone()
clone
in class java.lang.Object
public int compareTo(java.lang.Object object)
compareTo
in interface java.lang.Comparable
object
-
public int compareToIgnoreCase(java.lang.Object object)
object
-
public java.lang.String normalize()
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(Object)
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
An AttributeTypeAndValue is composed of a type and a value.
The data are stored following the structure :
- upName
The User provided ATAV
- start
The position of this ATAV in the DN
- length
The ATAV length
- upType
The user Provided Type
- normType
The normalized AttributeType
- isHR
- Tells if the value is a String or not
if the value is a String :
- upValue
The User Provided value.
- value
The normalized value.
if the value is binary :
- upValueLength
- upValue
The User Provided value.
- valueLength
- value
The normalized value.
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
We read back the data to create a new ATAV. The structure
read is exposed in the {@link AttributeTypeAndValue#writeExternal(ObjectOutput)}
method
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |