ImportComponentDefinition.java

package gov.nist.secauto.oscal.lib.model;

import gov.nist.secauto.metaschema.core.datatype.adapter.UriReferenceAdapter;
import gov.nist.secauto.metaschema.core.model.IBoundObject;
import gov.nist.secauto.metaschema.core.model.IMetaschemaData;
import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag;
import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly;
import java.lang.Override;
import java.lang.String;
import java.net.URI;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * Loads a component definition from another resource.
 */
@MetaschemaAssembly(
    formalName = "Import Component Definition",
    description = "Loads a component definition from another resource.",
    name = "import-component-definition",
    moduleClass = OscalComponentDefinitionModule.class
)
public class ImportComponentDefinition implements IBoundObject {
  private final IMetaschemaData __metaschemaData;

  /**
   * "A link to a resource that defines a set of components and/or capabilities to import into this collection."
   */
  @BoundFlag(
      formalName = "Hyperlink Reference",
      description = "A link to a resource that defines a set of components and/or capabilities to import into this collection.",
      name = "href",
      required = true,
      typeAdapter = UriReferenceAdapter.class,
      remarks = "This value may be one of:\n"
              + "\n"
              + "1. an [absolute URI](https://pages.nist.gov/OSCAL/concepts/uri-use/#absolute-uri) that points to a network resolvable resource,\n"
              + "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"
              + "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))."
  )
  private URI _href;

  public ImportComponentDefinition() {
    this(null);
  }

  public ImportComponentDefinition(IMetaschemaData data) {
    this.__metaschemaData = data;
  }

  @Override
  public IMetaschemaData getMetaschemaData() {
    return __metaschemaData;
  }

  public URI getHref() {
    return _href;
  }

  public void setHref(URI value) {
    _href = value;
  }

  @Override
  public String toString() {
    return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString();
  }
}