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

@OpenApiAll public class ModelValidationTool extends Tool
Provides ability to access MagicDraw model validation results for analysis purpose.
See Also:
  • Constructor Details

    • ModelValidationTool

      public ModelValidationTool()
  • Method Details

    • validate

      public List<ValidationResult> validate(String suiteName)
      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

      public List<ValidationResult> validate(String suiteName, String severity)
      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

      public List<String> getSuiteNames()
      Return all available suites name.
      Returns:
      the list of available suites name
    • findSuite

      protected Package findSuite(String suiteName)
      Find the suite package from given suite name.
      Parameters:
      suiteName - the suite name
      Returns:
      the suite package.
    • createResult

      protected List<ValidationResult> createResult(Collection<RuleViolationResult> validationResultList)
      Create the wrapper of RuleViolationResult.
      Parameters:
      validationResultList - a list of RuleViolationResult
      Returns:
      a list of ValidationResult