|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.ldap.name.AVA
public class AVA
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 | |
---|---|
AVA()
Construct an empty AVA |
|
AVA(java.lang.String upType,
java.lang.String normType,
byte[] upValue,
byte[] normValue)
Construct an AVA. |
|
AVA(java.lang.String upType,
java.lang.String normType,
java.lang.String upValue,
java.lang.String normValue)
Construct an AVA. |
|
AVA(java.lang.String upType,
java.lang.String normType,
Value<?> upValue,
Value<?> normValue)
Construct an AVA. |
|
AVA(java.lang.String upType,
java.lang.String normType,
Value<?> upValue,
Value<?> normValue,
java.lang.String upName)
Construct an AVA. |
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 |
getNormName()
Get the normalized Name of a AVA |
java.lang.String |
getNormType()
Get the normalized type of a AVA |
Value<?> |
getNormValue()
Get the Value of a AVA |
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 AVA |
Value<?> |
getUpValue()
Get the User Provided Value of a AVA |
int |
hashCode()
Gets the hashcode of this object. |
java.lang.String |
normalize()
A Normalized String representation of a AVA : - type is trimed and lowercased - value is trimed and lowercased, and special characters are escaped if needed. |
java.lang.String |
normalizeValue()
|
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(Value<?> upValue,
Value<?> normValue)
Store the value of a AVA. |
void |
setValueNormalized(java.lang.String value)
Store the value of a AVA, after having trimmed it. |
java.lang.String |
toString()
A String representation of a AVA. |
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AVA()
public AVA(java.lang.String upType, java.lang.String normType, java.lang.String upValue, java.lang.String normValue) throws LdapInvalidDnException
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
LdapInvalidDnException
public AVA(java.lang.String upType, java.lang.String normType, byte[] upValue, byte[] normValue) throws LdapInvalidDnException
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
LdapInvalidDnException
public AVA(java.lang.String upType, java.lang.String normType, Value<?> upValue, Value<?> normValue) throws LdapInvalidDnException
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
LdapInvalidDnException
public AVA(java.lang.String upType, java.lang.String normType, Value<?> upValue, Value<?> normValue, java.lang.String upName) throws LdapInvalidDnException
Note that the upValue should not be null or empty, or resolved to an empty string after having trimmed it.
upType
- The User Provided typenormType
- The normalized typeupValue
- The User Provided valuenormValue
- The normalized valueupName
- The User Provided name (may be escaped)
LdapInvalidDnException
Method Detail |
---|
public java.lang.String getNormType()
public java.lang.String getUpType()
public void setType(java.lang.String upType, java.lang.String type) throws LdapInvalidDnException
upType
- The AVA User Provided typetype
- The AVA type
LdapInvalidDnException
- if the type or upType are empty or null.
If the upName is invalid.public void setTypeNormalized(java.lang.String type) throws LdapInvalidDnException
type
- The AVA type
LdapInvalidDnException
public Value<?> getNormValue()
public Value<?> getUpValue()
public java.lang.String getNormName()
public void setValue(Value<?> upValue, Value<?> normValue)
value
- The user provided value of the AVAnormValue
- 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 AVApublic 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 normalizeValue()
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 AVA 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 AVA#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 |