1   /*
2    * SPDX-FileCopyrightText: none
3    * SPDX-License-Identifier: CC0-1.0
4    */
5   
6   package gov.nist.secauto.metaschema.databind.model.annotations;
7   
8   import static java.lang.annotation.ElementType.TYPE;
9   import static java.lang.annotation.RetentionPolicy.RUNTIME;
10  
11  import gov.nist.secauto.metaschema.databind.model.IBoundModule;
12  
13  import java.lang.annotation.Documented;
14  import java.lang.annotation.Retention;
15  import java.lang.annotation.Target;
16  
17  import edu.umd.cs.findbugs.annotations.NonNull;
18  
19  /**
20   * This annotation indicates that the target class represents a Module assembly.
21   */
22  @Documented
23  @Retention(RUNTIME)
24  @Target(TYPE)
25  public @interface MetaschemaAssembly {
26    /**
27     * Get the documentary formal name of the assembly.
28     * <p>
29     * If the value is "##none", then the description will be considered
30     * {@code null}.
31     *
32     * @return a Markdown string or {@code "##none"} if no formal name is provided
33     */
34    @NonNull
35    String formalName() default ModelUtil.NO_STRING_VALUE;
36  
37    /**
38     * Get the documentary description of the assembly.
39     * <p>
40     * If the value is "##none", then the description will be considered
41     * {@code null}.
42     *
43     * @return a markdown string or {@code "##none"} if no description is provided
44     */
45    @NonNull
46    String description() default ModelUtil.NO_STRING_VALUE;
47  
48    /**
49     * Get the Metaschema module class that "owns" this assembly, which is the
50     * concrete implementation of the module containing the assembly.
51     *
52     * @return the {@link IBoundModule} class
53     */
54    @NonNull
55    Class<? extends IBoundModule> moduleClass();
56  
57    /**
58     * Name of the assembly.
59     *
60     * @return the name
61     */
62    @NonNull
63    String name();
64  
65    /**
66     * The binary name of the assembly.
67     * <p>
68     * The value {@link Integer#MIN_VALUE} indicates that there is no index.
69     *
70     * @return the index value
71     */
72    int index() default Integer.MIN_VALUE;
73  
74    /**
75     * Name of the root XML element or the JSON/YAML property.
76     * <p>
77     * If the value is "##none", then there is no root name.
78     *
79     * @return the name
80     */
81    @NonNull
82    String rootName() default ModelUtil.NO_STRING_VALUE;
83  
84    /**
85     * The binary root name of the assembly.
86     * <p>
87     * The value {@link Integer#MIN_VALUE} indicates that there is no root index.
88     *
89     * @return the index value
90     */
91    int rootIndex() default Integer.MIN_VALUE;
92  
93    /**
94     * An optional set of associated properties.
95     *
96     * @return the properties or an empty array with no properties
97     */
98    Property[] properties() default {};
99  
100   /**
101    * Get any remarks for this assembly.
102    *
103    * @return a markdown string or {@code "##none"} if no remarks are provided
104    */
105   @NonNull
106   String remarks() default ModelUtil.NO_STRING_VALUE;
107 
108   /**
109    * Get the value constraints defined for this Metaschema assembly definition.
110    *
111    * @return the value constraints
112    */
113   ValueConstraints valueConstraints() default @ValueConstraints;
114 
115   /**
116    * Get the model constraints defined for this Metaschema assembly definition.
117    *
118    * @return the value constraints
119    */
120   AssemblyConstraints modelConstraints() default @AssemblyConstraints;
121 }