Package com.nomagic.reportwizard.tools
Class ModelValidationTool
java.lang.Object
java.util.Observable
com.nomagic.magicreport.engine.Tool
com.nomagic.reportwizard.tools.ModelValidationTool
- All Implemented Interfaces:
ITool,IVariable,Serializable,Cloneable
Provides ability to access MagicDraw model validation results for analysis purpose.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.nomagic.magicreport.engine.ITool
ITool.HTMLString, ITool.RetainedString, ITool.Void -
Field Summary
Fields inherited from class com.nomagic.magicreport.engine.Tool
context, properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<ValidationResult> createResult(Collection<RuleViolationResult> validationResultList) Create the wrapper of RuleViolationResult.protected PackageFind the suite package from given suite name.Return all available suites name.Validate model from suite name.Validate model from suite name and severity.validate(String suiteName, Collection<Element> elements, String severity) Validate model from suite name, element and severity.validate(String suiteName, Collection<Element> elements, String severity, boolean excludeReadOnly) Validate model from suite name, element and severity.Methods inherited from class com.nomagic.magicreport.engine.Tool
clone, getContext, getProperties, getProperty, getProperty, notifyObservers, setContext, setPropertiesMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, setChanged
-
Constructor Details
-
ModelValidationTool
public ModelValidationTool()
-
-
Method Details
-
validate
Validate model from suite name. This method will validate whole project and use severity "debug" as default.- Parameters:
suiteName- the name of validation suite.- Returns:
- model validation result.
-
validate
Validate model from suite name and severity. This method will validate whole project.- Parameters:
suiteName- the name of validation suite.severity- the severity, choose the value from "debug", "info", "warning", "error" and "fatal"- Returns:
- model validation result.
-
validate
public List<ValidationResult> validate(String suiteName, Collection<Element> elements, String severity) Validate model from suite name, element and severity.- Parameters:
suiteName- the name of validation suite.elements- the list of Element to be validated.severity- the severity, choose the value from "debug", "info", "warning", "error" and "fatal"- Returns:
- model validation result.
-
validate
public List<ValidationResult> validate(String suiteName, Collection<Element> elements, String severity, boolean excludeReadOnly) Validate model from suite name, element and severity.- Parameters:
suiteName- the name of validation suite.elements- the list of Element to be validated.severity- the severity, choose the value from "debug", "info", "warning", "error" and "fatal"excludeReadOnly- true to exclude elements from read-only used projects from validation scope- Returns:
- model validation result.
-
getSuiteNames
Return all available suites name.- Returns:
- the list of available suites name
-
findSuite
Find the suite package from given suite name.- Parameters:
suiteName- the suite name- Returns:
- the suite package.
-
createResult
Create the wrapper of RuleViolationResult.- Parameters:
validationResultList- a list of RuleViolationResult- Returns:
- a list of
ValidationResult
-