|
||||||||||
| 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(String upType,
String normType,
byte[] upValue,
byte[] normValue)
Construct an AVA. |
|
AVA(String upType,
String normType,
String upValue,
String normValue)
Construct an AVA. |
|
AVA(String upType,
String normType,
Value<?> upValue,
Value<?> normValue)
Construct an AVA. |
|
AVA(String upType,
String normType,
Value<?> upValue,
Value<?> normValue,
String upName)
Construct an AVA. |
|
| Method Summary | |
|---|---|
Object |
clone()
Implements the cloning. |
int |
compareTo(Object object)
Compares two NameComponents. |
int |
compareToIgnoreCase(Object object)
Compares two NameComponents. |
boolean |
equals(Object obj)
|
int |
getLength()
Get the upName length |
String |
getNormName()
Get the normalized Name of a AVA |
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. |
String |
getUpName()
Get the user provided form of this attribute type and value |
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. |
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. |
String |
normalizeValue()
|
void |
readExternal(ObjectInput in)
|
void |
setType(String upType,
String type)
Store a new type |
void |
setTypeNormalized(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(String value)
Store the value of a AVA, after having trimmed it. |
String |
toString()
A String representation of a AVA. |
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AVA()
public AVA(String upType,
String normType,
String upValue,
String normValue)
throws 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
InvalidNameException
public AVA(String upType,
String normType,
byte[] upValue,
byte[] normValue)
throws 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
InvalidNameException
public AVA(String upType,
String normType,
Value<?> upValue,
Value<?> normValue)
throws 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
InvalidNameException
public AVA(String upType,
String normType,
Value<?> upValue,
Value<?> normValue,
String upName)
throws InvalidNameException
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)
InvalidNameException| Method Detail |
|---|
public String getNormType()
public String getUpType()
public void setType(String upType,
String type)
throws InvalidNameException
upType - The AVA User Provided typetype - The AVA type
InvalidNameException - if the type or upType are empty or null.
If the upName is invalid.
public void setTypeNormalized(String type)
throws InvalidNameException
type - The AVA type
InvalidNameExceptionpublic Value<?> getNormValue()
public Value<?> getUpValue()
public 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 String getUpName()
public void setValueNormalized(String value)
value - The value of the AVApublic Object clone()
clone in class Objectpublic int compareTo(Object object)
compareTo in interface Comparableobject -
public int compareToIgnoreCase(Object object)
object -
public String normalizeValue()
public String normalize()
public int hashCode()
hashCode in class ObjectObject.hashCode()public boolean equals(Object obj)
equals in class ObjectObject.equals(Object)
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizableIOExceptionAn 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(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizableIOException
ClassNotFoundExceptionWe read back the data to create a new ATAV. The structure
read is exposed in the {@link AVA#writeExternal(ObjectOutput)}
methodpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||