Class AbstractModuleItem<T>

    • Constructor Detail

      • AbstractModuleItem

        public AbstractModuleItem​(ModuleInfo info)
    • Method Detail

      • getGenericType

        public Type getGenericType()
        Description copied from interface: ModuleItem
        Gets the type of the item, including Java generic parameters.

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

        Specified by:
        getGenericType in interface ModuleItem<T>
        See Also:
        Field.getGenericType()
      • isInput

        public boolean isInput()
        Description copied from interface: ModuleItem
        Gets whether the item is a module input.
        Specified by:
        isInput in interface ModuleItem<T>
      • isOutput

        public boolean isOutput()
        Description copied from interface: ModuleItem
        Gets whether the item is a module output.
        Specified by:
        isOutput in interface ModuleItem<T>
      • isAutoFill

        public boolean isAutoFill()
        Description copied from interface: ModuleItem
        Gets whether the item value is allowed to be auto-filled.
        Specified by:
        isAutoFill in interface ModuleItem<T>
      • isRequired

        public boolean isRequired()
        Description copied from interface: ModuleItem
        Gets whether the item value must be specified (i.e., no default).
        Specified by:
        isRequired in interface ModuleItem<T>
      • isPersisted

        public boolean isPersisted()
        Description copied from interface: ModuleItem
        Gets whether to remember the most recent value of the parameter.
        Specified by:
        isPersisted in interface ModuleItem<T>
      • getPersistKey

        public String getPersistKey()
        Description copied from interface: ModuleItem
        Gets the key to use for saving the value persistently.
        Specified by:
        getPersistKey in interface ModuleItem<T>
      • loadValue

        @Deprecated
        public T loadValue()
        Deprecated.
        Returns the persisted value of a ModuleItem. Returns null if nothing has been persisted. It is the API user's responsibility to check the return value for null.
        Specified by:
        loadValue in interface ModuleItem<T>
        See Also:
        ModuleService.load(ModuleItem)
      • getInitializer

        public String getInitializer()
        Description copied from interface: ModuleItem
        Gets the function that is called to initialize the item's value.
        Specified by:
        getInitializer in interface ModuleItem<T>
      • getValidater

        public String getValidater()
        Description copied from interface: ModuleItem
        Gets the function that is called to validate the item's value.
        Specified by:
        getValidater in interface ModuleItem<T>
      • getCallback

        public String getCallback()
        Description copied from interface: ModuleItem
        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.

        Specified by:
        getCallback in interface ModuleItem<T>
      • getWidgetStyle

        public String getWidgetStyle()
        Description copied from interface: ModuleItem
        Gets the preferred widget style to use when rendering the item in a user interface.
        Specified by:
        getWidgetStyle in interface ModuleItem<T>
      • getMinimumValue

        public T getMinimumValue()
        Description copied from interface: ModuleItem
        Gets the minimum allowed value (if applicable).
        Specified by:
        getMinimumValue in interface ModuleItem<T>
      • getMaximumValue

        public T getMaximumValue()
        Description copied from interface: ModuleItem
        Gets the maximum allowed value (if applicable).
        Specified by:
        getMaximumValue in interface ModuleItem<T>
      • getSoftMinimum

        public T getSoftMinimum()
        Description copied from interface: ModuleItem
        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.

        Specified by:
        getSoftMinimum in interface ModuleItem<T>
      • getSoftMaximum

        public T getSoftMaximum()
        Description copied from interface: ModuleItem
        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.

        Specified by:
        getSoftMaximum in interface ModuleItem<T>
      • getStepSize

        public Number getStepSize()
        Description copied from interface: ModuleItem
        Gets the preferred step size to use when rendering the item in a user interface (if applicable).
        Specified by:
        getStepSize in interface ModuleItem<T>
      • getColumnCount

        public int getColumnCount()
        Description copied from interface: ModuleItem
        Gets the preferred width of the input field in characters (if applicable).
        Specified by:
        getColumnCount in interface ModuleItem<T>
      • getValue

        public T getValue​(Module module)
        Description copied from interface: ModuleItem
        Gets the item's current value with respect to the given module.
        Specified by:
        getValue in interface ModuleItem<T>
      • setValue

        public void setValue​(Module module,
                             T value)
        Description copied from interface: ModuleItem
        Sets the item's current value with respect to the given module.
        Specified by:
        setValue in interface ModuleItem<T>
      • getDelegateClass

        protected Class<?> getDelegateClass()