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