Class EclibItem

java.lang.Object
jp.ecuacion.lib.core.item.EclibItem

public class EclibItem extends Object
Stores item attributes.

To understand details on item, see naming-convention.md

  • Field Details

    • itemPropertyPath

      @Nonnull protected String itemPropertyPath
      Is the ID string of an item.

      rootRecordName part (= far left part) can be omitted. Namely it can be "name" or "dept.name" when the propertyPath with rootRecordName (= also called "recordPropertyPath") is "acc.name" or "acc.dept.name" where "acc" is the rootRecordName.

    • itemNameKeyClass

      protected String itemNameKeyClass
      Is a class part (= left part) of itemNameKey. (like "acc" from itemNameKey: "acc.name")
    • itemNameKeyField

      protected String itemNameKeyField
      Is a field part (= right part) of itemNameKey. (like "name" from itemNameKey: "acc.name")
    • showsValue

      protected boolean showsValue
      Is false when the value should not be open to public (like password).

      Default value is true.

  • Constructor Details

    • EclibItem

      public EclibItem(@RequireNonempty String itemPropertyPath)
      Constructs a new instance with itemPropertyPath.

      You cannot set recordPropertyPath here. Setting it caauses a duplication of rootRecordName and it cannot be found.

      Parameters:
      itemPropertyPath - itemPropertyPath
  • Method Details

    • itemNameKey

      public EclibItem itemNameKey(@RequireNonempty String itemNameKey)
      Sets itemNameKey and returns this for method chain.

      The format of itemNameKey is the same as itemNameKey, which is like "acc.name", always has one dot (not more than one) in the middle of the string.
      But the argument of the method can be like "name", itemNameKeyField only. In that case the value of itemnameKeyClass is determined by the rule written at getItemNameKey(rootRecordName) javadoc.

      Parameters:
      itemNameKey - itemNameKey
      Returns:
      Item
    • getItemPropertyPath

      public String getItemPropertyPath()
    • setsItemNameKeyClassExplicitly

      public boolean setsItemNameKeyClassExplicitly()
      Returns whether the itemNameKeyClass is set explicitly.
      Returns:
      boolean
    • getItemNameKey

      @Nonnull public String getItemNameKey(@Nullable String defaultItemNameKeyClass)
      Returns itemNameKey value.

      There can be 3 candidates for itemNameKeyClass,
      1: itemNameKeyClass part of itemNameKey set by itemNameKey(itemNameKey) if it exists.
      2: part of itemPropertyPath if it has ".".
      3: defaultItemNameKeyClass set to getItemNameKey(defaultItemNameKeyClass) if it is not empty.
      4: uncapitalized className

      Notice that the return value of this method does not consider @ItemNameKeyClass annotations, which means the return value should not be used for resolution of itemName directly. Use EclibRecord#getItemNameKey() for it.

      Returns:
      itemNameKeyFieldForName
    • getItemNameKey

      @Nonnull public String getItemNameKey()
      Returns itemNameKey value.

      See getItemNameKey(@Nullable String defaultItemNameKeyClass) with defaultItemNameKeyClass = null.

    • hideValue

      public EclibItem hideValue()
      Hides value from error messages and so on.
    • getShowsValue

      public boolean getShowsValue()