Class ValidationUtilities

java.lang.Object
io.jenkins.plugins.util.ValidationUtilities

public class ValidationUtilities extends Object
Validates UI parameters. For the validated UI elements, also additional utility methods are provided.
Author:
Ullrich Hafner
  • Constructor Details

    • ValidationUtilities

      public ValidationUtilities()
  • Method Details

    • getAllCharsets

      public ComboBoxModel getAllCharsets()
      Returns all available character set names.
      Returns:
      all available character set names
    • getCharset

      public Charset getCharset(@CheckForNull String charset)
      Returns the default charset for the specified encoding string. If the default encoding is empty or null, or if the charset is not valid then the default encoding of the platform is returned.
      Parameters:
      charset - identifier of the character set
      Returns:
      the default charset for the specified encoding string
    • validateCharset

      public FormValidation validateCharset(String reportEncoding)
      Performs on-the-fly validation of the character encoding.
      Parameters:
      reportEncoding - the character encoding
      Returns:
      the validation result
    • ensureValidId

      public void ensureValidId(String id)
      Ensures that the specified ID is valid.
      Parameters:
      id - the custom ID of the tool
      Throws:
      IllegalArgumentException - if the ID is not valid
    • validateId

      public FormValidation validateId(String id)
      Performs on-the-fly validation of the ID.
      Parameters:
      id - the custom ID of the tool
      Returns:
      the validation result
    • doCheckPattern

      public FormValidation doCheckPattern(AbstractProject<?,?> project, String pattern)
      Performs on-the-fly validation on the ant pattern for input files.
      Parameters:
      project - the project that is configured
      pattern - the file pattern
      Returns:
      the validation result