public class ValidationServiceImpl extends Object implements ValidationService
ValidationService.ValidationType| Modifier and Type | Field and Description |
|---|---|
static int |
DATABASE_STRING_LIMIT |
static String |
ILLEGAL_NAME_CHARACTERS |
static Pattern |
PARTIAL_JOB_KEY_PATTERN |
CHAIN_KEY_REGEXP, FULL_JOB_KEY_REGEXP, PARTIAL_JOB_KEY_REGEXP, PROJECT_KEY_REGEXP| Constructor and Description |
|---|
ValidationServiceImpl(com.opensymphony.xwork2.TextProvider textProvider) |
| Modifier and Type | Method and Description |
|---|---|
@NotNull ErrorCollection |
validateChainKey(@NotNull String fieldName,
@Nullable String chainKey,
ValidationFunction... functions)
|
@NotNull ErrorCollection |
validateDescription(@NotNull String fieldName,
@Nullable String description)
Validate the description field of any object.
|
@NotNull ErrorCollection |
validateJobKey(@NotNull String fieldName,
@Nullable String jobKey,
ValidationFunction... functions)
|
@NotNull ErrorCollection |
validateKey(@NotNull String fieldName,
@NotNull ValidationService.ValidationType type,
@Nullable String key,
ValidationFunction... functions)
Validate any String against Bamboo's generic rules for keys.
|
@NotNull ErrorCollection |
validateName(@NotNull String fieldName,
@NotNull String errorPrefix,
@Nullable String name)
Validate any String against Bamboo's generic rules for names.
|
@NotNull ErrorCollection |
validateProjectKey(@NotNull String fieldName,
@Nullable String projectKey,
ValidationFunction... functions)
Verify any String that it is a valid
Project key. |
public static final Pattern PARTIAL_JOB_KEY_PATTERN
public static final String ILLEGAL_NAME_CHARACTERS
public static final int DATABASE_STRING_LIMIT
public ValidationServiceImpl(com.opensymphony.xwork2.TextProvider textProvider)
@NotNull public @NotNull ErrorCollection validateKey(@NotNull @NotNull String fieldName, @NotNull @NotNull ValidationService.ValidationType type, @Nullable @Nullable String key, ValidationFunction... functions)
ValidationServicevalidateKey in interface ValidationServicefieldName - the name of the field to add the errors to.type - the ValidationService.ValidationType the key pertains to.key - the actual string to validate.functions - additional validation functions to run if all generic rules are satisfied. Functions are run in
the order they are provided. If a function adds an error to the error collection, subsequent
functions will not be run.ValidationFunctionFactory@NotNull public @NotNull ErrorCollection validateJobKey(@NotNull @NotNull String fieldName, @Nullable @Nullable String jobKey, ValidationFunction... functions)
ValidationServicevalidateJobKey in interface ValidationServicefieldName - the name of the field to add the errors to.jobKey - the actual string to validate.functions - additional validation functions to run if all generic rules are satisfied. Functions are run in
the order they are provided. If a function adds an error to the error collection, subsequent
functions will not be run.ValidationFunctionFactory@NotNull public @NotNull ErrorCollection validateChainKey(@NotNull @NotNull String fieldName, @Nullable @Nullable String chainKey, ValidationFunction... functions)
ValidationServicevalidateChainKey in interface ValidationServicefieldName - the name of the field to add the errors to.chainKey - the actual string to validate.functions - additional validation functions to run if all generic rules are satisfied. Functions are run in
the order they are provided. If a function adds an error to the error collection, subsequent
functions will not be run.ValidationFunctionFactory@NotNull public @NotNull ErrorCollection validateProjectKey(@NotNull @NotNull String fieldName, @Nullable @Nullable String projectKey, ValidationFunction... functions)
ValidationServiceProject key.validateProjectKey in interface ValidationServicefieldName - the name of the field to add the errors toprojectKey - the actual string to validatefunctions - additional validation functions to run if all generic rules are satisfied. Functions are run in
the order they are provided. If a function adds an error to the error collection, subsequent
functions will not be run.ValidationFunctionFactory@NotNull public @NotNull ErrorCollection validateName(@NotNull @NotNull String fieldName, @NotNull @NotNull String errorPrefix, @Nullable @Nullable String name)
ValidationServicevalidateName in interface ValidationServicefieldName - the name of the field to add the errors toerrorPrefix - the prefix to put in front of the standardised error keys. (e.g. "plan", "chain")name - the actual string to validate@NotNull public @NotNull ErrorCollection validateDescription(@NotNull @NotNull String fieldName, @Nullable @Nullable String description)
ValidationServicevalidateDescription in interface ValidationServicefieldName - the name of the field to add the errors todescription - the actual text to validateCopyright © 2023 Atlassian Software Systems Pty Ltd. All rights reserved.