|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.ldap.entry.AbstractValue<java.lang.String>
org.apache.directory.shared.ldap.entry.client.ClientStringValue
org.apache.directory.server.core.entry.ServerStringValue
public class ServerStringValue
A server side schema aware wrapper around a String attribute value. This value wrapper uses schema information to syntax check values, and to compare them for equality and ordering. It caches results and invalidates them when the wrapped value changes.
Field Summary |
---|
Fields inherited from class org.apache.directory.shared.ldap.entry.AbstractValue |
---|
normalized, normalizedValue, valid, wrapped |
Constructor Summary | |
---|---|
ServerStringValue(org.apache.directory.shared.ldap.schema.AttributeType attributeType)
Creates a ServerStringValue without an initial wrapped value. |
|
ServerStringValue(org.apache.directory.shared.ldap.schema.AttributeType attributeType,
java.lang.String wrapped)
Creates a ServerStringValue with an initial wrapped String value. |
Method Summary | |
---|---|
protected java.lang.String |
checkAttributeType(org.apache.directory.shared.ldap.schema.AttributeType attributeType)
Check the attributeType member. |
ServerStringValue |
clone()
|
int |
compareTo(org.apache.directory.shared.ldap.entry.Value<java.lang.String> value)
|
void |
deserialize(java.io.ObjectInput in)
Deserialize a ServerStringValue. |
boolean |
equals(java.lang.Object obj)
Checks to see if this ServerStringValue equals the supplied object. |
org.apache.directory.shared.ldap.schema.AttributeType |
getAttributeType()
Get the associated AttributeType |
java.lang.String |
getNormalizedValue()
Gets the normalized (canonical) representation for the wrapped string. |
int |
hashCode()
Implement the hashCode method. |
boolean |
instanceOf(org.apache.directory.shared.ldap.schema.AttributeType attributeType)
Check if the value is stored into an instance of the given AttributeType, or one of its ascendant. |
boolean |
isValid()
Uses the syntaxChecker associated with the attributeType to check if the value is valid. |
protected java.lang.String |
logAssert(java.lang.String message)
Utility method to get some logs if an assert fails |
void |
normalize()
Compute the normalized (canonical) representation for the wrapped string. |
void |
readExternal(java.io.ObjectInput in)
|
void |
serialize(java.io.ObjectOutput out)
We will write the value and the normalized value, only if the normalized value is different. |
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class org.apache.directory.shared.ldap.entry.client.ClientStringValue |
---|
get, getCopy, getNormalizedValueCopy, isBinary, normalize, set, toString |
Methods inherited from class org.apache.directory.shared.ldap.entry.AbstractValue |
---|
clear, getNormalizedValueReference, getReference, isNormalized, isNull, isValid, setNormalized |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ServerStringValue(org.apache.directory.shared.ldap.schema.AttributeType attributeType)
attributeType
- the schema type associated with this ServerStringValuepublic ServerStringValue(org.apache.directory.shared.ldap.schema.AttributeType attributeType, java.lang.String wrapped)
attributeType
- the schema type associated with this ServerStringValuewrapped
- the value to wrap which can be nullMethod Detail |
---|
protected java.lang.String logAssert(java.lang.String message)
protected java.lang.String checkAttributeType(org.apache.directory.shared.ldap.schema.AttributeType attributeType)
public ServerStringValue clone()
clone
in interface org.apache.directory.shared.ldap.entry.Value<java.lang.String>
clone
in class org.apache.directory.shared.ldap.entry.client.ClientStringValue
public void normalize() throws javax.naming.NamingException
normalize
in interface org.apache.directory.shared.ldap.entry.Value<java.lang.String>
normalize
in class org.apache.directory.shared.ldap.entry.AbstractValue<java.lang.String>
javax.naming.NamingException
- if the value cannot be properly normalizedpublic java.lang.String getNormalizedValue()
getNormalizedValue
in interface org.apache.directory.shared.ldap.entry.Value<java.lang.String>
getNormalizedValue
in class org.apache.directory.shared.ldap.entry.client.ClientStringValue
javax.naming.NamingException
- if the value cannot be properly normalizedpublic final boolean isValid()
isValid
in interface org.apache.directory.shared.ldap.entry.Value<java.lang.String>
isValid
in class org.apache.directory.shared.ldap.entry.AbstractValue<java.lang.String>
Value.isValid()
public int compareTo(org.apache.directory.shared.ldap.entry.Value<java.lang.String> value)
compareTo
in interface java.lang.Comparable<org.apache.directory.shared.ldap.entry.Value<java.lang.String>>
compareTo
in class org.apache.directory.shared.ldap.entry.client.ClientStringValue
java.lang.IllegalStateException
- on failures to extract the comparator, or the
normalizers needed to perform the required comparisons based on the schemaComparable.compareTo(Object)
public org.apache.directory.shared.ldap.schema.AttributeType getAttributeType()
public boolean instanceOf(org.apache.directory.shared.ldap.schema.AttributeType attributeType) throws javax.naming.NamingException
attributeType
- The AttributeType we are looking at
true
if the value is associated with the given
attributeType or one of its ascendant
javax.naming.NamingException
public boolean equals(java.lang.Object obj)
equals
in class org.apache.directory.shared.ldap.entry.client.ClientStringValue
java.lang.IllegalStateException
- on failures to extract the comparator, or the
normalizers needed to perform the required comparisons based on the schemapublic int hashCode()
hashCode
in class org.apache.directory.shared.ldap.entry.client.ClientStringValue
java.lang.IllegalStateException
- on failures to extract the comparator, or the
normalizers needed to perform the required comparisons based on the schemaObject.hashCode()
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class org.apache.directory.shared.ldap.entry.client.ClientStringValue
java.io.IOException
We can't use this method for a ServerStringValue, as we have to feed the value
with an AttributeType object
public void serialize(java.io.ObjectOutput out) throws java.io.IOException
out
- the buffer in which we will stored the serialized form of the value
java.io.IOException
- if we can't write into the bufferpublic void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class org.apache.directory.shared.ldap.entry.client.ClientStringValue
java.io.IOException
java.lang.ClassNotFoundException
We can't use this method for a ServerStringValue, as we have to feed the value
with an AttributeType object
public void deserialize(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
in
- the buffer containing the bytes with the serialized value
java.io.IOException
java.lang.ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |