org.jdiseq.filter
Class FilterPersistenceImpl

java.lang.Object
  extended byorg.jdiseq.filter.FilterPersistenceImpl
All Implemented Interfaces:
org.jdiseq.filter.FilterPersistence, org.jdiseq.filter.Persister

public class FilterPersistenceImpl
extends java.lang.Object
implements org.jdiseq.filter.FilterPersistence, org.jdiseq.filter.Persister

FilterPersistenceImpl holds all the filter configuration data used by jDiSeq. It will allow clients to ask for filter configuration data whenever needed.

Since:
1.0
Version:
$Id: FilterPersistenceImpl.java,v 1.2 2003/08/17 13:15:53 trondandersen Exp $
Author:
Trond Andersen

Field Summary
static Namespace NAMESPACE
          XML namespace definition.
 
Constructor Summary
FilterPersistenceImpl()
          Initializes the configuration with the default filter configuration file name.
FilterPersistenceImpl(java.io.InputStream inputStream)
          Reads configuration from an InputStream given by the client.
FilterPersistenceImpl(java.lang.String configFilename)
          Initilized the configuration based on the filename given as a parameter.
 
Method Summary
protected  java.io.InputStream getConfigurationInputStream(java.lang.String configFile)
           
 Element getMethodFilterParent()
          Gets the JDOM representation of the method filter parent node in the JDOM three structure.
 Element getPackageFilterParent()
          Gets the JDOM representation of the package filter parent node in the JDOM three structure.
 Document getXMLDocmuent()
          
 Filter[] load()
          
 MethodFilter[] loadMethodFilter()
          
 PackageFilter[] loadPackageFilter()
          
protected  Element parseConfiguration(java.io.InputStream inputStream)
          Reads the configuration file's content and sets the configuration settings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE

public static final Namespace NAMESPACE
XML namespace definition. Put in settings ?

Constructor Detail

FilterPersistenceImpl

public FilterPersistenceImpl(java.io.InputStream inputStream)
                      throws InvalidConfigurationException
Reads configuration from an InputStream given by the client.

Parameters:
inputStream - InputStream to the configuration file
Throws:
InvalidConfigurationException - Failed to read configuration file

FilterPersistenceImpl

public FilterPersistenceImpl(java.lang.String configFilename)
                      throws InvalidConfigurationException
Initilized the configuration based on the filename given as a parameter.

Parameters:
configFilename - Name of the filter configuration file
Throws:
InvalidConfigurationException - Failed to read configuration file
See Also:
FilterPersistenceImpl(InputStream)

FilterPersistenceImpl

public FilterPersistenceImpl()
                      throws InvalidConfigurationException
Initializes the configuration with the default filter configuration file name. This default filename is 'filterConfig.xml'.

See Also:
FilterPersistenceImpl(String)
Method Detail

load

public Filter[] load()
              throws InvalidConfigurationException

Specified by:
load in interface org.jdiseq.filter.FilterPersistence
Throws:
InvalidConfigurationException

loadMethodFilter

public MethodFilter[] loadMethodFilter()
                                throws InvalidConfigurationException

Specified by:
loadMethodFilter in interface org.jdiseq.filter.FilterPersistence
Throws:
InvalidConfigurationException

loadPackageFilter

public PackageFilter[] loadPackageFilter()
                                  throws InvalidConfigurationException

Specified by:
loadPackageFilter in interface org.jdiseq.filter.FilterPersistence
Throws:
InvalidConfigurationException

getMethodFilterParent

public Element getMethodFilterParent()
Gets the JDOM representation of the method filter parent node in the JDOM three structure.

Specified by:
getMethodFilterParent in interface org.jdiseq.filter.Persister
Returns:
method filter parent node

getPackageFilterParent

public Element getPackageFilterParent()
Gets the JDOM representation of the package filter parent node in the JDOM three structure.

Specified by:
getPackageFilterParent in interface org.jdiseq.filter.Persister
Returns:
package filter parent node

getXMLDocmuent

public Document getXMLDocmuent()

Specified by:
getXMLDocmuent in interface org.jdiseq.filter.Persister
Returns:
the JDOM XML Document representation

parseConfiguration

protected Element parseConfiguration(java.io.InputStream inputStream)
                              throws InvalidConfigurationException
Reads the configuration file's content and sets the configuration settings.

Parameters:
inputStream - InputStream used to read the configuration file
Returns:
Root element of the jdom three representing the XML document
Throws:
InvalidConfigurationException - Failed to access the configuration file

getConfigurationInputStream

protected java.io.InputStream getConfigurationInputStream(java.lang.String configFile)
                                                   throws InvalidConfigurationException
Parameters:
configFile - name of the configuration file
Returns:
the stream to the configuration file
Throws:
InvalidConfigurationException - Failed to read the InputStream content


Copyright © 2003 SourceForge.net. All Rights Reserved.