Interface IFeatureScalarItemValueHandler

All Superinterfaces:
dev.metaschema.core.model.IDefaultable, IItemValueHandler<Object>, dev.metaschema.core.model.IValued, IValuedMutable
All Known Subinterfaces:
IBoundFieldValue, IBoundInstanceFlag, IBoundInstanceModelFieldScalar

A feature interface for handling scalar item values during binding operations.

Scalar items have simple values that can be converted directly by a data type adapter.

  • Method Summary

    Modifier and Type
    Method
    Description
    default Object
    deepCopyItem(Object source, dev.metaschema.core.model.IBoundObject parentInstance)
    Create and return a deep copy of the provided item.
    dev.metaschema.core.datatype.IDataTypeAdapter<?>
    Get the data type adapter supporting the scalar value.
    default Object
    Parse a string value using the underlying data type implementation.
    default void
    setValue(Object parent, String text)
    Apply the string value.

    Methods inherited from interface dev.metaschema.core.model.IDefaultable

    getDefaultValue, getEffectiveDefaultValue, getResolvedDefaultValue

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

    readItem, writeItem

    Methods inherited from interface dev.metaschema.core.model.IValued

    getValue

    Methods inherited from interface dev.metaschema.databind.model.IValuedMutable

    setValue
  • Method Details

    • setValue

      default void setValue(@NonNull Object parent, @NonNull String text)
      Apply the string value.

      This first parses the value using the underlying data type implementation and then applies the parsed value.

      Parameters:
      parent - the parent object to apply the value to
      text - the value to parse
      Throws:
      IllegalArgumentException - if the text was malformed
      See Also:
    • getValueFromString

      default Object getValueFromString(@NonNull String text)
      Parse a string value using the underlying data type implementation.
      Parameters:
      text - the value to parse
      Returns:
      the parsed value
      Throws:
      IllegalArgumentException - if the text was malformed
      See Also:
    • getJavaTypeAdapter

      @NonNull dev.metaschema.core.datatype.IDataTypeAdapter<?> getJavaTypeAdapter()
      Get the data type adapter supporting the scalar value.
      Returns:
      the data type adapter
    • deepCopyItem

      default Object deepCopyItem(Object source, 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<Object>
      Parameters:
      source - 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