com.seventytwomiles.architecturerules.configuration
Class Configuration

java.lang.Object
  extended by com.seventytwomiles.architecturerules.configuration.Configuration
Direct Known Subclasses:
UnmodifiableConfiguration

public class Configuration
extends Object

An instance of Configuration allows the application to specifiy where the source directories are, what rules to test against and under what conditions should an Exception be thrown.

This Configuration may be loaded by configuration from an XML file in the classpath, through programmatic configuration, or both.

Author:
mikenereson
See Also:
ConfigurationFactory, UnmodifiableConfiguration

Constructor Summary
Configuration()
           
 
Method Summary
 Configuration addRule(Rule rule)
          Add a new Rule to rules
 Configuration addSource(SourceDirectory sourceDirectory)
          Add a new SourceDirectory to sources
 Collection<Rule> getRules()
          Getter for property rules.
 Collection<SourceDirectory> getSources()
          Getter for property sources.
 Configuration setDoCyclicDependencyTest(boolean doCyclicDependencyTest)
          Setter for property doCyclicDependencyTest.
 Configuration setThrowExceptionWhenNoPackages(boolean throwExceptionWhenNoPackages)
          Setter for property throwExceptionWhenNoPackages.
 boolean shouldDoCyclicDependencyTest()
          Getter for property doCyclicDependencyTest.
 boolean shouldThrowExceptionWhenNoPackages()
           Getter for property throwExceptionWhenNoPackages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration()
Method Detail

getRules

public Collection<Rule> getRules()

Getter for property rules.

Returns:
Value for property rules.

getSources

public Collection<SourceDirectory> getSources()

Getter for property sources.

Returns:
Value for property sources.

setDoCyclicDependencyTest

public Configuration setDoCyclicDependencyTest(boolean doCyclicDependencyTest)

Setter for property doCyclicDependencyTest.

Parameters:
doCyclicDependencyTest - Value to set for property doCyclicDependencyTest.
Returns:
Configuration this Configuration which allows for method chaining

setThrowExceptionWhenNoPackages

public Configuration setThrowExceptionWhenNoPackages(boolean throwExceptionWhenNoPackages)

Setter for property throwExceptionWhenNoPackages.

Parameters:
throwExceptionWhenNoPackages - Value to set for property throwExceptionWhenNoPackages.
Returns:
Configuration this Configuration which allows for method chaining

addRule

public Configuration addRule(Rule rule)

Add a new Rule to rules

Parameters:
rule - Rule to add
Returns:
Configuration this Configuration to allow for method chaining.

addSource

public Configuration addSource(SourceDirectory sourceDirectory)

Add a new SourceDirectory to sources

Parameters:
sourceDirectory - SourceDirectory to add
Returns:
Configuration this Configuration to allow for method chaining.

shouldDoCyclicDependencyTest

public boolean shouldDoCyclicDependencyTest()

Getter for property doCyclicDependencyTest.

Returns:
Value for property doCyclicDependencyTest.

shouldThrowExceptionWhenNoPackages

public boolean shouldThrowExceptionWhenNoPackages()

Getter for property throwExceptionWhenNoPackages.

Returns:
Value for property throwExceptionWhenNoPackages.


Copyright © 2007-2008. All Rights Reserved.