public abstract class AbstractDesignRule extends Object implements org.designwizard.designrules.Rule
DesignWizard.| Constructor and Description |
|---|
AbstractDesignRule(org.designwizard.api.DesignWizard dw)
Initiates rule properties for software design in instance of the
DesignWizard. |
AbstractDesignRule(org.designwizard.api.DesignWizard dw,
Set<org.designwizard.design.ClassNode> classes)
Initiates rule properties for software design in instance of the
DesignWizard. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addReport(String messages)
Add new errors messages at the report.
|
protected void |
addResultFalse(org.designwizard.design.ClassNode node)
Add a
ClassNode in the set of false results. |
protected void |
addResultTrue(org.designwizard.design.ClassNode node)
Add a
ClassNode in the set of true results. |
protected boolean |
checkClassNodes(Set<org.designwizard.design.ClassNode> classes)
Checks if the parameter belongs to the set of classes of the design
DesignWizard.getAllClasses(). |
abstract boolean |
checkRule()
Checks if the set
getClassNodes() attends the rule. |
Set<org.designwizard.design.ClassNode> |
getClassNodes()
Returns the set of
ClassNode objects where this design rule will be executed. |
protected org.designwizard.api.DesignWizard |
getDesignWizard()
Returns a DesignWizard's instance with the design.
|
protected org.designwizard.design.MethodNode |
getEqualsMethod(org.designwizard.design.ClassNode classNode)
Returns a
MethodNode object that reflects the specified equals method
of the class or superClass represented by ClassNode object. |
protected org.designwizard.design.MethodNode |
getHashCodeMethod(org.designwizard.design.ClassNode classNode)
Returns a
MethodNode object that reflects the specified hashCode method
of the class or superClass represented by ClassNode object. |
protected org.designwizard.design.MethodNode |
getMethod(org.designwizard.design.ClassNode classNode,
String methodName)
Returns a
MethodNode object that reflects the specified method
of the class or interface represented by ClassNode object. |
String |
getName()
Returns the rule's name.
|
org.designwizard.design.ClassNode |
getObjectClass()
ClassNode for represents the
Object class. |
String |
getReport()
The Report with errors messages.
|
Set<org.designwizard.design.ClassNode> |
getResultsFalse()
Returns the set of
ClassNode objects that did not pass the rule. |
Set<org.designwizard.design.ClassNode> |
getResultsTrue()
Returns the set of
ClassNode objects that passed the rule. |
protected boolean |
hasGetMethod(org.designwizard.design.FieldNode fieldNode,
org.designwizard.design.ClassNode entityNode)
Verifies if exists get method for the field.
|
protected boolean |
hasSetMethod(org.designwizard.design.FieldNode fieldNode,
org.designwizard.design.ClassNode entityNode)
Verifies if exists set method for the field.
|
boolean |
isCollection(org.designwizard.design.ClassNode node)
Checks if the classNode implements or inherits from the Collection type of
the Java Collection Framework.
|
boolean |
isEmptyReport()
Checks if the report is empty.
|
boolean |
isList(org.designwizard.design.ClassNode node)
Checks if the classNode implements or inherits from the List type of
the Java Collection Framework.
|
boolean |
isSet(org.designwizard.design.ClassNode node)
Checks if the classNode implements or inherits from the Set type of
the Java Collection Framework.
|
void |
setClassNode(org.designwizard.design.ClassNode classe)
Put a
ClassNode object where this design rule will be executed. |
void |
setClassNodes(Set<org.designwizard.design.ClassNode> classes)
Put a set of
ClassNode objects where this design rule will be executed. |
public AbstractDesignRule(org.designwizard.api.DesignWizard dw)
DesignWizard.dw - The instance of the DesignWizard with the software design.public AbstractDesignRule(org.designwizard.api.DesignWizard dw,
Set<org.designwizard.design.ClassNode> classes)
DesignWizard.dw - The instance of the DesignWizard with the software design.classes - The set of ClassNode that the rule will be executing.public final String getName()
public final org.designwizard.design.ClassNode getObjectClass()
Object class.java.lang.Object.protected final org.designwizard.api.DesignWizard getDesignWizard()
public abstract boolean checkRule()
getClassNodes() attends the rule.checkRule in interface org.designwizard.designrules.RuleRule.checkRule()public final Set<org.designwizard.design.ClassNode> getResultsTrue()
ClassNode objects that passed the rule.ClassNode objects or set empty.public final Set<org.designwizard.design.ClassNode> getResultsFalse()
ClassNode objects that did not pass the rule.ClassNode objects or set empty.protected final void addResultTrue(org.designwizard.design.ClassNode node)
ClassNode in the set of true results.node - The classNode that passed the rule.protected final void addResultFalse(org.designwizard.design.ClassNode node)
ClassNode in the set of false results.node - The classNode that did not pass the rule.protected final boolean hasSetMethod(org.designwizard.design.FieldNode fieldNode,
org.designwizard.design.ClassNode entityNode)
fieldNode - The field contained in the class.entityNode - Entity that contains the field.protected final boolean hasGetMethod(org.designwizard.design.FieldNode fieldNode,
org.designwizard.design.ClassNode entityNode)
fieldNode - The field contained in the class.entityNode - Entity that contains the field.public final Set<org.designwizard.design.ClassNode> getClassNodes()
ClassNode objects where this design rule will be executed.ClassNode objects or set empty.public final void setClassNodes(Set<org.designwizard.design.ClassNode> classes)
ClassNode objects where this design rule will be executed.classes - A set of ClassNode objects.public final void setClassNode(org.designwizard.design.ClassNode classe)
ClassNode object where this design rule will be executed.classe - A ClassNode objects where this design rule will be executed.protected final boolean checkClassNodes(Set<org.designwizard.design.ClassNode> classes)
DesignWizard.getAllClasses().classes - The set of classNodes to check the pertinence.null
or DesignWizard.getAllClasses() is null.public final String getReport()
getReport in interface org.designwizard.designrules.Rulepublic final boolean isEmptyReport()
protected final void addReport(String messages)
messages - A string with errors messages.public final boolean isCollection(org.designwizard.design.ClassNode node)
node - A classNode.public final boolean isSet(org.designwizard.design.ClassNode node)
node - A classNode.public final boolean isList(org.designwizard.design.ClassNode node)
node - A classNode.protected final org.designwizard.design.MethodNode getMethod(org.designwizard.design.ClassNode classNode,
String methodName)
MethodNode object that reflects the specified method
of the class or interface represented by ClassNode object.
The name parameter is a String specifying the simple
name of the desired method.classNode - the ClassNode object that reflects the specified method.methodName - the method name.MethodNode object of this class specified by
name or null if a method with the specified name is not found.protected final org.designwizard.design.MethodNode getEqualsMethod(org.designwizard.design.ClassNode classNode)
MethodNode object that reflects the specified equals method
of the class or superClass represented by ClassNode object.classNode - the ClassNode object that reflects the specified method.MethodNode object of this class specified by
name or null if a method with the specified name is not found.protected final org.designwizard.design.MethodNode getHashCodeMethod(org.designwizard.design.ClassNode classNode)
MethodNode object that reflects the specified hashCode method
of the class or superClass represented by ClassNode object.classNode - the ClassNode object that reflects the specified method.MethodNode object of this class specified by
name or null if a method with the specified name is not found.Copyright © 2016. All rights reserved.