org.apache.directory.shared.ldap.schema
Class Normalizer

java.lang.Object
  extended by org.apache.directory.shared.ldap.schema.AbstractSchemaObject
      extended by org.apache.directory.shared.ldap.schema.LoadableSchemaObject
          extended by org.apache.directory.shared.ldap.schema.Normalizer
All Implemented Interfaces:
java.io.Serializable, SchemaObject
Direct Known Subclasses:
BooleanNormalizer, CachingNormalizer, DeepTrimNormalizer, DeepTrimToLowerNormalizer, DefaultStringNormalizer, DnNormalizer, GeneralizedTimeNormalizer, NameOrNumericIdNormalizer, NoOpNormalizer, NumericNormalizer, ObjectIdentifierNormalizer, RegexNormalizer, TelephoneNumberNormalizer, UniqueMemberNormalizer

public abstract class Normalizer
extends LoadableSchemaObject

Converts attribute values to a canonical form.

Version:
$Rev: 929091 $
Author:
Apache Directory Project
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.schema.AbstractSchemaObject
description, extensions, isEnabled, isObsolete, isReadOnly, locked, names, objectType, oid, schemaName, specification
 
Constructor Summary
protected Normalizer()
          Use this default constructor when the Normalizer must be instantiated before setting the OID.
protected Normalizer(java.lang.String oid)
          The Normalizer base constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
           
abstract  java.lang.String normalize(java.lang.String value)
          Gets the normalized value.
abstract  Value<?> normalize(Value<?> value)
          Gets the normalized value.
 void setSchemaManager(SchemaManager schemaManager)
          Store the SchemaManager in this instance.
 java.lang.String toString()
           
 
Methods inherited from class org.apache.directory.shared.ldap.schema.LoadableSchemaObject
copy, getBytecode, getFqcn, isValid, registerOid, setBytecode, setFqcn
 
Methods inherited from class org.apache.directory.shared.ldap.schema.AbstractSchemaObject
addExtension, addName, addToRegistries, clear, compareOid, copy, getDescription, getExtensions, getName, getNames, getObjectType, getOid, getSchemaName, getSpecification, hashCode, isDisabled, isEnabled, isObsolete, isReadOnly, lock, removeFromRegistries, setDescription, setEnabled, setExtensions, setNames, setNames, setObsolete, setOid, setReadOnly, setRegistries, setSchemaName, setSpecification
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Normalizer

protected Normalizer(java.lang.String oid)
The Normalizer base constructor. We use it's MR OID to initialize the SchemaObject instance

Parameters:
oid - The associated OID. It's the element's MR OID

Normalizer

protected Normalizer()
Use this default constructor when the Normalizer must be instantiated before setting the OID.

Method Detail

normalize

public abstract Value<?> normalize(Value<?> value)
                            throws LdapException
Gets the normalized value.

Parameters:
value - the value to normalize. It must *not* be null !
Returns:
the normalized form for a value
Throws:
LdapException - if an error results during normalization

normalize

public abstract java.lang.String normalize(java.lang.String value)
                                    throws LdapException
Gets the normalized value.

Parameters:
value - the value to normalize. It must *not* be null !
Returns:
the normalized form for a value
Throws:
LdapException - if an error results during normalization

setSchemaManager

public void setSchemaManager(SchemaManager schemaManager)
Store the SchemaManager in this instance. It may be necessary for some normalizer which needs to have access to the oidNormalizer Map.

Parameters:
schemaManager - the schemaManager to store

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface SchemaObject
Overrides:
equals in class LoadableSchemaObject
See Also:
Object#equals()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.