Identifies that the annotation target is a bound property that references a collection of model instances of varying types.

For JSON and YAML serializations, the discriminator() identifies the property use to differentiate the type of object values.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The the assemblies that may occur within this choice group.
    The discriminator to use for determining the type of child elements in JSON.
    The the fields that may occur within this choice group.
    Used to provide grouping information.
    The name of a common flag to use as the JSON key that appears on all associated assemblies() and fields().
    int
    A number that indicates the maximum occurrence of the model instance.
    int
    A non-negative number that indicates the minimum occurrence of the model instance.
  • Element Details

    • discriminator

      The discriminator to use for determining the type of child elements in JSON.
      Returns:
      the discriminator property name
      Default:
      "object-type"
    • minOccurs

      A non-negative number that indicates the minimum occurrence of the model instance.
      Returns:
      a non-negative number
      Default:
      0
    • maxOccurs

      A number that indicates the maximum occurrence of the model instance.
      Returns:
      a positive number or -1 to indicate "unbounded"
      Default:
      1
    • groupAs

      @NonNull GroupAs groupAs
      Used to provide grouping information.

      This annotation is required when the value of maxOccurs() is greater than 1.

      Returns:
      the configured GroupAs or the default value with a null GroupAs.name()
      Default:
      @gov.nist.secauto.metaschema.databind.model.annotations.GroupAs(name="\u0000")
    • jsonKey

      @NonNull String jsonKey
      The name of a common flag to use as the JSON key that appears on all associated assemblies() and fields().
      Returns:
      the configured JSON key flag name or ModelUtil.NO_STRING_VALUE if no JSON key is configured
      Default:
      "##none"
    • assemblies

      The the assemblies that may occur within this choice group.
      Returns:
      an array of assembly bindings which may occur within this choice group
      Default:
      {}
    • fields

      The the fields that may occur within this choice group.
      Returns:
      an array of field bindings which may occur within this choice group
      Default:
      {}