Interface IConstraintSet

All Known Implementing Classes:
AbstractConstraintSet, MetaConstraintSet, ScopedConstraintSet

public interface IConstraintSet
A set of constraints targeted at the contents of a Metaschema module.
  • Method Details

    • getSource

      @NonNull ISource getSource()
      Get information about where the constraint set was sourced from.
      Returns:
      the source information
    • getImportedConstraintSets

      @NonNull Collection<? extends IConstraintSet> getImportedConstraintSets()
      Get constraint sets imported by this constraint set.
      Returns:
      the imported constraint sets
    • applyConstraintsForModule

      void applyConstraintsForModule(@NonNull IModuleNodeItem moduleItem, @NonNull IModelElementVisitor<ITargetedConstraints,Void> visitor)
      Apply the constraints associated with this constraint set to the provided module, if applicable.

      Callers of this method are required to track which definitions have been previously targeted based on the result of this method and to provide these to subsequent calls of this method targeting different modules. This approach ensures that a given constraint is not applied more than once.

      Parameters:
      moduleItem - the module node item to apply applicable constraints to
      visitor - the visitor used to apply constraints to target definitions