Class Parameters

java.lang.Object
net.sf.basedb.plugins.util.Parameters

public class Parameters
extends Object
Utility class for creating some useful plug-in parameters.
Version:
2.6
Author:
nicklas
Last modified
$Date: 2019-03-08 15:31:06 +0100 (fre, 08 mars 2019) $
  • Field Details

  • Constructor Details

    • Parameters

      public Parameters()
  • Method Details

    • errorSection

      public static final PluginParameter<String> errorSection​(String title, String description)
      Create a parameter starting an error section.
      Parameters:
      title - The title of the section, or null for the default (Error handling)
      description - A description, or null for the default
      Returns:
      A new plug-in parameter
    • defaultError

      public static final PluginParameter<String> defaultError​(String title, String description, String defaultValue, String... options)
      Create the default error handling parameter.
      Parameters:
      title - The title for the parameter or null for the default (Default error handling)
      description - The description or null for the default
      defaultValue - The default value or null to use "fail"
      options - Options to select from, if null or empty, the "fail" and "skip" are used
      Returns:
      A new plug-in parameter
    • stringTooLongError

      public static final PluginParameter<String> stringTooLongError​(String title, String description, String defaultValue, String... options)
      Create the parameter for handling too long strings.
      Parameters:
      title - The title for the parameter or null for the default (String too long)
      description - The description or null for the default
      defaultValue - The default value or null to use the default error handling
      options - Options to select from, if null or empty, the "crop", "fail" and "skip" are used
      Returns:
      A new plug-in parameter
    • numberFormatError

      public static final PluginParameter<String> numberFormatError​(String title, String description, String defaultValue, String... options)
      Create the parameter for handling invalid numbers.
      Parameters:
      title - The title for the parameter or null for the default (Invalid numeric value)
      description - The description or null for the default
      defaultValue - The default value or null to use the default error handling
      options - Options to select from, if null or empty, the "null", "fail" and "skip" are used
      Returns:
      A new plug-in parameter
    • dateFormatError

      public static final PluginParameter<String> dateFormatError​(String title, String description, String defaultValue, String... options)
      Create the parameter for handling invalid dates/timestamps.
      Parameters:
      title - The title for the parameter or null for the default (Invalid date)
      description - The description or null for the default
      defaultValue - The default value or null to use the default error handling
      options - Options to select from, if null or empty, the "null", "fail" and "skip" are used
      Returns:
      A new plug-in parameter
      Since:
      2.16
    • invalidUseOfNullError

      public static final PluginParameter<String> invalidUseOfNullError​(String title, String description, String defaultValue, String... options)
      Create the parameter for handling required but missing values.
      Parameters:
      title - The title for the parameter or null for the default (Missing a required value)
      description - The description or null for the default
      defaultValue - The default value or null to use the default error handling
      options - Options to select from, if null or empty, the "fail" and "skip" are used
      Returns:
      A new plug-in parameter
    • numberOutOfRangeError

      public static final PluginParameter<String> numberOutOfRangeError​(String title, String description, String defaultValue, String... options)
      Create the parameter for handling numeric values that are outside the allowed range.
      Parameters:
      title - The title for the parameter or null for the default (Numeric value out of range)
      description - The description or null for the default
      defaultValue - The default value or null to use the default error handling
      options - Options to select from, if null or empty, the "fail" and "skip" are used
      Returns:
      A new plug-in parameter
    • charsetParameter

      public static final PluginParameter<String> charsetParameter​(String title, String description, String defaultValue)
      See Also:
      charsetParameter(String, String, String, boolean)
    • charsetParameter

      public static final PluginParameter<String> charsetParameter​(String title, String description, String defaultValue, boolean includeFallbackTypes)
      Parameter definition that asks for the character encoding used in the file that is imported. This can be both a job parameter and a configuration parameter. The implementation first checks in the job parameter and if not found in the configuration parameter. If still not found the default charset is used as specified by Config.getCharset().
      Parameters:
      title - The title to use for the parameter or null to use the default label (Character set)
      description - The description to use for the parameter or null to use the default description
      defaultValue - The default value for the character set or null to use the system default
      includeFallbackTypes - TRUE to include UTF-8 fallback types in the list, FALSE to not
      Since:
      3.15
    • decimalSeparatorParameter

      public static final PluginParameter<String> decimalSeparatorParameter​(String title, String description, String defaultValue)
      Parameter definition that asks for the decimal separator used by numeric values when parsed from strings. If no specific value is used number parsing is done by Float.valueOf or Double.valueOf.
      Parameters:
      title - The title to use for the parameter or null to use the default title (Decimal separator)
      description - The description to use for the parameter or null to use the default description
      defaultValue - The default value for the decimal separator
    • dateFormatParameter

      public static final PluginParameter<String> dateFormatParameter​(String title, String description, String defaultValue)
      Parameter definition that asks for the format used by date values when parsed from strings. See SimpleDateFormat for more info about template values.
      Parameters:
      title - The title to use for the parameter or null to use the default title (Date format)
      description - The description to use for the parameter or null to use the default description
      defaultValue - The default value for the date format
      Since:
      2.8
    • timestampFormatParameter

      public static final PluginParameter<String> timestampFormatParameter​(String title, String description, String defaultValue)
      Parameter definition that asks for the format used by timestamp values when parsed from strings. See SimpleDateFormat for more info about template values.
      Parameters:
      title - The title to use for the parameter or null to use the default title (Timestamp format)
      description - The description to use for the parameter or null to use the default description
      defaultValue - The default value for the timestamp format
      Since:
      2.16
    • logFileParameter

      public static PluginParameter<String> logFileParameter​(String title, String description, String defaultValue)
      Parameter definition that asks for the path to a log file that a plug-in can use for logging detailed information about it's progress.
      Parameters:
      title - The title to use for the parameter or null to use the default title (Log file)
      description - The description to use for the parameter or null to use the default description
      defaultValue - The default path
      Since:
      2.8
    • dryRunParameter

      public static PluginParameter<Boolean> dryRunParameter​(String title, String description, Boolean defaultValue)
      Parameter definition that enable/disable dry-run of a plug-in. A dry run should do everything the plug-in normally does, except that the result should not be committed to the database. A dry-run should be combined with a log file (see logFileParameter(String, String, String).
      Parameters:
      title - The title to use for the parameter or null to use the default title (Dry run)
      description - The description to use for the parameter or null to use the default description
      defaultValue - The default value
      Since:
      2.8
    • cloneParameter

      public static <T> PluginParameter<T> cloneParameter​(PluginParameter<T> pp, T defaultValue)
      Clone a plug-in parameter but give it a different default value.
      Parameters:
      pp - The plug-in parameter to clone
      defaultValue - The new default value
      Returns:
      The cloned plug-in parameter
      Since:
      2.15
    • childNameParameter

      public static PluginParameter<String> childNameParameter​(String label, String description, String defaultValue)
      Create a plugin parameter that asks for the name of the child bioassay set.
      Parameters:
      label - The label to use for the parameter or null to use the default label (Child name)
      description - The description to use for the parameter or null to use the default description (The name of the child bioassay set)
      defaultValue - The default value for the child name or null to use the default value (New bioassay set)
      Returns:
      A plugin parameter
      Since:
      2.15
    • childDescriptionParameter

      public static PluginParameter<String> childDescriptionParameter​(String label, String description, String defaultValue)
      Create a plugin parameter that asks for the description of the child bioassay set.
      Parameters:
      label - The label to use for the parameter or null to use the default label (Child description)
      description - The description to use for the parameter or null to use the default description (An optional description of the child bioassay set)
      defaultValue - The default value for the child name or null to not use any default value
      Returns:
      A plugin parameter
      Since:
      2.15
    • transformationNameParameter

      public static PluginParameter<String> transformationNameParameter​(String label, String description, String defaultValue)
      Create a plugin parameter that asks for the name of the transformation.
      Parameters:
      label - The label to use for the parameter or null to use the default label (Transformation name)
      description - The description to use for the parameter or null to use the default description (The name of the transformation)
      defaultValue - The default value for the transformation name or null to not use any default
      Returns:
      A plugin parameter
      Since:
      2.15