at.knowcenter.wag.egov.egiz.tools
Class Normalizer

java.lang.Object
  extended by at.knowcenter.wag.egov.egiz.tools.Normalizer
All Implemented Interfaces:
Serializable

public class Normalizer
extends Object
implements Serializable

This class provides wrapper methods to get an access to different normalizer implementations.
This class is to load the corresponding implementation of a normalizer class. Therefor it seams to be a factory. The factory settings are read from the configuration file calling the SettingsReader.

Author:
wlackner
See Also:
Normalizer, NormalizeV01, SettingsReader, Serialized Form

Field Summary
protected static String DEFAULT_VERSION
          The default version string
protected static String SETTINGS_VERSION_KEY
          The settings key defined in the settings file
 
Constructor Summary
Normalizer()
          The empty constructor.
Normalizer(String rawString)
          New Normalizer init by the raw string.
Normalizer(String rawString, String normVersion)
          New Normalizer init by the raw string and a normalizer version.
 
Method Summary
 Normalize getInstance()
          Returns the underlying normalizer instance.
 String getNormalizedString()
          Return the normalized string.
 String getNormCR()
          Returns the normalizer line separator string.
 String getVersion()
          Return the current version string.
 void init()
          Load the factory implementation.
 String normalize()
          Wrapper method.
 String normalize(String rawString)
          Wrapper method.
 void setRawString(String rawString)
          Set the raw string to normalize
 void setVersion(String normVersion)
          Set a normalizer version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_VERSION

protected static final String DEFAULT_VERSION
The default version string

See Also:
Constant Field Values

SETTINGS_VERSION_KEY

protected static final String SETTINGS_VERSION_KEY
The settings key defined in the settings file

See Also:
SettingsReader, Constant Field Values
Constructor Detail

Normalizer

public Normalizer(String rawString,
                  String normVersion)
           throws NormalizeException
New Normalizer init by the raw string and a normalizer version.

Parameters:
rawString - the raw string to normalize
normVersion - the nomalizer version that should be used
Throws:
NormalizeException - ErrorCode:400

Normalizer

public Normalizer(String rawString)
           throws NormalizeException
New Normalizer init by the raw string.

Parameters:
rawString - the raw string to normalize
Throws:
NormalizeException - ErrorCode:400

Normalizer

public Normalizer()
           throws NormalizeException
The empty constructor.

Throws:
NormalizeException - ErrorCode:400
Method Detail

init

public void init()
          throws NormalizeException
Load the factory implementation. This method trys to load the configured normalizer library.

Throws:
NormalizeException

getInstance

public Normalize getInstance()
Returns the underlying normalizer instance.


setRawString

public void setRawString(String rawString)
Set the raw string to normalize


getNormalizedString

public String getNormalizedString()
Return the normalized string. If the chached value does not exist the normalize method from the current normalizer implementation is called.

Returns:
the normalized string

setVersion

public void setVersion(String normVersion)
                throws NormalizeException
Set a normalizer version. This activity load the new requested normalizer implementation.

Parameters:
normVersion - the normalizer version to be use
Throws:
NormalizeException - ErrorCode:400

getVersion

public String getVersion()
Return the current version string.

Returns:
the normaliser version string

normalize

public String normalize(String rawString)
Wrapper method. Call the normalizer implementation method.

Parameters:
rawString - the raw string to normalize
Returns:
the normalized string
See Also:
NormalizeV01

normalize

public String normalize()
Wrapper method. Call the normalizer implementation method. Normalize the current raw string.

Returns:
the normalized string
See Also:
NormalizeV01

getNormCR

public String getNormCR()
Returns the normalizer line separator string.

Returns:
the line separator string


Copyright © 2006-2007 EGIZ - E-Government Innovationszentrum. All Rights Reserved.