com.atlassian.jira.jql.util
Class JqlIssueKeySupportImpl

java.lang.Object
  extended by com.atlassian.jira.jql.util.JqlIssueKeySupportImpl
All Implemented Interfaces:
JqlIssueKeySupport

@InjectableComponent
public class JqlIssueKeySupportImpl
extends java.lang.Object
implements JqlIssueKeySupport

Default implementation of the JqlIssueKeySupport interface.

Since:
v4.0

Constructor Summary
JqlIssueKeySupportImpl()
           
 
Method Summary
 boolean isValidIssueKey(java.lang.String issueKey)
          Determines is the passed issue key is valid for JIRA.
 long parseKeyNum(java.lang.String issueKey)
          Return the numeric part of the issue key.
 java.lang.String parseProjectKey(java.lang.String issueKey)
          Return the project key part of the issue key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JqlIssueKeySupportImpl

public JqlIssueKeySupportImpl()
Method Detail

isValidIssueKey

public boolean isValidIssueKey(java.lang.String issueKey)
Description copied from interface: JqlIssueKeySupport
Determines is the passed issue key is valid for JIRA. It does *NOT* determine if the issue actually exists within JIRA.

Specified by:
isValidIssueKey in interface JqlIssueKeySupport
Parameters:
issueKey - the issue key to validate. Null will be considered an invalid key.
Returns:
true if the passed key is valid or false otherwise.

parseKeyNum

public long parseKeyNum(java.lang.String issueKey)
Description copied from interface: JqlIssueKeySupport
Return the numeric part of the issue key. Assumes that the passed key is valid. The method will return -1 on a parsing error, however, this cannot be used to determine if a key is valid as some invalid keys may parse correctly. The JqlIssueKeySupport.isValidIssueKey(String) method can be used to determine if a key is invalid or not.

Specified by:
parseKeyNum in interface JqlIssueKeySupport
Parameters:
issueKey - the issue key to parse. A null key will return -1.
Returns:
the numeric part of the key. Will return -1 to indicate a parsing error.

parseProjectKey

public java.lang.String parseProjectKey(java.lang.String issueKey)
Description copied from interface: JqlIssueKeySupport
Return the project key part of the issue key. Assumes that the passed key is valid. The method will return null on a parsing error, however, this cannot be used to determine if a key is valid as some invalid keys may parrse correctly. The JqlIssueKeySupport.isValidIssueKey(String) method can be used to determine if a key is invalid or not.

Specified by:
parseProjectKey in interface JqlIssueKeySupport
Parameters:
issueKey - the issue key to parse. A null key will return null.
Returns:
the project key part of the issue key, or null on a parsing error.


Copyright © 2002-2010 Atlassian. All Rights Reserved.