T
- public abstract class AbstractValidator<T extends UmlObject>
extends java.lang.Object
Rule
-s.
This class controls the execution of validation with respect to:
Config.isValidationAssociationsOn()
), one per validator type. Setting one of these to
false at configuration disables validation for all the rules for that type of element (for this
example, all rules validating associations).Config.getValidationRulesOff()
Violated rules on UML objects from the model produce issues, and they can be logged and reported.
Modifier | Constructor and Description |
---|---|
protected |
AbstractValidator(Config cfg,
int totalCount,
java.lang.String which,
ModelIssues issues)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
addCrossRule(CrossRule<T> crossRule) |
protected boolean |
addSimpleRule(SimpleRule<T> simpleRule) |
java.lang.String |
displayAllAvailableRuleNames()
Returns the list of strings, including heading, suitable for logging.
|
java.lang.String |
displayAvailableRuleNames(Nature nature)
Returns flattened list of strings, including heading, with new line character as separator;
suitable for pasting into a document (e.g., CIM model management or 61850 UML model
management document).
|
abstract boolean |
enabled()
Returns whether the validation for this validator has been enabled (by configuration).
|
java.util.List<CrossRule<T>> |
getAllCrossRules()
Returns all cross rules available.
|
java.util.List<org.tanjakostic.jcleancim.validation.Rule> |
getAllRules() |
java.util.List<SimpleRule<T>> |
getAllSimpleRules()
Returns all simple rules available.
|
Config |
getCfg()
Returns configuration.
|
java.util.List<CrossRule<T>> |
getCheckedCrossRules()
Returns only checked (non-disabled) cross rules.
|
java.util.List<org.tanjakostic.jcleancim.validation.Rule> |
getCheckedRules() |
java.util.List<SimpleRule<T>> |
getCheckedSimpleRules()
Returns only checked (non-disabled) simple rules.
|
ModelIssues |
getCollectedIssues() |
abstract java.util.List<T> |
getScopedUmlObjects()
Returns the elements retained for validation, for the configured scope.
|
void |
validate()
If validation has been enabled in the configuration for the type T of element, performs
validation according to (in the configuration) non-disabled individual rules, and logs
diagnosis.
|
protected AbstractValidator(Config cfg, int totalCount, java.lang.String which, ModelIssues issues)
cfg
- configurationtotalCount
- total count of elements in the modelwhich
- kind of element - used only for loggingissues
- home for issues that get collected through validationprotected final boolean addSimpleRule(SimpleRule<T> simpleRule)
public final Config getCfg()
public ModelIssues getCollectedIssues()
public final void validate()
public abstract boolean enabled()
public abstract java.util.List<T> getScopedUmlObjects()
public final java.util.List<org.tanjakostic.jcleancim.validation.Rule> getCheckedRules()
public final java.util.List<org.tanjakostic.jcleancim.validation.Rule> getAllRules()
public final java.util.List<SimpleRule<T>> getCheckedSimpleRules()
public final java.util.List<CrossRule<T>> getCheckedCrossRules()
public final java.util.List<SimpleRule<T>> getAllSimpleRules()
public final java.util.List<CrossRule<T>> getAllCrossRules()
public java.lang.String displayAllAvailableRuleNames()
public java.lang.String displayAvailableRuleNames(Nature nature)
If nature
is null, then vistis simply all the rules, without concern about their
applicability per nature.
Copyright 2009-2016 Tatjana (Tanja) Kostic