Interface ItemContainer


public interface ItemContainer
Accepts and store data from user input, external system, and so on.

This is an interface, not a class because record can be customized according to the specification of page templates. Each record in apps always extends EclibRecord or its extended class, so interface is needed to customize records.
At that time in that interface you want to record feature like getItems(), but if this is a class it can't be used.

It is frequently validated with jakarta validation. So it should have features below.

  • To resolve item name from propertyPath. getItems() is used for it.
    It's used especially for error message to users.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an array of items.
    default Item
    getItem(String itemPropertyPath)
    Returns EclibItem from EclibItem[] and fieldId.
    default Item
    getNewItem(String itemPropertyPath)
    Returns a new instance.
    default Item[]
    mergeItems(Item[] items1, Item[] items2)
    Merge common items and record dependent items.
  • Method Details

    • customizedItems

      @Nullable Item[] customizedItems()
      Returns an array of items.
    • getNewItem

      @Nonnull default Item getNewItem(@RequireNonempty String itemPropertyPath)
      Returns a new instance.
    • getItem

      @Nonnull default Item getItem(@RequireNonempty String itemPropertyPath)
      Returns EclibItem from EclibItem[] and fieldId.
      Parameters:
      itemPropertyPath - itemPropertyPath
      Returns:
      HtmlItem
    • mergeItems

      @Nonnull default Item[] mergeItems(@Nullable Item[] items1, @Nullable Item[] items2)
      Merge common items and record dependent items.

      This is an utility method so it can be defined in Util class, but it's frequently used in record instance and not used outside so let it be defined here.