com.atlassian.jira.issue.search.parameters.lucene
Class AbstractVersionParameter

java.lang.Object
  extended by com.atlassian.jira.issue.search.parameters.AbstractSearchParameter
      extended by com.atlassian.jira.issue.search.parameters.AbstractLuceneParameter
          extended by com.atlassian.jira.issue.search.parameters.lucene.SingleFieldMultiValueLuceneParameter
              extended by com.atlassian.jira.issue.search.parameters.lucene.LongListParameter
                  extended by com.atlassian.jira.issue.search.parameters.lucene.AbstractVersionParameter
All Implemented Interfaces:
LuceneParameter, SearchParameter
Direct Known Subclasses:
FixForParameter, VersionParameter

public abstract class AbstractVersionParameter
extends LongListParameter


Field Summary
static int ANY_RELEASED_VERSION
           
static int ANY_UNRELEASED_VERSION
           
static int ANY_VERSION
          Deprecated. since v3.11 this is really badly named, it actually means that the is no version set at all!
static int NO_VERSION
           
 
Constructor Summary
AbstractVersionParameter()
          We need a blank constructor here as subclasses' default constructors are invoked by reflection in SearchRequest.init(electric.xml.Document)
AbstractVersionParameter(Collection entities)
          Instantiate with a list of Versions, GenericValues, or Long ids.
 
Method Summary
 org.apache.lucene.search.Query getQuery(org.ofbiz.core.entity.GenericValue project, User searcher)
           
 boolean isValid()
          Returns true if this parameter is valid, false otherwise.
protected  boolean isValidVersionId(Long id)
          Validates whether the id is an allowed value, either a real id or a magic number.
 
Methods inherited from class com.atlassian.jira.issue.search.parameters.lucene.LongListParameter
getXml, setXml
 
Methods inherited from class com.atlassian.jira.issue.search.parameters.lucene.SingleFieldMultiValueLuceneParameter
constructQueryFromValues, equals, getOccurance, hashCode, isAndQuery, setAndQuery
 
Methods inherited from class com.atlassian.jira.issue.search.parameters.AbstractSearchParameter
addValue, clearValues, getName, getQueryString, getQueryStringPrefix, getValues, setName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.issue.search.SearchParameter
addValue, getName, getQueryString, getValues, setName
 

Field Detail

NO_VERSION

public static final int NO_VERSION
See Also:
Constant Field Values

ANY_UNRELEASED_VERSION

public static final int ANY_UNRELEASED_VERSION
See Also:
Constant Field Values

ANY_RELEASED_VERSION

public static final int ANY_RELEASED_VERSION
See Also:
Constant Field Values

ANY_VERSION

public static final int ANY_VERSION
Deprecated. since v3.11 this is really badly named, it actually means that the is no version set at all!
See Also:
Constant Field Values
Constructor Detail

AbstractVersionParameter

public AbstractVersionParameter()
We need a blank constructor here as subclasses' default constructors are invoked by reflection in SearchRequest.init(electric.xml.Document)


AbstractVersionParameter

public AbstractVersionParameter(Collection entities)
Instantiate with a list of Versions, GenericValues, or Long ids.

Parameters:
entities - collection of entities
Method Detail

getQuery

public org.apache.lucene.search.Query getQuery(org.ofbiz.core.entity.GenericValue project,
                                               User searcher)
                                        throws org.apache.lucene.queryParser.ParseException
Specified by:
getQuery in interface LuceneParameter
Overrides:
getQuery in class SingleFieldMultiValueLuceneParameter
Returns:
a collection of Query objects.
Throws:
org.apache.lucene.queryParser.ParseException

isValid

public boolean isValid()
Description copied from interface: SearchParameter
Returns true if this parameter is valid, false otherwise.

Specified by:
isValid in interface SearchParameter
Overrides:
isValid in class LongListParameter
Returns:
true if valid, false otherwise

isValidVersionId

protected boolean isValidVersionId(Long id)
Validates whether the id is an allowed value, either a real id or a magic number. Magic values are ANY_RELEASED_VERSION, ANY_UNRELEASED_VERSION, ANY_VERSION

Parameters:
id - the id.
Returns:
true only if the id is valid.


Copyright © 2002-2008 Atlassian. All Rights Reserved.