Interface IFeatureComplexItemValueHandler

All Superinterfaces:
IItemValueHandler<dev.metaschema.core.model.IBoundObject>
All Known Subinterfaces:
IBoundDefinitionModelAssembly, IBoundDefinitionModelComplex, IBoundDefinitionModelFieldComplex, IBoundInstanceModelAssembly, IBoundInstanceModelFieldComplex, IBoundInstanceModelGroupedAssembly, IBoundInstanceModelGroupedField, IBoundInstanceModelGroupedNamed

public interface IFeatureComplexItemValueHandler extends IItemValueHandler<dev.metaschema.core.model.IBoundObject>
A feature interface for handling complex item values during binding operations.

Complex items are bound to Java classes and can contain flags and other nested model content.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    callAfterDeserialize(dev.metaschema.core.model.IBoundObject targetObject, dev.metaschema.core.model.IBoundObject parentObject)
    Invoke the after-deserialize lifecycle callback on the target object.
    void
    callBeforeDeserialize(dev.metaschema.core.model.IBoundObject targetObject, dev.metaschema.core.model.IBoundObject parentObject)
    Invoke the before-deserialize lifecycle callback on the target object.
    dev.metaschema.core.model.IBoundObject
    deepCopyItem(dev.metaschema.core.model.IBoundObject item, dev.metaschema.core.model.IBoundObject parentInstance)
    Create and return a deep copy of the provided item.
    Class<? extends dev.metaschema.core.model.IBoundObject>
    The class this binding is to.
    Get the Metaschema definition representing the bound complex data.
    Get the mapping of JSON property names to property bindings.
    default <CLASS extends dev.metaschema.core.model.IBoundObject>
    CLASS
    newInstance(Supplier<dev.metaschema.core.model.IMetaschemaData> supplier)
    Gets a new instance of the bound class.

    Methods inherited from interface dev.metaschema.databind.model.info.IItemValueHandler

    readItem, writeItem
  • Method Details

    • getDefinition

      Get the Metaschema definition representing the bound complex data.
      Returns:
      the definition
    • getJsonProperties

      Get the mapping of JSON property names to property bindings.
      Returns:
      the mapping
    • deepCopyItem

      @NonNull dev.metaschema.core.model.IBoundObject deepCopyItem(@NonNull dev.metaschema.core.model.IBoundObject item, @Nullable dev.metaschema.core.model.IBoundObject parentInstance) throws BindingException
      Description copied from interface: IItemValueHandler
      Create and return a deep copy of the provided item.
      Specified by:
      deepCopyItem in interface IItemValueHandler<dev.metaschema.core.model.IBoundObject>
      Parameters:
      item - the item to copy
      parentInstance - an optional parent object to use for serialization callbacks
      Returns:
      the new deep copy
      Throws:
      BindingException - if an error occurred while analyzing the bound objects
    • getBoundClass

      @NonNull Class<? extends dev.metaschema.core.model.IBoundObject> getBoundClass()
      The class this binding is to.
      Returns:
      the bound class
    • newInstance

      @NonNull default <CLASS extends dev.metaschema.core.model.IBoundObject> CLASS newInstance(@Nullable Supplier<dev.metaschema.core.model.IMetaschemaData> supplier)
      Gets a new instance of the bound class.
      Type Parameters:
      CLASS - the type of the bound class
      Parameters:
      supplier - the metaschema data generator used to capture parse information (i.e., location)
      Returns:
      a Java object for the class
      Throws:
      RuntimeException - if the instance cannot be created due to a binding error
    • callBeforeDeserialize

      void callBeforeDeserialize(@NonNull dev.metaschema.core.model.IBoundObject targetObject, @Nullable dev.metaschema.core.model.IBoundObject parentObject) throws BindingException
      Invoke the before-deserialize lifecycle callback on the target object.
      Parameters:
      targetObject - the object being deserialized
      parentObject - the parent object containing the target, or null if there is no parent
      Throws:
      BindingException - if an error occurs during the callback
    • callAfterDeserialize

      void callAfterDeserialize(@NonNull dev.metaschema.core.model.IBoundObject targetObject, @Nullable dev.metaschema.core.model.IBoundObject parentObject) throws BindingException
      Invoke the after-deserialize lifecycle callback on the target object.
      Parameters:
      targetObject - the object that was deserialized
      parentObject - the parent object containing the target, or null if there is no parent
      Throws:
      BindingException - if an error occurs during the callback