1
2
3
4
5
6 package gov.nist.secauto.oscal.lib.profile.resolver.policy;
7
8 import gov.nist.secauto.oscal.lib.profile.resolver.ProfileResolutionEvaluationException;
9
10 import edu.umd.cs.findbugs.annotations.NonNull;
11 import edu.umd.cs.findbugs.annotations.Nullable;
12
13 public interface IIdentifierParser {
14 @NonNull
15 IIdentifierParser FRAGMENT_PARSER = new PatternIdentifierParser("^#([^#]+)(?:#.*)?$", 1);
16 @NonNull
17 IIdentifierParser IDENTITY_PARSER = new IIdentifierParser() {
18
19 @Override
20 public String parse(@NonNull String reference) {
21 return reference;
22 }
23
24 @Override
25 public String update(@NonNull String reference, @NonNull String newIdentifier) {
26 return newIdentifier;
27 }
28 };
29
30
31
32
33
34
35
36
37 @Nullable
38 String parse(@NonNull String referenceText);
39
40
41
42
43
44
45
46
47
48
49
50
51
52 @NonNull
53 String update(@NonNull String referenceText, @NonNull String newIdentifier);
54 }