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
Constructor and Description |
---|
ValidationServiceImpl(com.opensymphony.xwork2.TextProvider textProvider) |
Modifier and Type | Method and Description |
---|---|
ErrorCollection |
validateChainKey(String fieldName,
String chainKey,
ValidationFunction... functions)
|
ErrorCollection |
validateDescription(String fieldName,
String description)
Validate the description field of any object.
|
ErrorCollection |
validateJobKey(String fieldName,
String jobKey,
ValidationFunction... functions)
|
ErrorCollection |
validateKey(String fieldName,
ValidationService.ValidationType type,
String key,
ValidationFunction... functions)
Validate any String against Bamboo's generic rules for keys.
|
ErrorCollection |
validateName(String fieldName,
String errorPrefix,
String name)
Validate any String against Bamboo's generic rules for names.
|
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 ErrorCollection validateKey(@NotNull String fieldName, @NotNull ValidationService.ValidationType type, @Nullable String key, ValidationFunction... functions)
ValidationService
validateKey
in interface ValidationService
fieldName
- 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 ErrorCollection validateJobKey(@NotNull String fieldName, @Nullable String jobKey, ValidationFunction... functions)
ValidationService
validateJobKey
in interface ValidationService
fieldName
- 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 ErrorCollection validateChainKey(@NotNull String fieldName, @Nullable String chainKey, ValidationFunction... functions)
ValidationService
validateChainKey
in interface ValidationService
fieldName
- 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 ErrorCollection validateName(@NotNull String fieldName, @NotNull String errorPrefix, @Nullable String name)
ValidationService
validateName
in interface ValidationService
fieldName
- 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 ErrorCollection validateDescription(@NotNull String fieldName, @Nullable String description)
ValidationService
validateDescription
in interface ValidationService
fieldName
- the name of the field to add the errors todescription
- the actual text to validateCopyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.