eap.filter
Class Filter

java.lang.Object
  extended byeap.filter.Filter

public class Filter
extends Object

Holds information about a filter. Note that this class does not actually implement the filter. That is done in a separate class whose name is known by this class. Such a class must be a subclass of java.io.InputStream, and must have a constructor: Class(java.io.InputStream) or Class(java.io.InputStream, String). If it has both constructors, then only the former will be used. The latter constructor is used if the filter requires a parameter, such as an encryption key. Note that the implementation class is not loaded until a user calls instantiate(InputStream, PasswordProvider).


Constructor Summary
Filter(String ending, String classname, String name)
          Construct a new Filter object.
 
Method Summary
 String getEnding()
          Returns the filename extension for this filter
 String getName()
          Returns the human-readable name of the filter
 InputStream instantiate(InputStream in, PasswordProvider password)
          Create an instance of the implementation class for this filter.
 String toString()
          Returns a string representation of this filter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Filter

public Filter(String ending,
              String classname,
              String name)
Construct a new Filter object.

Parameters:
ending - The file name ending for which this filter is appropriate.
classname - The fully qalified name of the class which implements this filter.
name - A human readable name for this filter.
Method Detail

getEnding

public String getEnding()
Returns the filename extension for this filter

Returns:
the filename extension for this filter

getName

public String getName()
Returns the human-readable name of the filter

Returns:
the human-readable name of the filter

instantiate

public InputStream instantiate(InputStream in,
                               PasswordProvider password)
                        throws FilterException
Create an instance of the implementation class for this filter. Note the implementation class is not loaded until this method is called.

Parameters:
in - The stream to be filtered. This is passed to the implementation class's constructor.
password - a source of password information in case we need one. This can be null if we know we won't need a password. The password obtained from this provider may be passed to the implementation class's constructor, if need be.
Returns:
An input stream which will produce filtered data from the input stream given as an argument.
Throws:
FilterException

toString

public String toString()
Returns a string representation of this filter

Returns:
a string representation of this filter