org.apache.directory.api.ldap.model.schema.normalizers
Class CachingNormalizer

java.lang.Object
  extended by org.apache.directory.api.ldap.model.schema.AbstractSchemaObject
      extended by org.apache.directory.api.ldap.model.schema.LoadableSchemaObject
          extended by org.apache.directory.api.ldap.model.schema.Normalizer
              extended by org.apache.directory.api.ldap.model.schema.normalizers.CachingNormalizer
All Implemented Interfaces:
Serializable, SchemaObject
Direct Known Subclasses:
CachingDeepTrimNormalizer, CachingDeepTrimToLowerNormalizer, CachingDnNormalizer

public class CachingNormalizer
extends Normalizer

Caches previously normalized values.

Author:
Apache Directory Project
See Also:
Serialized Form

Field Summary
static int CACHE_MAX
          Cache maximum size default
protected  Normalizer normalizer
          The underlying decorated Normalizer
 
Fields inherited from class org.apache.directory.api.ldap.model.schema.AbstractSchemaObject
description, extensions, isEnabled, isObsolete, isReadOnly, locked, names, objectType, oid, schemaName, specification
 
Constructor Summary
CachingNormalizer(Normalizer normalizer)
          Creates a CachingNormalizer that decorates another normalizer using a default cache size.
CachingNormalizer(Normalizer normalizer, int cacheSz)
          Creates a CachingNormalizer that decorates another normalizer using a specified cache size.
 
Method Summary
 String getOid()
          Overrides default behavior by returning the OID of the wrapped Normalizer.
 String normalize(String value)
          Gets the normalized value.
 Value<?> normalize(Value<?> value)
          Gets the normalized value.
 void setOid(String oid)
          Overrides default behavior by setting the OID of the wrapped Normalizer.
 void setSchemaManager(SchemaManager schemaManager)
          Sets the SchemaManager
 
Methods inherited from class org.apache.directory.api.ldap.model.schema.Normalizer
equals, toString
 
Methods inherited from class org.apache.directory.api.ldap.model.schema.LoadableSchemaObject
copy, getBytecode, getFqcn, isValid, setBytecode, setFqcn
 
Methods inherited from class org.apache.directory.api.ldap.model.schema.AbstractSchemaObject
addExtension, addExtension, addName, clear, compareOid, copy, getDescription, getExtensions, getName, getNames, getObjectType, getSchemaName, getSpecification, hashCode, isDisabled, isEnabled, isObsolete, isReadOnly, lock, setDescription, setEnabled, setExtensions, setNames, setNames, setObsolete, setReadOnly, setSchemaName, setSpecification, unlock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CACHE_MAX

public static final int CACHE_MAX
Cache maximum size default

See Also:
Constant Field Values

normalizer

protected final Normalizer normalizer
The underlying decorated Normalizer

Constructor Detail

CachingNormalizer

public CachingNormalizer(Normalizer normalizer)
Creates a CachingNormalizer that decorates another normalizer using a default cache size. This Normalizer delegates

Parameters:
normalizer - the underlying Normalizer being decorated

CachingNormalizer

public CachingNormalizer(Normalizer normalizer,
                         int cacheSz)
Creates a CachingNormalizer that decorates another normalizer using a specified cache size.

Parameters:
normalizer - the underlying Normalizer being decorated
cacheSz - the maximum size of the name cache
Method Detail

getOid

public String getOid()
Overrides default behavior by returning the OID of the wrapped Normalizer.

Specified by:
getOid in interface SchemaObject
Overrides:
getOid in class AbstractSchemaObject
Returns:
an OID for this SchemaObject or its MatchingRule if this SchemaObject is a MatchingRuleUse object

setOid

public void setOid(String oid)
Overrides default behavior by setting the OID of the wrapped Normalizer.

Specified by:
setOid in interface SchemaObject
Overrides:
setOid in class AbstractSchemaObject
Parameters:
oid - the object identifier to set

normalize

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

Specified by:
normalize in class Normalizer
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 String normalize(String value)
                 throws LdapException
Gets the normalized value.

Specified by:
normalize in class Normalizer
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)
Sets the SchemaManager

Overrides:
setSchemaManager in class Normalizer
Parameters:
schemaManager - The SchemaManager


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.