public abstract class AbstractRule extends java.lang.Object implements Rule
Modifier and Type | Class and Description |
---|---|
static class |
AbstractRule.AbstractRuleWithSubobjectsAndSkips<T extends UmlObject>
Common superclass where a rule applies to multiple UML object types (e.g., package and
association) and their sub-objects (e.g., association ends) .
|
static class |
AbstractRule.UmlObjectsMissingDoc<T extends UmlObject> |
static class |
AbstractRule.UmlObjectsWithBadCharacterInName<T extends UmlObject> |
static class |
AbstractRule.UmlObjectsWithBadDocEnd<T extends UmlObject> |
static class |
AbstractRule.UmlObjectsWithBadDocStart<T extends UmlObject> |
static class |
AbstractRule.UmlObjectsWithUnallowedStereotype<T extends UmlObject> |
static class |
AbstractRule.UmlObjectsWithUnallowedTagNames<T extends UmlObject> |
Rule.Category, Rule.Severity
Modifier and Type | Field and Description |
---|---|
private Rule.Category |
_category |
private org.apache.log4j.Logger |
_extLogger |
private java.lang.String |
_howToFix |
private java.lang.String |
_hypothesis |
private org.apache.log4j.Level |
_level |
private static org.apache.log4j.Logger |
_logger |
private Rule.Severity |
_severity |
private java.lang.String |
_what |
Modifier | Constructor and Description |
---|---|
protected |
AbstractRule(org.apache.log4j.Logger extLogger,
org.apache.log4j.Level level,
Rule.Severity severity,
Rule.Category category,
java.lang.String hypothesis,
java.lang.String howToFix)
Constructor.
|
private |
AbstractRule(org.apache.log4j.Logger extLogger,
org.apache.log4j.Level level,
Rule.Severity severity,
Rule.Category category,
java.lang.String hypothesis,
java.lang.String howToFix,
java.lang.String what)
Constructor.
|
protected |
AbstractRule(org.apache.log4j.Logger extLogger,
java.lang.String hypothesis,
java.lang.String howToFix)
Constructor; default level is ERROR.
|
Modifier and Type | Method and Description |
---|---|
protected ModelIssue |
createIssue(UmlObject subject) |
protected ModelIssue |
createIssue(UmlObject subject,
java.lang.String evidence) |
protected ModelIssue |
createIssue(UmlObject subject,
java.lang.String evidence,
java.lang.String subjectDescription,
java.lang.String groupTag) |
Rule.Category |
getCategory()
Returns rule category.
|
java.lang.String |
getHowToFix()
Returns the suggestion on how to fix the problem.
|
java.lang.String |
getHypothesis()
Returns what this rule is enforcing (and what was violated).
|
org.apache.log4j.Level |
getLogLevel()
Returns log level to use (likely: related with
Rule.getSeverity() ). |
Rule.Severity |
getSeverity()
Returns severity if this rule is violated.
|
void |
logDiagnosis(boolean verbose,
ModelIssues issues)
Logs the diagnosis.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getApplicability
private static final org.apache.log4j.Logger _logger
private final org.apache.log4j.Logger _extLogger
private final org.apache.log4j.Level _level
private final Rule.Category _category
private final Rule.Severity _severity
private final java.lang.String _hypothesis
private final java.lang.String _howToFix
private final java.lang.String _what
protected AbstractRule(org.apache.log4j.Logger extLogger, java.lang.String hypothesis, java.lang.String howToFix)
extLogger
- logger to use; if null, abstract class logger is used.hypothesis
- non-null, non-empty string to use as a title of logging entries.howToFix
- non-null, non-empty string to use as a title of logging entries.protected AbstractRule(org.apache.log4j.Logger extLogger, org.apache.log4j.Level level, Rule.Severity severity, Rule.Category category, java.lang.String hypothesis, java.lang.String howToFix)
extLogger
- logger to use; if null, abstract class logger is used.level
- logging level; if null, default level is ERROR.severity
- severity; if null, default severity is high.category
- category; if null, default category is modellingRule.hypothesis
- non-null, non-empty string to use as a title of logging entries.howToFix
- non-null, non-empty string to use as a title of logging entries.private AbstractRule(org.apache.log4j.Logger extLogger, org.apache.log4j.Level level, Rule.Severity severity, Rule.Category category, java.lang.String hypothesis, java.lang.String howToFix, java.lang.String what)
extLogger
- logger to use; if null, abstract class logger is used.level
- logging level; if null, default level is ERROR.severity
- severity; if null, default severity is high.category
- category; if null, default category is modellingRule.hypothesis
- non-null, non-empty string to use as a title of logging entries.howToFix
- non-null, non-empty string to use as a title of logging entries.what
- for those rules that apply to different UML elements, this should be the
designation of the UML element to be prepended to the message; null otherwise.public Rule.Category getCategory()
Rule
getCategory
in interface Rule
public Rule.Severity getSeverity()
Rule
getSeverity
in interface Rule
public java.lang.String getHypothesis()
Rule
getHypothesis
in interface Rule
public java.lang.String getHowToFix()
Rule
getHowToFix
in interface Rule
public final void logDiagnosis(boolean verbose, ModelIssues issues)
Rule
logDiagnosis
in interface Rule
verbose
- whether to log on console also validation steps with no errors.issues
- "collecting" parameter, to be filled within the method.public final org.apache.log4j.Level getLogLevel()
Rule
Rule.getSeverity()
).getLogLevel
in interface Rule
protected final ModelIssue createIssue(UmlObject subject)
protected final ModelIssue createIssue(UmlObject subject, java.lang.String evidence)
protected final ModelIssue createIssue(UmlObject subject, java.lang.String evidence, java.lang.String subjectDescription, java.lang.String groupTag)
Copyright 2009-2015 Tatjana (Tanja) Kostic