Interface ModuleItem<T>

    • Method Detail

      • getType

        Class<T> getType()
        Gets the type of the item.
      • getGenericType

        Type getGenericType()
        Gets the type of the item, including Java generic parameters.

        For many modules, this may be the same Class object returned by getType(), but some module inputs or outputs may be backed by a generic type such as List<String> or Iterable<Integer>.

        See Also:
        Field.getGenericType()
      • getIOType

        ItemIO getIOType()
        Gets the input/output type of the item.
      • isInput

        boolean isInput()
        Gets whether the item is a module input.
      • isOutput

        boolean isOutput()
        Gets whether the item is a module output.
      • getVisibility

        ItemVisibility getVisibility()
        Gets the visibility of the item.
      • isAutoFill

        boolean isAutoFill()
        Gets whether the item value is allowed to be auto-filled.
      • isRequired

        boolean isRequired()
        Gets whether the item value must be specified (i.e., no default).
      • isPersisted

        boolean isPersisted()
        Gets whether to remember the most recent value of the parameter.
      • getPersistKey

        String getPersistKey()
        Gets the key to use for saving the value persistently.
      • getInitializer

        String getInitializer()
        Gets the function that is called to initialize the item's value.
      • getValidater

        String getValidater()
        Gets the function that is called to validate the item's value.
      • validateMessage

        default String validateMessage​(Module module)
        Validates this item's value in the given module, returning any error message rather than throwing.

        The validation function may signal failure either by throwing an exception or by returning a non-empty String error message. This method catches both cases and returns the error message as a string, or null if the value is valid.

        Returns:
        an error message if the value is invalid, or null if valid.
        See Also:
        getValidater(), validate(Module)
      • getCallback

        String getCallback()
        Gets the function that is called whenever this item changes.

        This mechanism enables interdependent items of various types. For example, two int parameters "width" and "height" could update each other when another boolean "Preserve aspect ratio" flag is set.

      • getWidgetStyle

        String getWidgetStyle()
        Gets the preferred widget style to use when rendering the item in a user interface.
      • getDefaultValue

        T getDefaultValue()
        Gets the default value.
      • getMinimumValue

        T getMinimumValue()
        Gets the minimum allowed value (if applicable).
      • getMaximumValue

        T getMaximumValue()
        Gets the maximum allowed value (if applicable).
      • getSoftMinimum

        T getSoftMinimum()
        Gets the "soft" minimum value (if applicable).

        The soft minimum is a hint for use in bounded scenarios, such as rendering in a user interface with a slider or scroll bar widget; the parameter value will not actually be clamped to the soft bounds, but they may be used in certain circumstances where appropriate.

      • getSoftMaximum

        T getSoftMaximum()
        Gets the "soft" maximum value (if applicable).

        The soft maximum is a hint for use in bounded scenarios, such as rendering in a user interface with a slider or scroll bar widget; the parameter value will not actually be clamped to the soft bounds, but they may be used in certain circumstances where appropriate.

      • getStepSize

        Number getStepSize()
        Gets the preferred step size to use when rendering the item in a user interface (if applicable).
      • getColumnCount

        int getColumnCount()
        Gets the preferred width of the input field in characters (if applicable).
      • getChoices

        List<T> getChoices()
        Gets the list of possible values.
      • getValue

        T getValue​(Module module)
        Gets the item's current value with respect to the given module.
      • setValue

        void setValue​(Module module,
                      T value)
        Sets the item's current value with respect to the given module.