net.wimpi.text
Interface Processor

All Known Subinterfaces:
ProcessingPipe
All Known Implementing Classes:
AbstractProcessor

public interface Processor

Interface that defines a processor.

Version:
0.2 19/11/2002
Author:
Dieter Wimberger

Method Summary
 java.lang.String getDescription()
          Returns the description of this processor, in the default Locale, or the default available Locale of this Processor.
 java.lang.String getDescription(java.util.Locale l)
          Returns the description of this processor, in the given Locale.
 java.lang.String getName()
          Returns the name of this processor.
 java.util.Locale[] listAvailableLocales()
          Returns a list of supported locales with regard to the descriptions.
 java.io.InputStream process(java.io.InputStream in)
          Returns an InputStream where the processed given source InputStream can be read from.
 java.lang.String process(java.lang.String str)
          Processes the given String and returns the result as String.
 void setDefaultLocale(java.util.Locale l)
          Sets the default Locale of this processor to the given Locale, if an only if a description in this locale exists.
 void setDescription(java.lang.String desc, java.util.Locale l)
          Sets the description of this processor in a given Locale.
 

Method Detail

getName

public java.lang.String getName()
Returns the name of this processor.
Returns:
the name of this processor as String.

getDescription

public java.lang.String getDescription()
Returns the description of this processor, in the default Locale, or the default available Locale of this Processor.
Returns:
the description of this processor as String.

getDescription

public java.lang.String getDescription(java.util.Locale l)
Returns the description of this processor, in the given Locale. If the given Locale is not available the default available one for this Processor will be returned.
Parameters:
l - a Locale.
Returns:
the description of this processor as String.

setDescription

public void setDescription(java.lang.String desc,
                           java.util.Locale l)
Sets the description of this processor in a given Locale. If no default Locale is set yet, the implementation should set the default to the first description it receives.
Parameters:
desc - the description of this processor as String.
l - a Locale.

setDefaultLocale

public void setDefaultLocale(java.util.Locale l)
Sets the default Locale of this processor to the given Locale, if an only if a description in this locale exists.
Parameters:
l - a Locale.

listAvailableLocales

public java.util.Locale[] listAvailableLocales()
Returns a list of supported locales with regard to the descriptions.
Returns:
the list as Locale[].

process

public java.lang.String process(java.lang.String str)
Processes the given String and returns the result as String.
Returns:
the processed String.

process

public java.io.InputStream process(java.io.InputStream in)
                            throws java.io.IOException
Returns an InputStream where the processed given source InputStream can be read from. (Pull principle)
Parameters:
the - source as InputStream.
Returns:
the InputStream to be read for the processed form of the given InputStream.
Throws:
java.io.IOException - if there is an I/O error.


Copyright 2001,2002 Dieter Wimberger. All Rights Reserved.