|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.seventytwomiles.architecturerules.domain.Rule
public class Rule
Represents a Rule that may not be violoated.
| Constructor Summary | |
|---|---|
Rule()
Constructs a new Rule. |
|
Rule(String id)
Instantiates a new Rule with the given id. |
|
Rule(String id,
String packageName)
Instantiates a new Rule with the given id. |
|
| Method Summary | |
|---|---|
boolean |
addPackage(String packageName)
Adds a package to the Packages collection. |
Rule |
addViolation(JPackage violation)
Add a new violation to this Rule. |
Rule |
addViolation(String violation)
Add a new violation to this Rule. |
String |
describe()
Describes the properties of this rule in an xml-like format. |
String |
describePackages()
Creates a String representation of this packages. |
boolean |
equals(Object object)
|
String |
getComment()
Getter for property comment. |
String |
getDescriptionOfRule()
Creates a String representation of this Rule. |
String |
getId()
Getter for property id. |
Collection<JPackage> |
getPackages()
Getter for property packages |
Collection<JPackage> |
getViolations()
Get all of the violations. |
int |
hashCode()
|
Rule |
removePackage(String packageName)
Remove a package from this Rule. |
Rule |
removeViolation(JPackage violation)
|
Rule |
removeViolation(String violation)
Remove a violation from this Rule. |
Rule |
setComment(String comment)
Setter for property comment. |
Rule |
setId(String id)
Setter for property id. |
void |
setIdString(String id)
Same as setId(String). |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Rule()
Constructs a new Rule.
public Rule(String id)
Instantiates a new Rule with the given id.
id - sets the id
public Rule(String id,
String packageName)
Instantiates a new Rule with the given id.
This constructor is to provide some sense of backwards compatibility with the releases in series 1 (1.0 and 1.1)
id - sets the idpackageName - a @packages to assert on.| Method Detail |
|---|
public Rule setId(String id)
Setter for property id.
id - Value to set for property id.
Rule to allow for method chaining.public boolean addPackage(String packageName)
Adds a package to the Packages collection.
packageName - String
public String getComment()
Getter for property comment.
public String getId()
Getter for property id.
public Collection<JPackage> getPackages()
Getter for property packages
public boolean equals(Object object)
equals in class ObjectObject.equals(Object)public int hashCode()
hashCode in class ObjectObject.hashCode()public Rule addViolation(JPackage violation)
Add a new violation to this Rule.
violation - String a package this this Rule's package may NOT depend
upon
Rule to allow for method chaining.
IllegalArchitectureRuleException - a RuntimeException when the
violation could not be added because the violation is one of the packages
being checked.public Rule addViolation(String violation)
Add a new violation to this Rule.
violation - String a package this this Rule's package may NOT depend
upon
Rule to allow for method chaining.
IllegalArchitectureRuleException - a RuntimeException when the
violation could not be added because the violation is one of the packages
being checked.public String describe()
Describes the properties of this rule in an xml-like format.
Rule.public String getDescriptionOfRule()
Creates a String representation of this Rule. Useful for
debugging and logging.
public String describePackages()
Creates a String representation of this packages. Useful for debugging and logging.
public Collection<JPackage> getViolations()
Get all of the violations.
Note: this Collection is unmodifiable, use addViolation(com.seventytwomiles.architecturerules.domain.JPackage) and
removeViolation(java.lang.String)
UnsupportedOperationException - when getViolations.add(Object)
or getViolations.remove(Object) is called. Use addViolation(com.seventytwomiles.architecturerules.domain.JPackage) and removeViolation(java.lang.String).public Rule removePackage(String packageName)
Remove a package from this Rule.
packageName - String a package this this Rule's package should not
test on
Rule to allow for method chaining.public Rule removeViolation(String violation)
Remove a violation from this Rule.
violation - String a package this this Rule's package should not
test on
Rule to allow for method chaining.public Rule removeViolation(JPackage violation)
public Rule setComment(String comment)
Setter for property comment.
comment - Value to set for property comment.
Rule to allow for method chaining.public void setIdString(String id)
Same as setId(String). The DigesterConfiguraitonFactory
that builds the Configuration class can invoke void setter.
When we added method chaining at version 2.1.0, we made setId
return Rule, and the configuration factory broke. So this
method was created to allow for the ConfigurationFactory to work, and for
method chaining to be supported.
id - Value to set for property id.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||