001// Generated from: ../../../../../../../../oscal/src/metaschema/oscal_component_metaschema.xml
002// Do not edit - changes will be lost when regenerated.
003package dev.metaschema.oscal.lib.model;
004
005import dev.metaschema.core.datatype.adapter.UriReferenceAdapter;
006import dev.metaschema.core.model.IBoundObject;
007import dev.metaschema.core.model.IMetaschemaData;
008import dev.metaschema.core.util.ObjectUtils;
009import dev.metaschema.databind.model.annotations.BoundFlag;
010import dev.metaschema.databind.model.annotations.MetaschemaAssembly;
011import edu.umd.cs.findbugs.annotations.NonNull;
012import java.net.URI;
013import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
014import org.apache.commons.lang3.builder.ToStringStyle;
015
016/**
017 * Loads a component definition from another resource.
018 */
019@MetaschemaAssembly(
020    formalName = "Import Component Definition",
021    description = "Loads a component definition from another resource.",
022    name = "import-component-definition",
023    moduleClass = OscalComponentDefinitionModule.class
024)
025public class ImportComponentDefinition implements IBoundObject {
026  private final IMetaschemaData __metaschemaData;
027
028  /**
029   * A link to a resource that defines a set of components and/or capabilities to import into this collection.
030   */
031  @BoundFlag(
032      formalName = "Hyperlink Reference",
033      description = "A link to a resource that defines a set of components and/or capabilities to import into this collection.",
034      name = "href",
035      required = true,
036      typeAdapter = UriReferenceAdapter.class,
037      remarks = "This value may be one of:\n"
038              + "\n"
039              + "1. an [absolute URI](https://pages.nist.gov/OSCAL/concepts/uri-use/#absolute-uri) that points to a network resolvable resource,\n"
040              + "2. a [relative reference](https://pages.nist.gov/OSCAL/concepts/uri-use/#relative-reference) pointing to a network resolvable resource whose base URI is the URI of the containing document, or\n"
041              + "3. a bare URI fragment (i.e., \\`#uuid\\`) pointing to a `back-matter` resource in this or an imported document (see [linking to another OSCAL object](https://pages.nist.gov/OSCAL/concepts/uri-use/#linking-to-another-oscal-object))."
042  )
043  private URI _href;
044
045  /**
046   * Constructs a new {@code dev.metaschema.oscal.lib.model.ImportComponentDefinition} instance with no metadata.
047   */
048  public ImportComponentDefinition() {
049    this(null);
050  }
051
052  /**
053   * Constructs a new {@code dev.metaschema.oscal.lib.model.ImportComponentDefinition} instance with the specified metadata.
054   *
055   * @param data
056   *           the metaschema data, or {@code null} if none
057   */
058  public ImportComponentDefinition(IMetaschemaData data) {
059    this.__metaschemaData = data;
060  }
061
062  @Override
063  public IMetaschemaData getMetaschemaData() {
064    return __metaschemaData;
065  }
066
067  /**
068   * Get the "{@literal Hyperlink Reference}".
069   *
070   * <p>
071   * A link to a resource that defines a set of components and/or capabilities to import into this collection.
072   *
073   * @return the href value
074   */
075  @NonNull
076  public URI getHref() {
077    return _href;
078  }
079
080  /**
081   * Set the "{@literal Hyperlink Reference}".
082   *
083   * <p>
084   * A link to a resource that defines a set of components and/or capabilities to import into this collection.
085   *
086   * @param value
087   *           the href value to set
088   */
089  public void setHref(@NonNull URI value) {
090    _href = value;
091  }
092
093  @Override
094  public String toString() {
095    return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString());
096  }
097}