Package io.jenkins.plugins.util
Class ValidationUtilities
java.lang.Object
io.jenkins.plugins.util.ValidationUtilities
Validates UI parameters. For the validated UI elements, also additional utility methods are provided.
- Author:
- Ullrich Hafner
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondoCheckPattern
(AbstractProject<?, ?> project, String pattern) Performs on-the-fly validation on the ant pattern for input files.void
ensureValidId
(String id) Ensures that the specified ID is valid.Returns all available character set names.getCharset
(String charset) Returns the default charset for the specified encoding string.validateCharset
(String reportEncoding) Performs on-the-fly validation of the character encoding.validateId
(String id) Performs on-the-fly validation of the ID.
-
Constructor Details
-
ValidationUtilities
public ValidationUtilities()
-
-
Method Details
-
getAllCharsets
Returns all available character set names.- Returns:
- all available character set names
-
getCharset
Returns the default charset for the specified encoding string. If the default encoding is empty ornull
, 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
Performs on-the-fly validation of the character encoding.- Parameters:
reportEncoding
- the character encoding- Returns:
- the validation result
-
ensureValidId
Ensures that the specified ID is valid.- Parameters:
id
- the custom ID of the tool- Throws:
IllegalArgumentException
- if the ID is not valid
-
validateId
Performs on-the-fly validation of the ID.- Parameters:
id
- the custom ID of the tool- Returns:
- the validation result
-
doCheckPattern
Performs on-the-fly validation on the ant pattern for input files.- Parameters:
project
- the project that is configuredpattern
- the file pattern- Returns:
- the validation result
-