1 /*
2 * SPDX-FileCopyrightText: none
3 * SPDX-License-Identifier: CC0-1.0
4 */
5
6 package gov.nist.secauto.metaschema.core.model.constraint;
7
8 import gov.nist.secauto.metaschema.core.metapath.IMetapathExpression;
9 import gov.nist.secauto.metaschema.core.model.IAssemblyDefinition;
10 import gov.nist.secauto.metaschema.core.model.IFieldDefinition;
11 import gov.nist.secauto.metaschema.core.model.IFlagDefinition;
12
13 import java.util.List;
14
15 import edu.umd.cs.findbugs.annotations.NonNull;
16
17 /**
18 * Represents a set of constraints that target a given definition using a target
19 * Metapath expression.
20 */
21 public interface ITargetedConstraints extends IValueConstrained {
22 /**
23 * Get the Metapath expressions used to identify the targets of the constraint.
24 *
25 * @return the Metapath expressions identifying the targets of the associated
26 * constraints
27 */
28 @NonNull
29 List<IMetapathExpression> getTargets();
30
31 /**
32 * Apply the constraint to the provided definition.
33 *
34 * @param definition
35 * the definition to apply the constraint to
36 */
37 void target(@NonNull IFlagDefinition definition);
38
39 /**
40 * Apply the constraint to the provided definition.
41 *
42 * @param definition
43 * the definition to apply the constraint to
44 */
45 void target(@NonNull IFieldDefinition definition);
46
47 /**
48 * Apply the constraint to the provided definition.
49 *
50 * @param definition
51 * the definition to apply the constraint to
52 */
53 void target(@NonNull IAssemblyDefinition definition);
54 }