1 /*
2 * SPDX-FileCopyrightText: none
3 * SPDX-License-Identifier: CC0-1.0
4 */
5
6 package gov.nist.secauto.oscal.lib.profile.resolver.policy;
7
8 import edu.umd.cs.findbugs.annotations.NonNull;
9
10 public interface ICustomReferencePolicy<TYPE> extends IReferencePolicy<TYPE> {
11
12 /**
13 * Get the parser to use to parse an entity identifier from the reference text.
14 *
15 * @return the parser
16 */
17 @NonNull
18 IIdentifierParser getIdentifierParser();
19
20 /**
21 * Retrieve the reference text from the {@code reference} object.
22 *
23 * @param reference
24 * the reference object
25 * @return the reference text or {@code null} if there is no text
26 */
27 String getReferenceText(@NonNull TYPE reference);
28
29 /**
30 * Update the reference text used in the {@code reference} object.
31 *
32 * @param reference
33 * the reference object
34 * @param newReferenceText
35 * the reference text replacement
36 */
37 void setReferenceText(@NonNull TYPE reference, @NonNull String newReferenceText);
38 }