com.seventytwomiles.architecturerules.configuration
Class AbstractConfigurationFactory

java.lang.Object
  extended by com.seventytwomiles.architecturerules.configuration.AbstractConfigurationFactory
All Implemented Interfaces:
ConfigurationFactory
Direct Known Subclasses:
DigesterConfigurationFactory

public abstract class AbstractConfigurationFactory
extends java.lang.Object
implements ConfigurationFactory

Abstract Factory that provides common functionality for ConfigurationFactory implementations.

Author:
mikenereson
See Also:
ConfigurationFactory

Field Summary
protected  boolean doCyclicDependencyTest
          Weather or not to check for cyclic dependencies.
protected  java.util.Collection rules
          Set of Rules read from the configuration file
protected  java.util.List sources
          Set of Source read from configuration file
protected  boolean throwExceptionWhenNoPackages
          Weather or not to throw exception when no packages are found for a given path.
 
Fields inherited from interface com.seventytwomiles.architecturerules.configuration.ConfigurationFactory
DEFAULT_CONFIGURATION_FILE_NAME, DEFAULT_CYCLICAL_DEPENDENCY_CONFIGURATION_VALUE, DEFAULT_NO_PACKAGES_CONFIGURATION_BOOLEAN_VALUE
 
Constructor Summary
AbstractConfigurationFactory()
           
 
Method Summary
 boolean doCyclicDependencyTest()
          Holds the value parsed from the XML configuration that indicates weather or not the cyclic dependency test should be run.
protected  java.lang.String getConfigurationAsXml(java.lang.String configurationFileName)
          Read Xml configuration file to String.
 java.util.Collection getRules()
          Getter for property rules.
 java.util.List getSources()
          Getter for property sources.
 boolean throwExceptionWhenNoPackages()
          Holds the value parsed from the XML configuration that indicates weather or not a NoPackagesFoundException should be thrown when no packages are found in any of the given source paths.
protected abstract  void validateConfiguration(java.lang.String configuration)
          Validate the configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rules

protected final java.util.Collection rules

Set of Rules read from the configuration file


sources

protected final java.util.List sources

Set of Source read from configuration file


throwExceptionWhenNoPackages

protected boolean throwExceptionWhenNoPackages

Weather or not to throw exception when no packages are found for a given path.


doCyclicDependencyTest

protected boolean doCyclicDependencyTest

Weather or not to check for cyclic dependencies.

Constructor Detail

AbstractConfigurationFactory

public AbstractConfigurationFactory()
Method Detail

getRules

public java.util.Collection getRules()

Getter for property rules.

Specified by:
getRules in interface ConfigurationFactory
Returns:
Value for property rules.

getSources

public java.util.List getSources()

Getter for property sources.

Specified by:
getSources in interface ConfigurationFactory
Returns:
Value for property sources.

doCyclicDependencyTest

public boolean doCyclicDependencyTest()
Description copied from interface: ConfigurationFactory

Holds the value parsed from the XML configuration that indicates weather or not the cyclic dependency test should be run.

Specified by:
doCyclicDependencyTest in interface ConfigurationFactory
Returns:
boolean true when <cyclicalDependency test="true"/>
See Also:
ConfigurationFactory.doCyclicDependencyTest()

throwExceptionWhenNoPackages

public boolean throwExceptionWhenNoPackages()
Description copied from interface: ConfigurationFactory

Holds the value parsed from the XML configuration that indicates weather or not a NoPackagesFoundException should be thrown when no packages are found in any of the given source paths.

Specified by:
throwExceptionWhenNoPackages in interface ConfigurationFactory
Returns:
boolean true when <sources no-packages="exception">
See Also:
ConfigurationFactory.throwExceptionWhenNoPackages()

getConfigurationAsXml

protected java.lang.String getConfigurationAsXml(java.lang.String configurationFileName)

Read Xml configuration file to String.

Parameters:
configurationFileName - String name of the XML file in the classpath to load and read
Returns:
String returns the contents of the configurationFile

validateConfiguration

protected abstract void validateConfiguration(java.lang.String configuration)

Validate the configuration.

Parameters:
configuration - String xml content to validate
See Also:
"architecture-rules.dtd"


Copyright © 2008. All Rights Reserved.