Package com.nomagic.magicdraw.validation
Interface ElementValidationRuleImpl
-
- All Known Implementing Classes:
DefaultValidationRuleImpl
@OpenApiAll public interface ElementValidationRuleImpl
Defines an interface for all validation rules which works with validation of model elements.
NOTE: Implementations of this interface MUST have a default no-arg constructor.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
dispose()
This method will be invoked when instance of theElementValidationRuleImpl
will become no longer needed.default void
init(Project project, Constraint constraint)
This is the first method that is invoked on the implementation of theElementValidationRuleImpl
interface.default void
postRun(Project project, Constraint constraint)
This method is invoked after run methoddefault void
preRun(Project project, Constraint constraint)
This method is invoked before run methodjava.util.Set<Annotation>
run(Project project, Constraint constraint, java.util.Collection<? extends Element> elements)
Implementation of the method should perform validating of the specified model elements using specified constraint.
-
-
-
Method Detail
-
init
default void init(Project project, Constraint constraint)
This is the first method that is invoked on the implementation of theElementValidationRuleImpl
interface. Implementation can initialize internal state if required.- Parameters:
project
- a project of the constraint.constraint
- a constraint object.
-
preRun
default void preRun(Project project, Constraint constraint)
This method is invoked before run method- Parameters:
project
- a project of the constraint.constraint
- a constraint object.
-
postRun
default void postRun(Project project, Constraint constraint)
This method is invoked after run method- Parameters:
project
- a project of the constraint.constraint
- a constraint object.
-
run
java.util.Set<Annotation> run(Project project, Constraint constraint, java.util.Collection<? extends Element> elements)
Implementation of the method should perform validating of the specified model elements using specified constraint. The method returns a set ofAnnotation
objects that specifies information about invalid elements.- Parameters:
project
- a project of the constraint.constraint
- constraint which defines validation rules.elements
- collection of elements that have to be validated.- Returns:
- collection of
Annotation
objects that describes violations of the rule.
-
dispose
default void dispose()
This method will be invoked when instance of theElementValidationRuleImpl
will become no longer needed.
-
-