com.atlassian.jira.plugin.versionpanel
Class VersionContextImpl

java.lang.Object
  extended by com.atlassian.jira.plugin.versionpanel.VersionContextImpl
All Implemented Interfaces:
VersionContext

public class VersionContextImpl
extends Object
implements VersionContext

Maintains the current context for a version. This includes the version itself, version type (fixfor, affects, custom version field) and searchParameter (to be retrieved via the field's searcher.

Since:
v3.10

Constructor Summary
VersionContextImpl(Version version, String fieldId, String i18nKey)
          Constructs an instance for this class.
 
Method Summary
 SearchRequest createSearchRequest(SearchRequest sr)
          Creates a new search request for this version context.
 String getFieldId()
          Returns field id as String
 String getI18nKey()
          Returns message resource key for this version type
 Project getProject()
          convenience method to get the project from the version.
 String getQueryString()
          Returns a query string parameter to append to the IssueNavigator URL for field id equal to IssueFieldConstants.FIX_FOR_VERSIONS.
protected  SearchParameter getSearchParameter()
           
 Version getVersion()
          Returns version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersionContextImpl

public VersionContextImpl(Version version,
                          String fieldId,
                          String i18nKey)
Constructs an instance for this class.

Parameters:
version - The version at the center of this context
fieldId - The field Id (i.e. Fix for version), takes one of constants defined in IssueFieldConstants
i18nKey - The i18n key to refer to this version type in the title
See Also:
IssueFieldConstants
Method Detail

getProject

public Project getProject()
Description copied from interface: VersionContext
convenience method to get the project from the version.

Specified by:
getProject in interface VersionContext
Returns:
a Project

getQueryString

public String getQueryString()
Returns a query string parameter to append to the IssueNavigator URL for field id equal to IssueFieldConstants.FIX_FOR_VERSIONS. For any other throws UnsupportedOperationException.

Specified by:
getQueryString in interface VersionContext
Returns:
a query string parameter to append to the IssueNavigator URL

getVersion

public Version getVersion()
Description copied from interface: VersionContext
Returns version

Specified by:
getVersion in interface VersionContext
Returns:
version

getFieldId

public String getFieldId()
Description copied from interface: VersionContext
Returns field id as String

Specified by:
getFieldId in interface VersionContext
Returns:
field id as String

getI18nKey

public String getI18nKey()
Description copied from interface: VersionContext
Returns message resource key for this version type

Specified by:
getI18nKey in interface VersionContext
Returns:
message resource key for this version type

createSearchRequest

public SearchRequest createSearchRequest(SearchRequest sr)
Creates a new search request for this version context. It clones the SearchRequest and appends the a new FixForParameter for IssueFieldConstants.FIX_FOR_VERSIONS field id. Throws UnsupportedOperationException for all other types.

Specified by:
createSearchRequest in interface VersionContext
Parameters:
sr - The old searchrequest. This will be cloned
Returns:
new search request for this version context

getSearchParameter

protected SearchParameter getSearchParameter()


Copyright © 2002-2009 Atlassian. All Rights Reserved.