Interface IBoundInstanceModel<ITEM>

Type Parameters:
ITEM - the Java type for associated bound objects
All Superinterfaces:
IBoundInstance<ITEM>, IBoundModelElement, IBoundModelObject<ITEM>, IBoundProperty<ITEM>, IDefaultable, IFeatureJavaField, IGroupable, IInstance, IInstanceAbsolute, IItemValueHandler<ITEM>, IJsonNamed, IModelElement, IModelElementVisitable, IModelInstance, IModelInstanceAbsolute, IValued, IValuedMutable
All Known Subinterfaces:
IBoundInstanceModelAssembly, IBoundInstanceModelChoiceGroup, IBoundInstanceModelField<ITEM>, IBoundInstanceModelFieldComplex, IBoundInstanceModelFieldScalar, IBoundInstanceModelNamed<ITEM>

public interface IBoundInstanceModel<ITEM> extends IBoundInstance<ITEM>, IModelInstanceAbsolute
Represents an assembly or field instance bound to Java data.
  • Method Details

    • getItemType

      @NonNull static Class<?> getItemType(@NonNull Field field)
      Get the collection Java item type for the Java field associated with this instance.
      Parameters:
      field - the Java field for the instance
      Returns:
      the Java item type
    • getItemType

      @NonNull static <TYPE> Class<? extends TYPE> getItemType(@NonNull Field field, @NonNull Class<TYPE> expectedItemType)
      Get the collection Java item type for the Java field associated with this instance.
      Type Parameters:
      TYPE - the item's expected Java type
      Parameters:
      field - the Java field for the instance
      expectedItemType - the item's expected Java type, which may be a super type of the item's type
      Returns:
      the Java item type
    • getContainingDefinition

      @NonNull IBoundDefinitionModelAssembly getContainingDefinition()
      Description copied from interface: IInstance
      Retrieve the Metaschema module definition on which the instance was declared.
      Specified by:
      getContainingDefinition in interface IBoundInstance<ITEM>
      Specified by:
      getContainingDefinition in interface IInstance
      Specified by:
      getContainingDefinition in interface IModelInstance
      Returns:
      the Metaschema module definition on which the instance was declared
    • getResolvedDefaultValue

      default Object getResolvedDefaultValue()
      Description copied from interface: IDefaultable
      Get the actual default value to use for the model construct.

      This will consider the effective default value in the use context to determine the appropriate default to use. Factors such as the required instance cardinality may affect if the effective default or an empty collection is used.

      Specified by:
      getResolvedDefaultValue in interface IDefaultable
      Returns:
      the actual default value or null if there is no actual default value
    • getItemValues

      @NonNull default Collection<? extends Object> getItemValues(Object value)
      Get the item values associated with the provided value.
      Specified by:
      getItemValues in interface IGroupable
      Parameters:
      value - the value which may be a singleton or a collection
      Returns:
      the ordered collection of values
    • getCollectionInfo

      @NonNull IModelInstanceCollectionInfo<ITEM> getCollectionInfo()
      Get the Java binding information for the collection type supported by this instance.
      Returns:
      the collection Java binding information
    • getItemJsonKey

      @Nullable IBoundInstanceFlag getItemJsonKey(@NonNull Object item)
      Get the JSON key flag for the provided item.
      Parameters:
      item - the item to get the JSON key flag for
      Returns:
      the JSON key flag
    • deepCopy

      default void deepCopy(@NonNull IBoundObject fromInstance, @NonNull IBoundObject toInstance) throws BindingException
      Description copied from interface: IBoundProperty
      Copy this instance from one parent object to another.
      Specified by:
      deepCopy in interface IBoundProperty<ITEM>
      Parameters:
      fromInstance - the object to copy from
      toInstance - the object to copy to
      Throws:
      BindingException - if an error occurred while processing the object bindings