|
||||||||||
| 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(java.lang.String id)
Instantiates a new Rule with the given id. |
|
Rule(java.lang.String id,
java.lang.String packageName)
Instantiates a new Rule with the given id. |
|
| Method Summary | |
|---|---|
boolean |
addPackage(java.lang.String packageName)
Adds a package to the Packages collection. |
boolean |
addViolation(java.lang.String violation)
Add a new violation to this Rule.
|
java.lang.String |
describe()
Describes the properties of this rule in an xml-like format. |
java.lang.String |
describePackages()
|
boolean |
equals(java.lang.Object object)
|
java.lang.String |
getComment()
Getter for property comment.
|
java.lang.String |
getDescriptionOfRule()
|
java.lang.String |
getId()
Getter for property id.
|
java.util.Collection |
getPackages()
Getter for property packages
|
java.util.Collection |
getViolations()
Get all of the violations. |
int |
hashCode()
|
boolean |
removeViolation(java.lang.String violation)
Remove a violation from this Rule. |
void |
setComment(java.lang.String comment)
Setter for property comment.
|
void |
setId(java.lang.String id)
Setter for property id.
|
| 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(java.lang.String id)
Instantiates a new Rule with the given id.
id - sets the
id
public Rule(java.lang.String id,
java.lang.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
id
packageName - a @packages to assert
on.
| Method Detail |
|---|
public boolean addPackage(java.lang.String packageName)
Adds a package to the Packages collection.
packageName - String
public java.lang.String getComment()
Getter for property
comment.
public void setComment(java.lang.String comment)
Setter for property
comment.
comment - Value to set for property
comment.
public java.lang.String getId()
Getter for property
id.
public void setId(java.lang.String id)
Setter for property
id.
id - Value to set for property id.
public java.util.Collection getPackages()
Getter for property
packages
public boolean equals(java.lang.Object object)
equals in class java.lang.Object
Object.equals(Object)
public int hashCode()
hashCode in class java.lang.Object
Object.hashCode()
public boolean addViolation(java.lang.String violation)
Add a new violation to this Rule.
violation - String a package this this Rule's
package may NOT depend
upon
IllegalArchitectureRuleException
- a RuntimeException when the
violation could not be added because the violation is one of the
packages
being checked.
public java.lang.String describe()
Describes the properties of this rule in an xml-like format.
Rule.
public java.lang.String getDescriptionOfRule()
public java.lang.String describePackages()
public java.util.Collection getViolations()
Get all of the violations.
Note: this Collection is unmodifiable, use
addViolation(java.lang.String)
and
removeViolation(java.lang.String)
java.lang.UnsupportedOperationException - when
getViolations.add(Object)
or getViolations.remove(Object) is called. Use
addViolation(java.lang.String)
and
removeViolation(java.lang.String).
public boolean removeViolation(java.lang.String violation)
Remove a violation from this Rule.
violation - String a package this this Rule's
package should not
test on
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||