001package com.example.metaschema;
002
003import gov.nist.secauto.metaschema.core.datatype.adapter.NonNegativeIntegerAdapter;
004import gov.nist.secauto.metaschema.core.datatype.adapter.PositiveIntegerAdapter;
005import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter;
006import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter;
007import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine;
008import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter;
009import gov.nist.secauto.metaschema.core.model.IBoundObject;
010import gov.nist.secauto.metaschema.core.model.IMetaschemaData;
011import gov.nist.secauto.metaschema.core.model.JsonGroupAsBehavior;
012import gov.nist.secauto.metaschema.core.model.constraint.IConstraint;
013import gov.nist.secauto.metaschema.core.util.ObjectUtils;
014import gov.nist.secauto.metaschema.databind.model.annotations.AllowedValue;
015import gov.nist.secauto.metaschema.databind.model.annotations.AllowedValues;
016import gov.nist.secauto.metaschema.databind.model.annotations.BoundAssembly;
017import gov.nist.secauto.metaschema.databind.model.annotations.BoundChoiceGroup;
018import gov.nist.secauto.metaschema.databind.model.annotations.BoundField;
019import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag;
020import gov.nist.secauto.metaschema.databind.model.annotations.BoundGroupedAssembly;
021import gov.nist.secauto.metaschema.databind.model.annotations.Matches;
022import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly;
023import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints;
024import java.lang.Object;
025import java.lang.Override;
026import java.lang.String;
027import java.math.BigInteger;
028import java.util.LinkedList;
029import java.util.List;
030import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
031import org.apache.commons.lang3.builder.ToStringStyle;
032
033@MetaschemaAssembly(
034    name = "assembly-model",
035    moduleClass = MetaschemaModelModule.class
036)
037public class AssemblyModel implements IBoundObject {
038  private final IMetaschemaData __metaschemaData;
039
040  @BoundChoiceGroup(
041      maxOccurs = -1,
042      assemblies = {
043          @BoundGroupedAssembly(formalName = "Assembly Reference", useName = "assembly", binding = AssemblyReference.class),
044          @BoundGroupedAssembly(formalName = "Inline Assembly Definition", useName = "define-assembly", binding = InlineDefineAssembly.class),
045          @BoundGroupedAssembly(formalName = "Field Reference", useName = "field", binding = FieldReference.class),
046          @BoundGroupedAssembly(formalName = "Inline Field Definition", useName = "define-field", binding = InlineDefineField.class),
047          @BoundGroupedAssembly(formalName = "Choice", useName = "choice", binding = Choice.class),
048          @BoundGroupedAssembly(formalName = "Choice Grouping", useName = "choice-group", binding = ChoiceGroup.class)
049      },
050      groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "instances", inJson = JsonGroupAsBehavior.LIST)
051  )
052  private List<Object> _instances;
053
054  @BoundAssembly(
055      formalName = "Any Additional Content",
056      useName = "any"
057  )
058  private Any _any;
059
060  public AssemblyModel() {
061    this(null);
062  }
063
064  public AssemblyModel(IMetaschemaData data) {
065    this.__metaschemaData = data;
066  }
067
068  @Override
069  public IMetaschemaData getMetaschemaData() {
070    return __metaschemaData;
071  }
072
073  public List<Object> getInstances() {
074    return _instances;
075  }
076
077  public void setInstances(List<Object> value) {
078    _instances = value;
079  }
080
081  public Any getAny() {
082    return _any;
083  }
084
085  public void setAny(Any value) {
086    _any = value;
087  }
088
089  @Override
090  public String toString() {
091    return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString();
092  }
093
094  @MetaschemaAssembly(
095      formalName = "Choice",
096      name = "choice",
097      moduleClass = MetaschemaModelModule.class
098  )
099  public static class Choice implements IBoundObject {
100    private final IMetaschemaData __metaschemaData;
101
102    @BoundChoiceGroup(
103        minOccurs = 1,
104        maxOccurs = -1,
105        assemblies = {
106            @BoundGroupedAssembly(formalName = "Assembly Reference", useName = "assembly", binding = AssemblyReference.class),
107            @BoundGroupedAssembly(formalName = "Inline Assembly Definition", useName = "define-assembly", binding = InlineDefineAssembly.class),
108            @BoundGroupedAssembly(formalName = "Field Reference", useName = "field", binding = FieldReference.class),
109            @BoundGroupedAssembly(formalName = "Inline Field Definition", useName = "define-field", binding = InlineDefineField.class)
110        },
111        groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "choices", inJson = JsonGroupAsBehavior.LIST)
112    )
113    private List<Object> _choices;
114
115    @BoundAssembly(
116        formalName = "Any Additional Content",
117        useName = "any"
118    )
119    private Any _any;
120
121    public Choice() {
122      this(null);
123    }
124
125    public Choice(IMetaschemaData data) {
126      this.__metaschemaData = data;
127    }
128
129    @Override
130    public IMetaschemaData getMetaschemaData() {
131      return __metaschemaData;
132    }
133
134    public List<Object> getChoices() {
135      return _choices;
136    }
137
138    public void setChoices(List<Object> value) {
139      _choices = value;
140    }
141
142    public Any getAny() {
143      return _any;
144    }
145
146    public void setAny(Any value) {
147      _any = value;
148    }
149
150    @Override
151    public String toString() {
152      return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString();
153    }
154  }
155
156  @MetaschemaAssembly(
157      formalName = "Choice Grouping",
158      name = "choice-group",
159      moduleClass = MetaschemaModelModule.class
160  )
161  public static class ChoiceGroup implements IBoundObject {
162    private final IMetaschemaData __metaschemaData;
163
164    @BoundFlag(
165        formalName = "Minimum Occurrence",
166        name = "min-occurs",
167        defaultValue = "0",
168        typeAdapter = NonNegativeIntegerAdapter.class
169    )
170    private BigInteger _minOccurs;
171
172    @BoundFlag(
173        formalName = "Maximum Occurrence",
174        name = "max-occurs",
175        defaultValue = "unbounded",
176        typeAdapter = StringAdapter.class,
177        valueConstraints = @ValueConstraints(matches = @Matches(level = IConstraint.Level.ERROR, pattern = "^[1-9][0-9]*|unbounded$"))
178    )
179    private String _maxOccurs;
180
181    @BoundAssembly(
182        formalName = "JSON Key",
183        description = "Used in JSON (and similar formats) to identify a flag that will be used as the property name in an object hold a collection of sibling objects. Requires that siblings must never share `json-key` values.",
184        useName = "json-key"
185    )
186    private JsonKey _jsonKey;
187
188    @BoundAssembly(
189        formalName = "Group As",
190        useName = "group-as",
191        minOccurs = 1
192    )
193    private GroupAs _groupAs;
194
195    @BoundField(
196        formalName = "Discriminator JSON Property",
197        useName = "discriminator",
198        defaultValue = "object-type",
199        typeAdapter = TokenAdapter.class
200    )
201    private String _discriminator;
202
203    @BoundChoiceGroup(
204        minOccurs = 1,
205        maxOccurs = -1,
206        assemblies = {
207            @BoundGroupedAssembly(formalName = "Grouping Assembly Reference", useName = "assembly", binding = Assembly.class),
208            @BoundGroupedAssembly(formalName = "Inline Assembly Definition", useName = "define-assembly", binding = DefineAssembly.class),
209            @BoundGroupedAssembly(formalName = "Grouping Field Reference", useName = "field", binding = Field.class),
210            @BoundGroupedAssembly(formalName = "Inline Field Definition", useName = "define-field", binding = DefineField.class)
211        },
212        groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "choices", inJson = JsonGroupAsBehavior.LIST)
213    )
214    private List<Object> _choices;
215
216    @BoundField(
217        formalName = "Remarks",
218        description = "Any explanatory or helpful information to be provided about the remarks parent.",
219        useName = "remarks"
220    )
221    private Remarks _remarks;
222
223    public ChoiceGroup() {
224      this(null);
225    }
226
227    public ChoiceGroup(IMetaschemaData data) {
228      this.__metaschemaData = data;
229    }
230
231    @Override
232    public IMetaschemaData getMetaschemaData() {
233      return __metaschemaData;
234    }
235
236    public BigInteger getMinOccurs() {
237      return _minOccurs;
238    }
239
240    public void setMinOccurs(BigInteger value) {
241      _minOccurs = value;
242    }
243
244    public String getMaxOccurs() {
245      return _maxOccurs;
246    }
247
248    public void setMaxOccurs(String value) {
249      _maxOccurs = value;
250    }
251
252    public JsonKey getJsonKey() {
253      return _jsonKey;
254    }
255
256    public void setJsonKey(JsonKey value) {
257      _jsonKey = value;
258    }
259
260    public GroupAs getGroupAs() {
261      return _groupAs;
262    }
263
264    public void setGroupAs(GroupAs value) {
265      _groupAs = value;
266    }
267
268    public String getDiscriminator() {
269      return _discriminator;
270    }
271
272    public void setDiscriminator(String value) {
273      _discriminator = value;
274    }
275
276    public List<Object> getChoices() {
277      return _choices;
278    }
279
280    public void setChoices(List<Object> value) {
281      _choices = value;
282    }
283
284    public Remarks getRemarks() {
285      return _remarks;
286    }
287
288    public void setRemarks(Remarks value) {
289      _remarks = value;
290    }
291
292    @Override
293    public String toString() {
294      return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString();
295    }
296
297    @MetaschemaAssembly(
298        formalName = "Grouping Assembly Reference",
299        name = "assembly",
300        moduleClass = MetaschemaModelModule.class
301    )
302    public static class Assembly implements IBoundObject {
303      private final IMetaschemaData __metaschemaData;
304
305      @BoundFlag(
306          formalName = "Global Assembly Reference",
307          name = "ref",
308          required = true,
309          typeAdapter = TokenAdapter.class
310      )
311      private String _ref;
312
313      @BoundFlag(
314          formalName = "Assembly Reference Binary Name",
315          name = "index",
316          typeAdapter = PositiveIntegerAdapter.class
317      )
318      private BigInteger _index;
319
320      @BoundFlag(
321          formalName = "Deprecated Version",
322          name = "deprecated",
323          typeAdapter = StringAdapter.class
324      )
325      private String _deprecated;
326
327      @BoundField(
328          formalName = "Formal Name",
329          description = "A formal name for the data construct, to be presented in documentation.",
330          useName = "formal-name"
331      )
332      private String _formalName;
333
334      @BoundField(
335          formalName = "Description",
336          description = "A short description of the data construct's purpose, describing the constructs semantics.",
337          useName = "description",
338          typeAdapter = MarkupLineAdapter.class
339      )
340      private MarkupLine _description;
341
342      @BoundAssembly(
343          formalName = "Property",
344          useName = "prop",
345          maxOccurs = -1,
346          groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)
347      )
348      private List<Property> _props;
349
350      @BoundField(
351          formalName = "Use Name",
352          description = "Allows the name of the definition to be overridden.",
353          useName = "use-name"
354      )
355      private UseName _useName;
356
357      @BoundField(
358          formalName = "Grouping Discriminator Value",
359          useName = "discriminator-value",
360          typeAdapter = TokenAdapter.class
361      )
362      private String _discriminatorValue;
363
364      @BoundField(
365          formalName = "Remarks",
366          description = "Any explanatory or helpful information to be provided about the remarks parent.",
367          useName = "remarks"
368      )
369      private Remarks _remarks;
370
371      public Assembly() {
372        this(null);
373      }
374
375      public Assembly(IMetaschemaData data) {
376        this.__metaschemaData = data;
377      }
378
379      @Override
380      public IMetaschemaData getMetaschemaData() {
381        return __metaschemaData;
382      }
383
384      public String getRef() {
385        return _ref;
386      }
387
388      public void setRef(String value) {
389        _ref = value;
390      }
391
392      public BigInteger getIndex() {
393        return _index;
394      }
395
396      public void setIndex(BigInteger value) {
397        _index = value;
398      }
399
400      public String getDeprecated() {
401        return _deprecated;
402      }
403
404      public void setDeprecated(String value) {
405        _deprecated = value;
406      }
407
408      public String getFormalName() {
409        return _formalName;
410      }
411
412      public void setFormalName(String value) {
413        _formalName = value;
414      }
415
416      public MarkupLine getDescription() {
417        return _description;
418      }
419
420      public void setDescription(MarkupLine value) {
421        _description = value;
422      }
423
424      public List<Property> getProps() {
425        return _props;
426      }
427
428      public void setProps(List<Property> value) {
429        _props = value;
430      }
431
432      /**
433       * Add a new {@link Property} item to the underlying collection.
434       * @param item the item to add
435       * @return {@code true}
436       */
437      public boolean addProp(Property item) {
438        Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
439        if (_props == null) {
440          _props = new LinkedList<>();
441        }
442        return _props.add(value);
443      }
444
445      /**
446       * Remove the first matching {@link Property} item from the underlying collection.
447       * @param item the item to remove
448       * @return {@code true} if the item was removed or {@code false} otherwise
449       */
450      public boolean removeProp(Property item) {
451        Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
452        return _props != null && _props.remove(value);
453      }
454
455      public UseName getUseName() {
456        return _useName;
457      }
458
459      public void setUseName(UseName value) {
460        _useName = value;
461      }
462
463      public String getDiscriminatorValue() {
464        return _discriminatorValue;
465      }
466
467      public void setDiscriminatorValue(String value) {
468        _discriminatorValue = value;
469      }
470
471      public Remarks getRemarks() {
472        return _remarks;
473      }
474
475      public void setRemarks(Remarks value) {
476        _remarks = value;
477      }
478
479      @Override
480      public String toString() {
481        return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString();
482      }
483    }
484
485    @MetaschemaAssembly(
486        formalName = "Inline Assembly Definition",
487        name = "define-assembly",
488        moduleClass = MetaschemaModelModule.class
489    )
490    public static class DefineAssembly implements IBoundObject {
491      private final IMetaschemaData __metaschemaData;
492
493      @BoundFlag(
494          formalName = "Inline Assembly Name",
495          name = "name",
496          required = true,
497          typeAdapter = TokenAdapter.class
498      )
499      private String _name;
500
501      @BoundFlag(
502          formalName = "Inline Assembly Binary Name",
503          name = "index",
504          typeAdapter = PositiveIntegerAdapter.class
505      )
506      private BigInteger _index;
507
508      @BoundFlag(
509          formalName = "Deprecated Version",
510          name = "deprecated",
511          typeAdapter = StringAdapter.class
512      )
513      private String _deprecated;
514
515      @BoundField(
516          formalName = "Formal Name",
517          description = "A formal name for the data construct, to be presented in documentation.",
518          useName = "formal-name"
519      )
520      private String _formalName;
521
522      @BoundField(
523          formalName = "Description",
524          description = "A short description of the data construct's purpose, describing the constructs semantics.",
525          useName = "description",
526          typeAdapter = MarkupLineAdapter.class
527      )
528      private MarkupLine _description;
529
530      @BoundAssembly(
531          formalName = "Property",
532          useName = "prop",
533          maxOccurs = -1,
534          groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)
535      )
536      private List<Property> _props;
537
538      @BoundField(
539          formalName = "Grouping Discriminator Value",
540          useName = "discriminator-value",
541          typeAdapter = TokenAdapter.class
542      )
543      private String _discriminatorValue;
544
545      @BoundChoiceGroup(
546          maxOccurs = -1,
547          assemblies = {
548              @BoundGroupedAssembly(formalName = "Inline Flag Definition", useName = "define-flag", binding = InlineDefineFlag.class),
549              @BoundGroupedAssembly(formalName = "Flag Reference", useName = "flag", binding = FlagReference.class)
550          },
551          groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "flags", inJson = JsonGroupAsBehavior.LIST)
552      )
553      private List<Object> _flags;
554
555      @BoundAssembly(
556          useName = "model"
557      )
558      private AssemblyModel _model;
559
560      @BoundAssembly(
561          useName = "constraint"
562      )
563      private AssemblyConstraints _constraint;
564
565      @BoundField(
566          formalName = "Remarks",
567          description = "Any explanatory or helpful information to be provided about the remarks parent.",
568          useName = "remarks"
569      )
570      private Remarks _remarks;
571
572      @BoundAssembly(
573          formalName = "Example",
574          useName = "example",
575          maxOccurs = -1,
576          groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "examples", inJson = JsonGroupAsBehavior.LIST)
577      )
578      private List<Example> _examples;
579
580      public DefineAssembly() {
581        this(null);
582      }
583
584      public DefineAssembly(IMetaschemaData data) {
585        this.__metaschemaData = data;
586      }
587
588      @Override
589      public IMetaschemaData getMetaschemaData() {
590        return __metaschemaData;
591      }
592
593      public String getName() {
594        return _name;
595      }
596
597      public void setName(String value) {
598        _name = value;
599      }
600
601      public BigInteger getIndex() {
602        return _index;
603      }
604
605      public void setIndex(BigInteger value) {
606        _index = value;
607      }
608
609      public String getDeprecated() {
610        return _deprecated;
611      }
612
613      public void setDeprecated(String value) {
614        _deprecated = value;
615      }
616
617      public String getFormalName() {
618        return _formalName;
619      }
620
621      public void setFormalName(String value) {
622        _formalName = value;
623      }
624
625      public MarkupLine getDescription() {
626        return _description;
627      }
628
629      public void setDescription(MarkupLine value) {
630        _description = value;
631      }
632
633      public List<Property> getProps() {
634        return _props;
635      }
636
637      public void setProps(List<Property> value) {
638        _props = value;
639      }
640
641      /**
642       * Add a new {@link Property} item to the underlying collection.
643       * @param item the item to add
644       * @return {@code true}
645       */
646      public boolean addProp(Property item) {
647        Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
648        if (_props == null) {
649          _props = new LinkedList<>();
650        }
651        return _props.add(value);
652      }
653
654      /**
655       * Remove the first matching {@link Property} item from the underlying collection.
656       * @param item the item to remove
657       * @return {@code true} if the item was removed or {@code false} otherwise
658       */
659      public boolean removeProp(Property item) {
660        Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
661        return _props != null && _props.remove(value);
662      }
663
664      public String getDiscriminatorValue() {
665        return _discriminatorValue;
666      }
667
668      public void setDiscriminatorValue(String value) {
669        _discriminatorValue = value;
670      }
671
672      public List<Object> getFlags() {
673        return _flags;
674      }
675
676      public void setFlags(List<Object> value) {
677        _flags = value;
678      }
679
680      public AssemblyModel getModel() {
681        return _model;
682      }
683
684      public void setModel(AssemblyModel value) {
685        _model = value;
686      }
687
688      public AssemblyConstraints getConstraint() {
689        return _constraint;
690      }
691
692      public void setConstraint(AssemblyConstraints value) {
693        _constraint = value;
694      }
695
696      public Remarks getRemarks() {
697        return _remarks;
698      }
699
700      public void setRemarks(Remarks value) {
701        _remarks = value;
702      }
703
704      public List<Example> getExamples() {
705        return _examples;
706      }
707
708      public void setExamples(List<Example> value) {
709        _examples = value;
710      }
711
712      /**
713       * Add a new {@link Example} item to the underlying collection.
714       * @param item the item to add
715       * @return {@code true}
716       */
717      public boolean addExample(Example item) {
718        Example value = ObjectUtils.requireNonNull(item,"item cannot be null");
719        if (_examples == null) {
720          _examples = new LinkedList<>();
721        }
722        return _examples.add(value);
723      }
724
725      /**
726       * Remove the first matching {@link Example} item from the underlying collection.
727       * @param item the item to remove
728       * @return {@code true} if the item was removed or {@code false} otherwise
729       */
730      public boolean removeExample(Example item) {
731        Example value = ObjectUtils.requireNonNull(item,"item cannot be null");
732        return _examples != null && _examples.remove(value);
733      }
734
735      @Override
736      public String toString() {
737        return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString();
738      }
739    }
740
741    @MetaschemaAssembly(
742        formalName = "Grouping Field Reference",
743        name = "field",
744        moduleClass = MetaschemaModelModule.class
745    )
746    public static class Field implements IBoundObject {
747      private final IMetaschemaData __metaschemaData;
748
749      @BoundFlag(
750          formalName = "Global Field Reference",
751          name = "ref",
752          required = true,
753          typeAdapter = TokenAdapter.class
754      )
755      private String _ref;
756
757      @BoundFlag(
758          formalName = "Field Reference Binary Name",
759          name = "index",
760          typeAdapter = PositiveIntegerAdapter.class
761      )
762      private BigInteger _index;
763
764      @BoundFlag(
765          formalName = "Deprecated Version",
766          name = "deprecated",
767          typeAdapter = StringAdapter.class
768      )
769      private String _deprecated;
770
771      @BoundFlag(
772          formalName = "Default Field Value",
773          name = "default",
774          typeAdapter = StringAdapter.class
775      )
776      private String _default;
777
778      @BoundFlag(
779          formalName = "Field In XML",
780          name = "in-xml",
781          defaultValue = "WRAPPED",
782          typeAdapter = TokenAdapter.class,
783          valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, values = {@AllowedValue(value = "WRAPPED", description = "Block contents of a markup-multiline field will be represented with a containing (wrapper) element in the XML."), @AllowedValue(value = "UNWRAPPED", description = "Block contents of a markup-multiline will be represented in the XML with no wrapper, making the field implicit. Among sibling fields in a given model, only one of them may be designated as UNWRAPPED."), @AllowedValue(value = "WITH_WRAPPER", description = "Alias for WRAPPED.", deprecatedVersion = "0.9.0")}))
784      )
785      private String _inXml;
786
787      @BoundField(
788          formalName = "Formal Name",
789          description = "A formal name for the data construct, to be presented in documentation.",
790          useName = "formal-name"
791      )
792      private String _formalName;
793
794      @BoundField(
795          formalName = "Description",
796          description = "A short description of the data construct's purpose, describing the constructs semantics.",
797          useName = "description",
798          typeAdapter = MarkupLineAdapter.class
799      )
800      private MarkupLine _description;
801
802      @BoundAssembly(
803          formalName = "Property",
804          useName = "prop",
805          maxOccurs = -1,
806          groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)
807      )
808      private List<Property> _props;
809
810      @BoundField(
811          formalName = "Use Name",
812          description = "Allows the name of the definition to be overridden.",
813          useName = "use-name"
814      )
815      private UseName _useName;
816
817      @BoundField(
818          formalName = "Grouping Discriminator Value",
819          useName = "discriminator-value",
820          typeAdapter = TokenAdapter.class
821      )
822      private String _discriminatorValue;
823
824      @BoundField(
825          formalName = "Remarks",
826          description = "Any explanatory or helpful information to be provided about the remarks parent.",
827          useName = "remarks"
828      )
829      private Remarks _remarks;
830
831      public Field() {
832        this(null);
833      }
834
835      public Field(IMetaschemaData data) {
836        this.__metaschemaData = data;
837      }
838
839      @Override
840      public IMetaschemaData getMetaschemaData() {
841        return __metaschemaData;
842      }
843
844      public String getRef() {
845        return _ref;
846      }
847
848      public void setRef(String value) {
849        _ref = value;
850      }
851
852      public BigInteger getIndex() {
853        return _index;
854      }
855
856      public void setIndex(BigInteger value) {
857        _index = value;
858      }
859
860      public String getDeprecated() {
861        return _deprecated;
862      }
863
864      public void setDeprecated(String value) {
865        _deprecated = value;
866      }
867
868      public String getDefault() {
869        return _default;
870      }
871
872      public void setDefault(String value) {
873        _default = value;
874      }
875
876      public String getInXml() {
877        return _inXml;
878      }
879
880      public void setInXml(String value) {
881        _inXml = value;
882      }
883
884      public String getFormalName() {
885        return _formalName;
886      }
887
888      public void setFormalName(String value) {
889        _formalName = value;
890      }
891
892      public MarkupLine getDescription() {
893        return _description;
894      }
895
896      public void setDescription(MarkupLine value) {
897        _description = value;
898      }
899
900      public List<Property> getProps() {
901        return _props;
902      }
903
904      public void setProps(List<Property> value) {
905        _props = value;
906      }
907
908      /**
909       * Add a new {@link Property} item to the underlying collection.
910       * @param item the item to add
911       * @return {@code true}
912       */
913      public boolean addProp(Property item) {
914        Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
915        if (_props == null) {
916          _props = new LinkedList<>();
917        }
918        return _props.add(value);
919      }
920
921      /**
922       * Remove the first matching {@link Property} item from the underlying collection.
923       * @param item the item to remove
924       * @return {@code true} if the item was removed or {@code false} otherwise
925       */
926      public boolean removeProp(Property item) {
927        Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
928        return _props != null && _props.remove(value);
929      }
930
931      public UseName getUseName() {
932        return _useName;
933      }
934
935      public void setUseName(UseName value) {
936        _useName = value;
937      }
938
939      public String getDiscriminatorValue() {
940        return _discriminatorValue;
941      }
942
943      public void setDiscriminatorValue(String value) {
944        _discriminatorValue = value;
945      }
946
947      public Remarks getRemarks() {
948        return _remarks;
949      }
950
951      public void setRemarks(Remarks value) {
952        _remarks = value;
953      }
954
955      @Override
956      public String toString() {
957        return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString();
958      }
959    }
960
961    @MetaschemaAssembly(
962        formalName = "Inline Field Definition",
963        name = "define-field",
964        moduleClass = MetaschemaModelModule.class
965    )
966    public static class DefineField implements IBoundObject {
967      private final IMetaschemaData __metaschemaData;
968
969      @BoundFlag(
970          formalName = "Inline Field Name",
971          name = "name",
972          required = true,
973          typeAdapter = TokenAdapter.class
974      )
975      private String _name;
976
977      @BoundFlag(
978          formalName = "Inline Field Binary Name",
979          name = "index",
980          typeAdapter = PositiveIntegerAdapter.class
981      )
982      private BigInteger _index;
983
984      @BoundFlag(
985          formalName = "Deprecated Version",
986          name = "deprecated",
987          typeAdapter = StringAdapter.class
988      )
989      private String _deprecated;
990
991      @BoundFlag(
992          formalName = "Field Value Data Type",
993          name = "as-type",
994          defaultValue = "string",
995          typeAdapter = TokenAdapter.class,
996          valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, allowOthers = true, values = {@AllowedValue(value = "markup-line", description = "The [markup-line](https://pages.nist.gov/metaschema/specification/datatypes/#markup-line) data type."), @AllowedValue(value = "markup-multiline", description = "The [markup-multiline](https://pages.nist.gov/metaschema/specification/datatypes/#markup-multiline) data type."), @AllowedValue(value = "base64", description = "The [base64](https://pages.nist.gov/metaschema/specification/datatypes/#base64) data type."), @AllowedValue(value = "boolean", description = "The [boolean](https://pages.nist.gov/metaschema/specification/datatypes/#boolean) data type."), @AllowedValue(value = "date", description = "The [date](https://pages.nist.gov/metaschema/specification/datatypes/#date) data type."), @AllowedValue(value = "date-time", description = "The [date-time](https://pages.nist.gov/metaschema/specification/datatypes/#date-time) data type."), @AllowedValue(value = "date-time-with-timezone", description = "The [date-time-with-timezone](https://pages.nist.gov/metaschema/specification/datatypes/#date-time-with-timezone) data type."), @AllowedValue(value = "date-with-timezone", description = "The [date-with-timezone](https://pages.nist.gov/metaschema/specification/datatypes/#date-with-timezone) data type."), @AllowedValue(value = "day-time-duration", description = "The [day-time-duration](https://pages.nist.gov/metaschema/specification/datatypes/#day-time-duration) data type."), @AllowedValue(value = "decimal", description = "The [decimal](https://pages.nist.gov/metaschema/specification/datatypes/#decimal) data type."), @AllowedValue(value = "email-address", description = "The [email-address](https://pages.nist.gov/metaschema/specification/datatypes/#email-address) data type."), @AllowedValue(value = "hostname", description = "The [hostname](https://pages.nist.gov/metaschema/specification/datatypes/#hostname) data type."), @AllowedValue(value = "integer", description = "The [integer](https://pages.nist.gov/metaschema/specification/datatypes/#integer) data type."), @AllowedValue(value = "ip-v4-address", description = "The [ip-v4-address](https://pages.nist.gov/metaschema/specification/datatypes/#ip-v4-address) data type."), @AllowedValue(value = "ip-v6-address", description = "The [ip-v6-address](https://pages.nist.gov/metaschema/specification/datatypes/#ip-v6-address) data type."), @AllowedValue(value = "non-negative-integer", description = "The [non-negative-integer](https://pages.nist.gov/metaschema/specification/datatypes/#non-negative-integer) data type."), @AllowedValue(value = "positive-integer", description = "The [positive-integer](https://pages.nist.gov/metaschema/specification/datatypes/#positive-integer) data type."), @AllowedValue(value = "string", description = "The [string](https://pages.nist.gov/metaschema/specification/datatypes/#string) data type."), @AllowedValue(value = "token", description = "The [token](https://pages.nist.gov/metaschema/specification/datatypes/#token) data type."), @AllowedValue(value = "uri", description = "The [uri](https://pages.nist.gov/metaschema/specification/datatypes/#uri) data type."), @AllowedValue(value = "uri-reference", description = "The [uri-reference](https://pages.nist.gov/metaschema/specification/datatypes/#uri-reference) data type."), @AllowedValue(value = "uuid", description = "The [uuid](https://pages.nist.gov/metaschema/specification/datatypes/#uuid) data type."), @AllowedValue(value = "base64Binary", description = "An old name which is deprecated for use in favor of the 'base64' data type.", deprecatedVersion = "1.0.0"), @AllowedValue(value = "dateTime", description = "An old name which is deprecated for use in favor of the 'date-time' data type.", deprecatedVersion = "1.0.0"), @AllowedValue(value = "dateTime-with-timezone", description = "An old name which is deprecated for use in favor of the 'date-time-with-timezone' data type.", deprecatedVersion = "1.0.0"), @AllowedValue(value = "email", description = "An old name which is deprecated for use in favor of the 'email-address' data type.", deprecatedVersion = "1.0.0"), @AllowedValue(value = "nonNegativeInteger", description = "An old name which is deprecated for use in favor of the 'non-negative-integer' data type.", deprecatedVersion = "1.0.0"), @AllowedValue(value = "positiveInteger", description = "An old name which is deprecated for use in favor of the 'positive-integer' data type.", deprecatedVersion = "1.0.0")}))
997      )
998      private String _asType;
999
1000      @BoundFlag(
1001          formalName = "Default Field Value",
1002          name = "default",
1003          typeAdapter = StringAdapter.class
1004      )
1005      private String _default;
1006
1007      @BoundField(
1008          formalName = "Formal Name",
1009          description = "A formal name for the data construct, to be presented in documentation.",
1010          useName = "formal-name"
1011      )
1012      private String _formalName;
1013
1014      @BoundField(
1015          formalName = "Description",
1016          description = "A short description of the data construct's purpose, describing the constructs semantics.",
1017          useName = "description",
1018          typeAdapter = MarkupLineAdapter.class
1019      )
1020      private MarkupLine _description;
1021
1022      @BoundAssembly(
1023          formalName = "Property",
1024          useName = "prop",
1025          maxOccurs = -1,
1026          groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)
1027      )
1028      private List<Property> _props;
1029
1030      @BoundField(
1031          formalName = "Grouping Discriminator Value",
1032          useName = "discriminator-value",
1033          typeAdapter = TokenAdapter.class
1034      )
1035      private String _discriminatorValue;
1036
1037      @BoundField(
1038          formalName = "Field Value JSON Property Name",
1039          useName = "json-value-key",
1040          typeAdapter = TokenAdapter.class
1041      )
1042      private String _jsonValueKey;
1043
1044      @BoundAssembly(
1045          formalName = "Flag Used as the Field Value's JSON Property Name",
1046          useName = "json-value-key-flag"
1047      )
1048      private JsonValueKeyFlag _jsonValueKeyFlag;
1049
1050      @BoundChoiceGroup(
1051          maxOccurs = -1,
1052          assemblies = {
1053              @BoundGroupedAssembly(formalName = "Inline Flag Definition", useName = "define-flag", binding = InlineDefineFlag.class),
1054              @BoundGroupedAssembly(formalName = "Flag Reference", useName = "flag", binding = FlagReference.class)
1055          },
1056          groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "flags", inJson = JsonGroupAsBehavior.LIST)
1057      )
1058      private List<Object> _flags;
1059
1060      @BoundAssembly(
1061          useName = "constraint"
1062      )
1063      private FieldConstraints _constraint;
1064
1065      @BoundField(
1066          formalName = "Remarks",
1067          description = "Any explanatory or helpful information to be provided about the remarks parent.",
1068          useName = "remarks"
1069      )
1070      private Remarks _remarks;
1071
1072      @BoundAssembly(
1073          formalName = "Example",
1074          useName = "example",
1075          maxOccurs = -1,
1076          groupAs = @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name = "examples", inJson = JsonGroupAsBehavior.LIST)
1077      )
1078      private List<Example> _examples;
1079
1080      public DefineField() {
1081        this(null);
1082      }
1083
1084      public DefineField(IMetaschemaData data) {
1085        this.__metaschemaData = data;
1086      }
1087
1088      @Override
1089      public IMetaschemaData getMetaschemaData() {
1090        return __metaschemaData;
1091      }
1092
1093      public String getName() {
1094        return _name;
1095      }
1096
1097      public void setName(String value) {
1098        _name = value;
1099      }
1100
1101      public BigInteger getIndex() {
1102        return _index;
1103      }
1104
1105      public void setIndex(BigInteger value) {
1106        _index = value;
1107      }
1108
1109      public String getDeprecated() {
1110        return _deprecated;
1111      }
1112
1113      public void setDeprecated(String value) {
1114        _deprecated = value;
1115      }
1116
1117      public String getAsType() {
1118        return _asType;
1119      }
1120
1121      public void setAsType(String value) {
1122        _asType = value;
1123      }
1124
1125      public String getDefault() {
1126        return _default;
1127      }
1128
1129      public void setDefault(String value) {
1130        _default = value;
1131      }
1132
1133      public String getFormalName() {
1134        return _formalName;
1135      }
1136
1137      public void setFormalName(String value) {
1138        _formalName = value;
1139      }
1140
1141      public MarkupLine getDescription() {
1142        return _description;
1143      }
1144
1145      public void setDescription(MarkupLine value) {
1146        _description = value;
1147      }
1148
1149      public List<Property> getProps() {
1150        return _props;
1151      }
1152
1153      public void setProps(List<Property> value) {
1154        _props = value;
1155      }
1156
1157      /**
1158       * Add a new {@link Property} item to the underlying collection.
1159       * @param item the item to add
1160       * @return {@code true}
1161       */
1162      public boolean addProp(Property item) {
1163        Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
1164        if (_props == null) {
1165          _props = new LinkedList<>();
1166        }
1167        return _props.add(value);
1168      }
1169
1170      /**
1171       * Remove the first matching {@link Property} item from the underlying collection.
1172       * @param item the item to remove
1173       * @return {@code true} if the item was removed or {@code false} otherwise
1174       */
1175      public boolean removeProp(Property item) {
1176        Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
1177        return _props != null && _props.remove(value);
1178      }
1179
1180      public String getDiscriminatorValue() {
1181        return _discriminatorValue;
1182      }
1183
1184      public void setDiscriminatorValue(String value) {
1185        _discriminatorValue = value;
1186      }
1187
1188      public String getJsonValueKey() {
1189        return _jsonValueKey;
1190      }
1191
1192      public void setJsonValueKey(String value) {
1193        _jsonValueKey = value;
1194      }
1195
1196      public JsonValueKeyFlag getJsonValueKeyFlag() {
1197        return _jsonValueKeyFlag;
1198      }
1199
1200      public void setJsonValueKeyFlag(JsonValueKeyFlag value) {
1201        _jsonValueKeyFlag = value;
1202      }
1203
1204      public List<Object> getFlags() {
1205        return _flags;
1206      }
1207
1208      public void setFlags(List<Object> value) {
1209        _flags = value;
1210      }
1211
1212      public FieldConstraints getConstraint() {
1213        return _constraint;
1214      }
1215
1216      public void setConstraint(FieldConstraints value) {
1217        _constraint = value;
1218      }
1219
1220      public Remarks getRemarks() {
1221        return _remarks;
1222      }
1223
1224      public void setRemarks(Remarks value) {
1225        _remarks = value;
1226      }
1227
1228      public List<Example> getExamples() {
1229        return _examples;
1230      }
1231
1232      public void setExamples(List<Example> value) {
1233        _examples = value;
1234      }
1235
1236      /**
1237       * Add a new {@link Example} item to the underlying collection.
1238       * @param item the item to add
1239       * @return {@code true}
1240       */
1241      public boolean addExample(Example item) {
1242        Example value = ObjectUtils.requireNonNull(item,"item cannot be null");
1243        if (_examples == null) {
1244          _examples = new LinkedList<>();
1245        }
1246        return _examples.add(value);
1247      }
1248
1249      /**
1250       * Remove the first matching {@link Example} item from the underlying collection.
1251       * @param item the item to remove
1252       * @return {@code true} if the item was removed or {@code false} otherwise
1253       */
1254      public boolean removeExample(Example item) {
1255        Example value = ObjectUtils.requireNonNull(item,"item cannot be null");
1256        return _examples != null && _examples.remove(value);
1257      }
1258
1259      @Override
1260      public String toString() {
1261        return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString();
1262      }
1263    }
1264  }
1265}