001/*
002 * SPDX-FileCopyrightText: none
003 * SPDX-License-Identifier: CC0-1.0
004 */
005
006package gov.nist.secauto.metaschema.databind.model.annotations;
007
008import static java.lang.annotation.ElementType.TYPE;
009import static java.lang.annotation.RetentionPolicy.RUNTIME;
010
011import gov.nist.secauto.metaschema.databind.model.IBoundModule;
012
013import java.lang.annotation.Documented;
014import java.lang.annotation.Retention;
015import java.lang.annotation.Target;
016
017import edu.umd.cs.findbugs.annotations.NonNull;
018
019/**
020 * This annotation indicates that the target class represents a Module assembly.
021 */
022@Documented
023@Retention(RUNTIME)
024@Target(TYPE)
025public @interface MetaschemaAssembly {
026  /**
027   * Get the documentary formal name of the assembly.
028   * <p>
029   * If the value is "##none", then the description will be considered
030   * {@code null}.
031   *
032   * @return a Markdown string or {@code "##none"} if no formal name is provided
033   */
034  @NonNull
035  String formalName() default ModelUtil.NO_STRING_VALUE;
036
037  /**
038   * Get the documentary description of the assembly.
039   * <p>
040   * If the value is "##none", then the description will be considered
041   * {@code null}.
042   *
043   * @return a markdown string or {@code "##none"} if no description is provided
044   */
045  @NonNull
046  String description() default ModelUtil.NO_STRING_VALUE;
047
048  /**
049   * Get the Metaschema module class that "owns" this assembly, which is the
050   * concrete implementation of the module containing the assembly.
051   *
052   * @return the {@link IBoundModule} class
053   */
054  @NonNull
055  Class<? extends IBoundModule> moduleClass();
056
057  /**
058   * Name of the assembly.
059   *
060   * @return the name
061   */
062  @NonNull
063  String name();
064
065  /**
066   * The binary name of the assembly.
067   * <p>
068   * The value {@link Integer#MIN_VALUE} indicates that there is no index.
069   *
070   * @return the index value
071   */
072  int index() default Integer.MIN_VALUE;
073
074  /**
075   * Name of the root XML element or the JSON/YAML property.
076   * <p>
077   * If the value is "##none", then there is no root name.
078   *
079   * @return the name
080   */
081  @NonNull
082  String rootName() default ModelUtil.NO_STRING_VALUE;
083
084  /**
085   * The binary root name of the assembly.
086   * <p>
087   * The value {@link Integer#MIN_VALUE} indicates that there is no root index.
088   *
089   * @return the index value
090   */
091  int rootIndex() default Integer.MIN_VALUE;
092
093  /**
094   * Get any remarks for this assembly.
095   *
096   * @return a markdown string or {@code "##none"} if no remarks are provided
097   */
098  @NonNull
099  String remarks() default ModelUtil.NO_STRING_VALUE;
100
101  /**
102   * Get the value constraints defined for this Metaschema assembly definition.
103   *
104   * @return the value constraints
105   */
106  ValueConstraints valueConstraints() default @ValueConstraints;
107
108  /**
109   * Get the model constraints defined for this Metaschema assembly definition.
110   *
111   * @return the value constraints
112   */
113  AssemblyConstraints modelConstraints() default @AssemblyConstraints;
114}