1 /***
2 * Copyright 2007 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * For more information visit
11 * http://72miles.com and
12 * http://architecturerules.googlecode.com/svn/docs/index.html
13 */
14
15 package com.seventytwomiles.architecturerules.configuration;
16
17
18 import java.util.Collection;
19 import java.util.List;
20
21 import com.seventytwomiles.architecturerules.domain.Rule;
22 import com.seventytwomiles.architecturerules.domain.SourceDirectory;
23
24
25
26 /***
27 * <p>Interface for <code>ConfigurationFactory</code> implementations to adhere
28 * to.</p>
29 *
30 * @author mikenereson
31 */
32 public interface ConfigurationFactory {
33
34
35 /***
36 * <p>Holds the default value that should be used when no configuration is
37 * entered into the XML configuration file for the cyclic dependency
38 * test.</p>
39 *
40 * @parameter DEFAULT_CYCLICAL_DEPENDENCY_CONFIGURATION_VALUE String
41 */
42 public static final String DEFAULT_CYCLICAL_DEPENDENCY_CONFIGURATION_VALUE
43 = "true";
44
45 /***
46 * <p>Holds the default value that should be used when no configuration is
47 * entered into the XML configuration file for the no packages
48 * attribute.</p>
49 *
50 * @parameter DEFAULT_NO_PACKAGES_CONFIGURATION_BOOLEAN_VALUE boolean
51 */
52 public static final boolean DEFAULT_NO_PACKAGES_CONFIGURATION_BOOLEAN_VALUE
53 = false;
54
55 /***
56 * <p>The default name of the file containing the XML configuration.</p>
57 *
58 * @parameter DEFAULT_CONFIGURATION_FILE_NAME String
59 */
60 public static final String DEFAULT_CONFIGURATION_FILE_NAME
61 = "architecture-rules.xml";
62
63
64 /***
65 * <p>Holds the value parsed from the XML configuration that indicates
66 * weather or not the cyclic dependency test should be run.</p>
67 *
68 * @return boolean <tt>true</tt> when <samp><cyclicalDependency
69 * test="true"/> </samp>
70 */
71 boolean doCyclicDependencyTest();
72
73
74 /***
75 * <p>Getter for property {@link //rules}.</p>
76 *
77 * @return Value for property <tt>rules</tt>.
78 */
79 Collection<Rule> getRules();
80
81
82 /***
83 * <p>Getter for property {@link //sources}.</p>
84 *
85 * @return Value for property <tt>sources</tt>.
86 */
87 List<SourceDirectory> getSources();
88
89
90 /***
91 * <p>Holds the value parsed from the XML configuration that indicates
92 * weather or not a <code>NoPackagesFoundException</code> should be thrown
93 * when no packages are found in any of the given source paths.</p>
94 *
95 * @return boolean <tt>true</tt> when <samp><sources
96 * no-packages="exception"> </samp>
97 */
98 boolean throwExceptionWhenNoPackages();
99 }