Package com.atlassian.bamboo.validation
Class ValidationServiceImpl
java.lang.Object
com.atlassian.bamboo.validation.ValidationServiceImpl
- All Implemented Interfaces:
ValidationService
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.bamboo.validation.ValidationService
ValidationService.ValidationType
-
Field Summary
Fields inherited from interface com.atlassian.bamboo.validation.ValidationService
CHAIN_KEY_REGEXP, FULL_JOB_KEY_REGEXP, PARTIAL_JOB_KEY_REGEXP, PROJECT_KEY_REGEXP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@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 validProject
key.
-
Field Details
-
PARTIAL_JOB_KEY_PATTERN
-
ILLEGAL_NAME_CHARACTERS
- See Also:
-
DATABASE_STRING_LIMIT
public static final int DATABASE_STRING_LIMIT- See Also:
-
-
Constructor Details
-
ValidationServiceImpl
public ValidationServiceImpl(com.opensymphony.xwork2.TextProvider textProvider)
-
-
Method Details
-
validateKey
@NotNull public @NotNull ErrorCollection validateKey(@NotNull @NotNull String fieldName, @NotNull @NotNull ValidationService.ValidationType type, @Nullable @Nullable String key, ValidationFunction... functions) Description copied from interface:ValidationService
Validate any String against Bamboo's generic rules for keys.- Specified by:
validateKey
in interfaceValidationService
- Parameters:
fieldName
- the name of the field to add the errors to.type
- theValidationService.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.- See Also:
-
validateJobKey
@NotNull public @NotNull ErrorCollection validateJobKey(@NotNull @NotNull String fieldName, @Nullable @Nullable String jobKey, ValidationFunction... functions) Description copied from interface:ValidationService
- Specified by:
validateJobKey
in interfaceValidationService
- Parameters:
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.- See Also:
-
validateChainKey
@NotNull public @NotNull ErrorCollection validateChainKey(@NotNull @NotNull String fieldName, @Nullable @Nullable String chainKey, ValidationFunction... functions) Description copied from interface:ValidationService
- Specified by:
validateChainKey
in interfaceValidationService
- Parameters:
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.- See Also:
-
validateProjectKey
@NotNull public @NotNull ErrorCollection validateProjectKey(@NotNull @NotNull String fieldName, @Nullable @Nullable String projectKey, ValidationFunction... functions) Description copied from interface:ValidationService
Verify any String that it is a validProject
key.- Specified by:
validateProjectKey
in interfaceValidationService
- Parameters:
fieldName
- 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.- See Also:
-
validateName
@NotNull public @NotNull ErrorCollection validateName(@NotNull @NotNull String fieldName, @NotNull @NotNull String errorPrefix, @Nullable @Nullable String name) Description copied from interface:ValidationService
Validate any String against Bamboo's generic rules for names.- Specified by:
validateName
in interfaceValidationService
- Parameters:
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
-
validateDescription
@NotNull public @NotNull ErrorCollection validateDescription(@NotNull @NotNull String fieldName, @Nullable @Nullable String description) Description copied from interface:ValidationService
Validate the description field of any object. All it really does is check length- Specified by:
validateDescription
in interfaceValidationService
- Parameters:
fieldName
- the name of the field to add the errors todescription
- the actual text to validate
-