org.apache.directory.shared.ldap.schema.normalizers
Class CachingNormalizer

java.lang.Object
  extended by org.apache.directory.shared.ldap.schema.normalizers.CachingNormalizer
All Implemented Interfaces:
java.io.Serializable, Normalizer

public class CachingNormalizer
extends java.lang.Object
implements Normalizer

Caches previously normalized values.

Version:
$Rev: 798550 $
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
 
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
 java.lang.String normalize(java.lang.String value)
          Gets the normalized value.
 Value<?> normalize(Value<?> value)
          Gets the normalized value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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.

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

normalize

public Value<?> normalize(Value<?> value)
                   throws javax.naming.NamingException
Gets the normalized value.

Specified by:
normalize in interface Normalizer
Parameters:
value - the value to normalize. It must *not* be null !
Returns:
the normalized form for a value
Throws:
javax.naming.NamingException - if an error results during normalization

normalize

public java.lang.String normalize(java.lang.String value)
                           throws javax.naming.NamingException
Gets the normalized value.

Specified by:
normalize in interface Normalizer
Parameters:
value - the value to normalize. It must *not* be null !
Returns:
the normalized form for a value
Throws:
javax.naming.NamingException - if an error results during normalization


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.