1 package gov.nist.secauto.oscal.lib.model;
2
3 import gov.nist.secauto.metaschema.binding.model.annotations.AllowedValue;
4 import gov.nist.secauto.metaschema.binding.model.annotations.AllowedValues;
5 import gov.nist.secauto.metaschema.binding.model.annotations.BoundFlag;
6 import gov.nist.secauto.metaschema.binding.model.annotations.MetaschemaField;
7 import gov.nist.secauto.metaschema.binding.model.annotations.MetaschemaFieldValue;
8 import gov.nist.secauto.metaschema.binding.model.annotations.ValueConstraints;
9 import gov.nist.secauto.metaschema.model.common.constraint.IConstraint;
10 import gov.nist.secauto.metaschema.model.common.datatype.adapter.UriAdapter;
11 import java.lang.Override;
12 import java.lang.String;
13 import java.net.URI;
14 import org.apache.commons.lang3.builder.MultilineRecursiveToStringStyle;
15 import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
16
17
18
19
20 @MetaschemaField(
21 formalName = "Document Identifier",
22 description = "A document identifier qualified by an identifier `scheme`.",
23 name = "document-id",
24 metaschema = OscalMetadataMetaschema.class,
25 isCollapsible = false
26 )
27 public class DocumentId {
28 @MetaschemaFieldValue(
29 valueKeyName = "identifier"
30 )
31 private String _value;
32
33 @BoundFlag(
34 formalName = "Document Identification Scheme",
35 description = "Qualifies the kind of document identifier using a URI. If the scheme is not provided the value of the element will be interpreted as a string of characters.",
36 useName = "scheme",
37 typeAdapter = UriAdapter.class,
38 remarks = "This value must be an [absolute URI](https://pages.nist.gov/OSCAL/concepts/uri-use/#absolute-uri) that serves as a [naming system identifier](https://pages.nist.gov/OSCAL/concepts/uri-use/#use-as-a-naming-system-identifier)."
39 )
40 @ValueConstraints(
41 allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, allowOthers = true, values = @AllowedValue(value = "http://www.doi.org/", description = "A [Digital Object Identifier](https://www.doi.org/hb.html) (DOI); use is preferred, since this allows for retrieval of a full bibliographic record."))
42 )
43 private URI _scheme;
44
45 public DocumentId() {
46 }
47
48 public String getValue() {
49 return _value;
50 }
51
52 public void setValue(String value) {
53 _value = value;
54 }
55
56 public URI getScheme() {
57 return _scheme;
58 }
59
60 public void setScheme(URI value) {
61 _scheme = value;
62 }
63
64 @Override
65 public String toString() {
66 return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
67 }
68 }