Interface IBoundInstance<ITEM>

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

public interface IBoundInstance<ITEM> extends IBoundProperty<ITEM>, IBoundModelElement, IInstance
Represents a Metaschema module instance bound to Java data.
  • Method Details

    • getContainingDefinition

      IBoundDefinitionModel<IBoundObject> getContainingDefinition()
      Description copied from interface: IInstance
      Retrieve the Metaschema module definition on which the instance was declared.
      Specified by:
      getContainingDefinition in interface IInstance
      Returns:
      the Metaschema module definition on which the instance was declared
    • getContainingModule

      default IBoundModule getContainingModule()
      Description copied from interface: IModelElement
      Retrieves the Metaschema module that contains the information element's declaration.
      Specified by:
      getContainingModule in interface IBoundModelElement
      Specified by:
      getContainingModule in interface IModelElement
      Returns:
      the Metaschema module
    • getValue

      @Nullable default Object getValue(@NonNull Object parent)
      Get the current value from the provided parentInstance object.

      The provided object must be of the type associated with the definition containing this instance.

      Always bound to a field.

      Specified by:
      getValue in interface IFeatureJavaField
      Specified by:
      getValue in interface IValued
      Parameters:
      parent - the object associated with the definition containing this property
      Returns:
      the value if available, or null otherwise
    • setValue

      default void setValue(@NonNull Object parentObject, @Nullable Object value)
      Set the provided value on the provided object. The provided object must be of the item's type associated with this instance.

      Always bound to a field.

      Specified by:
      setValue in interface IFeatureJavaField
      Specified by:
      setValue in interface IValuedMutable
      Parameters:
      parentObject - the object
      value - a value, which may be a simple Type or a ParameterizedType for a collection