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 * An optional set of associated properties. 095 * 096 * @return the properties or an empty array with no properties 097 */ 098 Property[] properties() default {}; 099 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}