Package gov.nist.secauto.oscal.lib.model
Class BackMatter.Resource
java.lang.Object
gov.nist.secauto.oscal.lib.model.BackMatter.Resource
- All Implemented Interfaces:
gov.nist.secauto.metaschema.core.model.IBoundObject
- Enclosing class:
- BackMatter
@MetaschemaAssembly(formalName="Resource",
description="A resource associated with content in the containing document instance. A resource may be directly included in the document using base64 encoding or may point to one or more equivalent internet resources.",
name="resource",
moduleClass=OscalMetadataModule.class,
remarks="A resource can be used in two ways. 1) it may point to an specific retrievable network resource using a `rlink`, or 2) it may be included as an attachment using a `base64`. A resource may contain multiple `rlink` and `base64` entries that represent alternative download locations (rlink) and attachments (base64) for the same resource.\n\nBoth rlink and base64 allow for a `media-type` to be specified, which is used to distinguish between different representations of the same resource (e.g., Microsoft Word, PDF). When multiple `rlink` and `base64` items are included for a given resource, all items must contain equivalent information. This allows the document consumer to choose a preferred item to process based on a the selected item\'s `media-type`. This is extremely important when the items represent OSCAL content that is represented in alternate formats (i.e., XML, JSON, YAML), allowing the same OSCAL data to be processed from any of the available formats indicated by the items.\n\nWhen a resource includes a citation, then the `title` and `citation` properties must both be included.",
valueConstraints=@ValueConstraints(allowedValues={@AllowedValues(level=ERROR,target="prop[has-oscal-namespace(\'http://csrc.nist.gov/ns/oscal\')]/@name",values={@AllowedValue(value="type",description="Identifies the type of resource represented. The most specific appropriate type value SHOULD be used."),@AllowedValue(value="version",description="For resources representing a published document, this represents the version number of that document."),@AllowedValue(value="published",description="For resources representing a published document, this represents the publication date of that document.")}),@AllowedValues(level=ERROR,target="prop[has-oscal-namespace(\'http://csrc.nist.gov/ns/oscal\') and @name=\'type\']/@value",values={@AllowedValue(value="logo",description="Indicates the resource is an organization\'s logo."),@AllowedValue(value="image",description="Indicates the resource represents an image."),@AllowedValue(value="screen-shot",description="Indicates the resource represents an image of screen content."),@AllowedValue(value="law",description="Indicates the resource represents an applicable law."),@AllowedValue(value="regulation",description="Indicates the resource represents an applicable regulation."),@AllowedValue(value="standard",description="Indicates the resource represents an applicable standard."),@AllowedValue(value="external-guidance",description="Indicates the resource represents applicable guidance."),@AllowedValue(value="acronyms",description="Indicates the resource provides a list of relevant acronyms."),@AllowedValue(value="citation",description="Indicates the resource cites relevant information."),@AllowedValue(value="policy",description="Indicates the resource is a policy."),@AllowedValue(value="procedure",description="Indicates the resource is a procedure."),@AllowedValue(value="system-guide",description="Indicates the resource is guidance document related to the subject system of an SSP."),@AllowedValue(value="users-guide",description="Indicates the resource is guidance document a user\'s guide or administrator\'s guide."),@AllowedValue(value="administrators-guide",description="Indicates the resource is guidance document a administrator\'s guide."),@AllowedValue(value="rules-of-behavior",description="Indicates the resource represents rules of behavior content."),@AllowedValue(value="plan",description="Indicates the resource represents a plan."),@AllowedValue(value="artifact",description="Indicates the resource represents an artifact, such as may be reviewed by an assessor."),@AllowedValue(value="evidence",description="Indicates the resource represents evidence, such as to support an assessment finding."),@AllowedValue(value="tool-output",description="Indicates the resource represents output from a tool."),@AllowedValue(value="raw-data",description="Indicates the resource represents machine data, which may require a tool or analysis for interpretation or presentation."),@AllowedValue(value="interview-notes",description="Indicates the resource represents notes from an interview, such as may be collected during an assessment."),@AllowedValue(value="questionnaire",description="Indicates the resource is a set of questions, possibly with responses."),@AllowedValue(value="report",description="Indicates the resource is a report."),@AllowedValue(value="agreement",description="Indicates the resource is a formal agreement between two or more parties.")})},matches=@Matches(level=ERROR,target="prop[has-oscal-namespace(\'http://csrc.nist.gov/ns/oscal\') and @name=\'published\']/@value",typeAdapter=gov.nist.secauto.metaschema.core.datatype.adapter.DateTimeWithTZAdapter.class),expect=@Expect(description="A `title` is required when a `citation` is provided.",level=ERROR,target=".[citation]",test="title")),
modelConstraints=@AssemblyConstraints(unique={@IsUnique(id="unique-resource-rlink-href",description="Ensure that each rlink item references a unique resource.",level=ERROR,target="rlink",keyFields={@KeyField(target="@href"),@KeyField(target="@media-type")}),@IsUnique(id="unique-resource-base64-filename",description="Ensure that all base64 resources have a unique `filename`.",level=ERROR,target="base64",keyFields=@KeyField(target="@filename"))},cardinality=@HasCardinality(description="A resource should provide at least an `rlink` or `base64` object.",level=WARNING,target="rlink|base64",minOccurs=1)))
public static class BackMatter.Resource
extends Object
implements gov.nist.secauto.metaschema.core.model.IBoundObject
A resource associated with content in the containing document instance. A resource may be directly included in the document using base64 encoding or may point to one or more equivalent internet resources.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A resource encoded using the Base64 alphabet defined by RFC 2045.static class
An optional citation consisting of end note text using structured markup.static class
A URL-based pointer to an external resource with an optional hash for verification and change detection. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addDocumentId
(DocumentId item) Add a newDocumentId
item to the underlying collection.boolean
Add a newProperty
item to the underlying collection.boolean
Add a newBackMatter.Resource.Rlink
item to the underlying collection.gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline
gov.nist.secauto.metaschema.core.model.IMetaschemaData
getProps()
gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline
gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine
getTitle()
getUuid()
boolean
removeDocumentId
(DocumentId item) Remove the first matchingDocumentId
item from the underlying collection.boolean
removeProp
(Property item) Remove the first matchingProperty
item from the underlying collection.boolean
Remove the first matchingBackMatter.Resource.Rlink
item from the underlying collection.void
void
void
setDescription
(gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline value) void
setDocumentIds
(List<DocumentId> value) void
void
setRemarks
(gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline value) void
setRlinks
(List<BackMatter.Resource.Rlink> value) void
setTitle
(gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine value) void
toString()
-
Constructor Details
-
Resource
public Resource() -
Resource
-
-
Method Details
-
getMetaschemaData
- Specified by:
getMetaschemaData
in interfacegov.nist.secauto.metaschema.core.model.IBoundObject
-
getUuid
-
setUuid
-
getTitle
-
setTitle
-
getDescription
-
setDescription
-
getProps
-
setProps
-
addProp
Add a newProperty
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeProp
Remove the first matchingProperty
item from the underlying collection.- Parameters:
item
- the item to remove- Returns:
true
if the item was removed orfalse
otherwise
-
getDocumentIds
-
setDocumentIds
-
addDocumentId
Add a newDocumentId
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeDocumentId
Remove the first matchingDocumentId
item from the underlying collection.- Parameters:
item
- the item to remove- Returns:
true
if the item was removed orfalse
otherwise
-
getCitation
-
setCitation
-
getRlinks
-
setRlinks
-
addRlink
Add a newBackMatter.Resource.Rlink
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeRlink
Remove the first matchingBackMatter.Resource.Rlink
item from the underlying collection.- Parameters:
item
- the item to remove- Returns:
true
if the item was removed orfalse
otherwise
-
getBase64
-
setBase64
-
getRemarks
-
setRemarks
-
toString
-