com.atlassian.jira.project
Class ProjectKeyRegexValidator

java.lang.Object
  extended by com.atlassian.jira.project.ProjectKeyRegexValidator
All Implemented Interfaces:
Validator

public class ProjectKeyRegexValidator
extends Object
implements Validator

Validates a project's regex. We can't do this exhaustively, so we:

  1. Make sure the new regex can match existing projects
  2. Check if the new regex matches a list of banned characters "naively", that is, construct strings with the banned character at the beginning, middle and end and see if the regex matches, rejecting it if so.
  3. Check if the new regex contains non-ascii characters

Since:
v4.4

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.validation.Validator
Validator.Result
 
Constructor Summary
ProjectKeyRegexValidator()
           
 
Method Summary
 Validator.Result validate(String value)
          Validate the given string to see if it passes and if not, why not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectKeyRegexValidator

public ProjectKeyRegexValidator()
Method Detail

validate

public Validator.Result validate(String value)
Description copied from interface: Validator
Validate the given string to see if it passes and if not, why not.

Specified by:
validate in interface Validator
Parameters:
value - all validation input is a String.
Returns:
A result that contains access to the details of the validation outcome.


Copyright © 2002-2012 Atlassian. All Rights Reserved.