Interface EclibItemContainer


public interface EclibItemContainer
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 Details

    • getItems

      @Nullable EclibItem[] getItems()
      Returns an array of items.
    • getNewItem

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

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

      @Nonnull default EclibItem[] mergeItems(@Nullable EclibItem[] items1, @Nullable EclibItem[] 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.