T
- public abstract static class AbstractRule.AbstractRuleWithSubobjectsAndSkips<T extends UmlObject> extends AbstractRule implements SimpleRule<T>
skipValidation(UmlObject)
and/or
skipSubobjectValidation(UmlObject)
. This is necessary in particular for complex
IEC61850 models, to avoid lots of noise where e.g. we don't care about a doc for something
that is just a modelling artefact, but not really part of the official specification.Modifier and Type | Class and Description |
---|---|
static class |
Rule.Category
Category of the rule; usefull to classify problems.
|
static class |
Rule.Severity
How severe the violation of this rule is; useful to prioritise problems.
|
AbstractRule.AbstractRuleWithSubobjectsAndSkips<T extends UmlObject>, AbstractRule.UmlObjectsMissingDoc<T extends UmlObject>, AbstractRule.UmlObjectsWithBadCharacterInName<T extends UmlObject>, AbstractRule.UmlObjectsWithBadDocEnd<T extends UmlObject>, AbstractRule.UmlObjectsWithBadDocStart<T extends UmlObject>, AbstractRule.UmlObjectsWithUnallowedStereotype<T extends UmlObject>, AbstractRule.UmlObjectsWithUnallowedTagNames<T extends UmlObject>
Modifier | Constructor and Description |
---|---|
protected |
AbstractRuleWithSubobjectsAndSkips(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) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
doValidate(UmlObject o,
ModelIssues issues) |
java.util.EnumSet<Nature> |
getApplicability()
Returns all the natures of model elements for which the rule is applicable.
|
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
getSeverity() ). |
Rule.Severity |
getSeverity()
Returns severity if this rule is violated.
|
protected java.util.List<UmlObject> |
getSubObjects(T o)
Used for validation of "sub-objects" (such as association ends and operation parameters)
that do not have their own validators, but get validated through their container.
|
void |
logDiagnosis(boolean verbose,
ModelIssues issues)
Logs the diagnosis.
|
protected boolean |
skipSubobjectValidation(T o)
This default implementation returns false (no skipping); override if sub-objects don't
need validation.
|
protected boolean |
skipValidation(T o)
This default implementation returns false (no skipping); override if main object doesn't
need validation.
|
void |
validate(T o,
ModelIssues issues)
Applies the validation criteria to
obj , and creates problems for invalid ones
and adds them to toCollect . |
createIssue, createIssue, createIssue, getCategory, getHowToFix, getHypothesis, getLogLevel, getSeverity, logDiagnosis
protected AbstractRuleWithSubobjectsAndSkips(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)
public final void validate(T o, ModelIssues issues)
SimpleRule
obj
, and creates problems for invalid ones
and adds them to toCollect
.validate
in interface SimpleRule<T extends UmlObject>
protected abstract void doValidate(UmlObject o, ModelIssues issues)
protected java.util.List<UmlObject> getSubObjects(T o)
This default implementation returns empty list; subtypes having contained objects that need to be validated against this rule have to override this method.
protected boolean skipSubobjectValidation(T o)
protected boolean skipValidation(T o)
public Rule.Category getCategory()
public Rule.Severity getSeverity()
public java.lang.String getHypothesis()
public java.lang.String getHowToFix()
public void logDiagnosis(boolean verbose, ModelIssues issues)
verbose
- whether to log on console also validation steps with no errors.issues
- "collecting" parameter, to be filled within the method.public org.apache.log4j.Level getLogLevel()
getSeverity()
).public java.util.EnumSet<Nature> getApplicability()
Copyright 2009-2016 Tatjana (Tanja) Kostic