com.atlassian.bamboo.validation
Class ValidationServiceImpl

java.lang.Object
  extended by com.atlassian.bamboo.validation.ValidationServiceImpl
All Implemented Interfaces:
ValidationService

public class ValidationServiceImpl
extends Object
implements ValidationService


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.bamboo.validation.ValidationService
ValidationService.ValidationFunction, ValidationService.ValidationType
 
Field Summary
static int DATABASE_STRING_LIMIT
           
static Pattern FULL_JOB_KEY_PATTERN
           
static String ILLEGAL_NAME_CHARACTERS
           
static Pattern PARTIAL_JOB_KEY_PATTERN
           
 
Fields inherited from interface com.atlassian.bamboo.validation.ValidationService
FULL_JOB_KEY_REGEXP, PARTIAL_JOB_KEY_REGEXP
 
Constructor Summary
ValidationServiceImpl(com.opensymphony.xwork2.TextProvider textProvider)
           
 
Method Summary
 ErrorCollection validateDescription(String fieldName, String description)
          Validate the description field of any object.
 ErrorCollection validateKey(String fieldName, ValidationService.ValidationType type, String key, ValidationService.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FULL_JOB_KEY_PATTERN

public static final Pattern FULL_JOB_KEY_PATTERN

PARTIAL_JOB_KEY_PATTERN

public static final Pattern PARTIAL_JOB_KEY_PATTERN

ILLEGAL_NAME_CHARACTERS

public static final String ILLEGAL_NAME_CHARACTERS
See Also:
Constant Field Values

DATABASE_STRING_LIMIT

public static final int DATABASE_STRING_LIMIT
See Also:
Constant Field Values
Constructor Detail

ValidationServiceImpl

public ValidationServiceImpl(com.opensymphony.xwork2.TextProvider textProvider)
Method Detail

validateKey

@NotNull
public ErrorCollection validateKey(@NotNull
                                           String fieldName,
                                           @NotNull
                                           ValidationService.ValidationType type,
                                           @Nullable
                                           String key,
                                           ValidationService.ValidationFunction... functions)
Description copied from interface: ValidationService
Validate any String against Bamboo's generic rules for keys.

Specified by:
validateKey in interface ValidationService
Parameters:
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.

validateName

@NotNull
public ErrorCollection validateName(@NotNull
                                            String fieldName,
                                            @NotNull
                                            String errorPrefix,
                                            @Nullable
                                            String name)
Description copied from interface: ValidationService
Validate any String against Bamboo's generic rules for names.

Specified by:
validateName in interface ValidationService
Parameters:
fieldName - - the name of the field to add the errors to
errorPrefix - - the prefix to put in front of the standardised error keys. (e.g. "plan", "chain")
name - - the actual string to validate

validateDescription

@NotNull
public ErrorCollection validateDescription(@NotNull
                                                   String fieldName,
                                                   @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 interface ValidationService
Parameters:
fieldName - - the name of the field to add the errors to
description - - the actual text to validate


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.