001package gov.nist.secauto.oscal.lib.model; 002 003import gov.nist.secauto.metaschema.core.datatype.adapter.UriAdapter; 004import gov.nist.secauto.metaschema.core.model.IBoundObject; 005import gov.nist.secauto.metaschema.core.model.IMetaschemaData; 006import gov.nist.secauto.metaschema.core.model.constraint.IConstraint; 007import gov.nist.secauto.metaschema.databind.model.annotations.AllowedValue; 008import gov.nist.secauto.metaschema.databind.model.annotations.AllowedValues; 009import gov.nist.secauto.metaschema.databind.model.annotations.BoundFieldValue; 010import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag; 011import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaField; 012import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints; 013import java.lang.Override; 014import java.lang.String; 015import java.net.URI; 016import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 017import org.apache.commons.lang3.builder.ToStringStyle; 018 019/** 020 * A document identifier qualified by an identifier <code>scheme</code>. 021 */ 022@MetaschemaField( 023 formalName = "Document Identifier", 024 description = "A document identifier qualified by an identifier `scheme`.", 025 name = "document-id", 026 moduleClass = OscalMetadataModule.class 027) 028public class DocumentId implements IBoundObject { 029 private final IMetaschemaData __metaschemaData; 030 031 /** 032 * "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." 033 */ 034 @BoundFlag( 035 formalName = "Document Identification Scheme", 036 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.", 037 name = "scheme", 038 typeAdapter = UriAdapter.class, 039 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).", 040 valueConstraints = @ValueConstraints(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."))) 041 ) 042 private URI _scheme; 043 044 @BoundFieldValue( 045 valueKeyName = "identifier" 046 ) 047 private String _identifier; 048 049 public DocumentId() { 050 this(null); 051 } 052 053 public DocumentId(IMetaschemaData data) { 054 this.__metaschemaData = data; 055 } 056 057 @Override 058 public IMetaschemaData getMetaschemaData() { 059 return __metaschemaData; 060 } 061 062 public URI getScheme() { 063 return _scheme; 064 } 065 066 public void setScheme(URI value) { 067 _scheme = value; 068 } 069 070 public String getIdentifier() { 071 return _identifier; 072 } 073 074 public void setIdentifier(String value) { 075 _identifier = value; 076 } 077 078 @Override 079 public String toString() { 080 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 081 } 082}