Interface IModelDefinition

All Superinterfaces:
IAttributable, IContainer, IDefaultable, IDefinition, IDescribable, IFeatureValueConstrained, IJsonNamed, IModelElement, IModelElementVisitable, INamed, INamedModelElement, IValueConstrained
All Known Subinterfaces:
IAssemblyDefinition, IBindingDefinitionModel, IBindingDefinitionModelAssembly, IBoundDefinitionModel<ITEM>, IBoundDefinitionModelAssembly, IBoundDefinitionModelComplex, IBoundDefinitionModelField<ITEM>, IBoundDefinitionModelFieldComplex, IBoundInstanceModelFieldScalar, IFeatureContainerFlag<FI>, IFieldDefinition
All Known Implementing Classes:
AbstractGlobalAssemblyDefinition, AbstractGlobalFieldDefinition, AbstractInlineAssemblyDefinition, AbstractInlineFieldDefinition

public interface IModelDefinition extends IDefinition, IContainer
Represents a Metaschema definition for a complex object that may contain flags.
  • Method Details

    • complexObjectFilter

      static boolean complexObjectFilter(IModelDefinition definition)
      Tests if the provided definition represents complex data. The data is complex if one of the following is true: This method can be used as a Predicate.
      Parameters:
      definition - the definition to test
      Returns:
      true if the data is complex, or false otherwise
    • hasChildren

      default boolean hasChildren()
      Description copied from interface: IContainer
      Identifies if the container allows child instances or not.

      This can be the case if the container has flags or a complex model with at least a choice, choice group, field, or assembly instance.

      Specified by:
      hasChildren in interface IContainer
      Returns:
      true if there are flags or a model, or false otherwise
    • getFlagInstanceByName

      @Nullable IFlagInstance getFlagInstanceByName(@NonNull Integer index)
      Retrieves a flag instance, by the flag's effective name-based qualified name index.
      Parameters:
      index - the flag's name-based qualified name index
      Returns:
      the matching flag instance, or null if there is no flag matching the specified name
    • getFlagInstances

      @NonNull Collection<? extends IFlagInstance> getFlagInstances()
      Retrieves the flag instances for all flags defined on the containing definition.
      Returns:
      the flags
    • getJsonKey

      @Nullable IFlagInstance getJsonKey()
      Retrieves the flag instance to use as the property name for the containing object in JSON whose value will be the object containing the flag.
      Returns:
      the flag instance if a JSON key is configured, or null otherwise