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.Collection 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.
 
Constructor Summary
AbstractConfigurationFactory()
           
 
Method Summary
 boolean doCyclicDependencyTest()
           
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.Collection getSources()
          Getter for property sources.
 boolean throwExceptionWhenNoPackages()
           
protected abstract  void validateConfigruation(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.Collection 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

validateConfigruation

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

Validate the configuration.

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

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 teh classpath to load and read
Returns:
String returns the contentsofo the configurationFile

getSources

public java.util.Collection getSources()

Getter for property sources.

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

getRules

public java.util.Collection getRules()

Getter for property rules.

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

throwExceptionWhenNoPackages

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

doCyclicDependencyTest

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


Copyright © 2007. All Rights Reserved.