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