public abstract class AbstractValue<T> extends Object implements Value<T>
| Modifier and Type | Field and Description |
|---|---|
protected AttributeType |
attributeType
reference to the attributeType zssociated with the value
|
protected boolean |
normalized
A flag set when the value has been normalized
|
protected T |
normalizedValue
the canonical representation of the wrapped value
|
protected boolean |
same
A flag set if the normalized data is different from the wrapped data
|
protected Boolean |
valid
cached results of the isValid() method call
|
protected T |
wrappedValue
the wrapped binary value
|
| Constructor and Description |
|---|
AbstractValue() |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(AttributeType attributeType) |
Value<T> |
clone() |
AttributeType |
getAttributeType()
Get the associated AttributeType
|
protected LdapComparator<T> |
getLdapComparator()
Gets a comparator using getMatchingRule() to resolve the matching
that the comparator is extracted from.
|
protected MatchingRule |
getMatchingRule()
Find a matchingRule to use for normalization and comparison.
|
T |
getNormalizedValue()
Gets the normalized (canonical) representation for the wrapped value.
|
T |
getNormalizedValueReference()
Gets a reference to the the normalized (canonical) representation
for the wrapped value.
|
protected Normalizer |
getNormalizer()
Gets a normalizer using getMatchingRule() to resolve the matchingRule
that the normalizer is extracted from.
|
T |
getReference()
Gets a reference to the wrapped binary value.
|
boolean |
instanceOf(AttributeType attributeType)
Check if the value is stored into an instance of the given
AttributeType, or one of its ascendant.
|
boolean |
isNormalized()
Tells if the value has already be normalized or not.
|
boolean |
isNull()
Check if the contained value is null or not
|
boolean |
isValid()
Uses the syntaxChecker associated with the attributeType to check if the
value is valid.
|
boolean |
isValid(SyntaxChecker syntaxChecker)
Uses the syntaxChecker associated with the attributeType to check if the
value is valid.
|
void |
normalize()
Normalize the value.
|
void |
setNormalized(boolean normalized)
Set the normalized flag.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitget, getBytes, getNormalizedValueCopy, getString, isBinary, length, normalizereadExternal, writeExternalcompareToprotected transient AttributeType attributeType
protected T wrappedValue
protected T normalizedValue
protected boolean normalized
protected Boolean valid
protected transient boolean same
public T getReference()
getReference in interface Value<T>public AttributeType getAttributeType()
public void apply(AttributeType attributeType)
protected LdapComparator<T> getLdapComparator() throws LdapException
LdapException - if resolution of schema entities failprotected MatchingRule getMatchingRule() throws LdapException
LdapException - if resolution of schema entities failprotected Normalizer getNormalizer() throws LdapException
LdapException - if resolution of schema entities failpublic boolean instanceOf(AttributeType attributeType) throws LdapException
attributeType - The AttributeType we are looking attrue if the value is associated with the given
attributeType or one of its ascendantLdapExceptionpublic T getNormalizedValue()
getNormalizedValue in interface Value<T>public T getNormalizedValueReference()
getNormalizedValueReference in interface Value<T>public final boolean isNull()
public final boolean isValid()
isValid in interface Value<T>true if the value is validValue.isValid()public final boolean isValid(SyntaxChecker syntaxChecker) throws LdapException
isValid in interface Value<T>syntaxChecker - the SyntaxChecker to use to validate the valuetrue if the value is validLdapException - if the value cannot be validatedServerValue#isValid()public void normalize()
throws LdapException
normalize in interface Value<T>LdapException - If the value cannot be normalizedpublic final boolean isNormalized()
isNormalized in interface Value<T>true if the value has already been normalized.public final void setNormalized(boolean normalized)
setNormalized in interface Value<T>the - value : true or falseCopyright © 2003–2016 The Apache Software Foundation. All rights reserved.