Module dev.metaschema.core
Class ModelTargetedConstraints
java.lang.Object
dev.metaschema.core.model.constraint.AbstractTargetedConstraints<IModelConstrained>
dev.metaschema.core.model.constraint.ModelTargetedConstraints
- All Implemented Interfaces:
IFeatureModelConstrained,IFeatureValueConstrained,IModelConstrained,ITargetedConstraints,IValueConstrained
- Direct Known Subclasses:
AssemblyTargetedConstraints
public class ModelTargetedConstraints
extends AbstractTargetedConstraints<IModelConstrained>
implements IFeatureModelConstrained
Represents a set of constraints targeted at model definitions using Metapath
expressions.
-
Constructor Summary
ConstructorsConstructorDescriptionModelTargetedConstraints(ISource source, Supplier<List<IMetapathExpression>> targets, IModelConstrained constraints) Construct a new set of targeted constraints. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyTo(IModelConstrained definition) Apply the constraints to the provideddefinition.voidtarget(IAssemblyDefinition definition) Apply the constraint to the provided definition.Methods inherited from class dev.metaschema.core.model.constraint.AbstractTargetedConstraints
applyTo, getConstraintSupport, getSource, getTargets, target, target, wrongDefinitionTypeTargetedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.metaschema.core.model.constraint.IFeatureModelConstrained
addConstraint, addConstraint, addConstraint, getConstraintSupport, getHasCardinalityConstraints, getIndexConstraints, getUniqueConstraintsMethods inherited from interface dev.metaschema.core.model.constraint.IFeatureValueConstrained
addConstraint, addConstraint, addConstraint, addConstraint, addConstraint, addLetExpression, getAllowedValuesConstraints, getConstraints, getExpectConstraints, getIndexHasKeyConstraints, getLetExpressions, getMatchesConstraints, getReportConstraintsMethods inherited from interface dev.metaschema.core.model.constraint.IValueConstrained
getSource
-
Constructor Details
-
ModelTargetedConstraints
public ModelTargetedConstraints(@NonNull ISource source, @NonNull Supplier<List<IMetapathExpression>> targets, @NonNull IModelConstrained constraints) Construct a new set of targeted constraints.- Parameters:
source- information about the resource the constraints were sources fromtargets- a supplier to get the Metapath expressions that can be used to find matching targetsconstraints- the constraints to apply to matching targets
-
-
Method Details
-
applyTo
Apply the constraints to the provideddefinition.This will be called when a definition is found that matches the target expression.
- Parameters:
definition- the definition to apply the constraints to.
-
target
Description copied from interface:ITargetedConstraintsApply the constraint to the provided definition.- Specified by:
targetin interfaceITargetedConstraints- Overrides:
targetin classAbstractTargetedConstraints<IModelConstrained>- Parameters:
definition- the definition to apply the constraint to
-