java.lang.Object
dev.metaschema.core.model.constraint.AbstractConstraintSet
dev.metaschema.core.model.constraint.MetaConstraintSet
- All Implemented Interfaces:
IConstraintSet
A set of constraints, which are targeted at the contents of a Metaschema
module within specific contexts.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA nestable context, targeted by a set of metapath expressions, to apply constraints within. -
Constructor Summary
ConstructorsConstructorDescriptionMetaConstraintSet(ISource source, List<? extends IConstraintSet> imports, List<MetaConstraintSet.Context> contexts) Construct a new constraint set. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyConstraintsForModule(IModuleNodeItem moduleItem, IModelElementVisitor<ITargetedConstraints, Void> visitor) Apply the constraints associated with this constraint set to the provided module, if applicable.Collection<? extends IConstraintSet>Get constraint sets imported by this constraint set.Methods inherited from class dev.metaschema.core.model.constraint.AbstractConstraintSet
getSource
-
Constructor Details
-
MetaConstraintSet
public MetaConstraintSet(@NonNull ISource source, @NonNull List<? extends IConstraintSet> imports, @NonNull List<MetaConstraintSet.Context> contexts) Construct a new constraint set.- Parameters:
source- the source of the constraint setimports- other constraint sets imported by this setcontexts- the contexts to use for this constraint set
-
-
Method Details
-
getImportedConstraintSets
Description copied from interface:IConstraintSetGet constraint sets imported by this constraint set.- Returns:
- the imported constraint sets
-
applyConstraintsForModule
public void applyConstraintsForModule(IModuleNodeItem moduleItem, IModelElementVisitor<ITargetedConstraints, Void> visitor) Description copied from interface:IConstraintSetApply 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 tovisitor- the visitor used to apply constraints to target definitions
-