Interface INamedModelInstance

All Superinterfaces:
IAttributable, IDefaultable, IDescribable, IGroupable, IInstance, IJsonNamed, IModelElement, IModelElementVisitable, IModelInstance, INamed, INamedInstance, INamedModelElement
All Known Subinterfaces:
IAssemblyInstance, IAssemblyInstanceAbsolute, IAssemblyInstanceGrouped, IBoundInstanceModelAssembly, IBoundInstanceModelField<ITEM>, IBoundInstanceModelFieldComplex, IBoundInstanceModelFieldScalar, IBoundInstanceModelGroupedAssembly, IBoundInstanceModelGroupedField, IBoundInstanceModelGroupedNamed, IBoundInstanceModelNamed<ITEM>, IFieldInstance, IFieldInstanceAbsolute, IFieldInstanceGrouped, INamedModelInstanceAbsolute, INamedModelInstanceGrouped
All Known Implementing Classes:
AbstractAssemblyInstance, AbstractFieldInstance, AbstractInlineAssemblyDefinition, AbstractInlineFieldDefinition, AbstractNamedModelInstance

public interface INamedModelInstance extends IModelInstance, INamedInstance
Represents a named instance of a field or assembly within a model.

Provides access to the instance's definition and JSON key configuration for serialization purposes.

  • Method Details

    • complexObjectFilter

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

      @NonNull IModelDefinition getDefinition()
      Description copied from interface: INamedInstance
      Retrieve the definition of this instance.
      Specified by:
      getDefinition in interface INamedInstance
      Returns:
      the corresponding definition
    • hasJsonKey

      default boolean hasJsonKey()
      Indicates if a flag's value can be used as a property name in the containing object in JSON whose value will be the object containing the flag. In such cases, the flag will not appear in the object. This is only allowed if the flag is required, as determined by a true result from IFlagInstance.isRequired(). The IFlagInstance can be retrieved using getEffectiveJsonKey().
      Returns:
      true if the flag's value can be used as a property name, or false otherwise
      See Also:
    • getEffectiveJsonKey

      @Nullable IFlagInstance getEffectiveJsonKey()
      Get the JSON key flag instance for this model instance, if one is configured.
      Returns:
      the JSON key flag instance or null if no JSON key is configured
    • getJsonKey

      @Nullable IFlagInstance getJsonKey()
      Get the JSON key associated with this instance.
      Returns:
      the configured JSON key or null if no JSON key is configured