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

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.SingleFieldSingleValueLuceneParameter
              extended by com.atlassian.jira.issue.search.parameters.lucene.StringRangeParameter
All Implemented Interfaces:
LuceneParameter, SearchParameter

public class StringRangeParameter
extends SingleFieldSingleValueLuceneParameter

Parameter that uses greater than and less than operators on a String


Field Summary
static String GREATER_THAN_PARAM
           
static String GREATER_THAN_SUFFIX
           
static String LESS_THAN_PARAM
           
static String LESS_THAN_SUFFIX
           
 
Constructor Summary
StringRangeParameter()
           
StringRangeParameter(String name, org.ofbiz.core.entity.EntityOperator operator, String string)
           
 
Method Summary
 String getName()
          Get issue field name.
 org.ofbiz.core.entity.EntityOperator getOperator()
           
 org.apache.lucene.search.Query getQuery(org.ofbiz.core.entity.GenericValue project, User searcher)
           
protected  String getQueryStringPrefix()
          Query parameter name, suitable for inclusion in URL.
 electric.xml.Element getXml()
          Return an XML elemnt representation of this search parameter.
protected  String getXmlElementName()
          For some parameters, the parameter name may not be a valid XML element name (eg, if it contains a ':' in the case of custom fields.
 boolean isValid()
          Returns true if this parameter is valid, false otherwise.
 void setName(String name)
          Specify issue field name to limit search by.
 void setOperator(org.ofbiz.core.entity.EntityOperator operator)
           
 void setXml(electric.xml.Element el)
          Initialise this search parameter using an XML element.
 
Methods inherited from class com.atlassian.jira.issue.search.parameters.AbstractSearchParameter
addValue, clearValues, equals, getQueryString, getValues, hashCode, 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, getQueryString, getValues
 

Field Detail

LESS_THAN_PARAM

public static final String LESS_THAN_PARAM
See Also:
Constant Field Values

GREATER_THAN_PARAM

public static final String GREATER_THAN_PARAM
See Also:
Constant Field Values

LESS_THAN_SUFFIX

public static final String LESS_THAN_SUFFIX
See Also:
Constant Field Values

GREATER_THAN_SUFFIX

public static final String GREATER_THAN_SUFFIX
See Also:
Constant Field Values
Constructor Detail

StringRangeParameter

public StringRangeParameter()

StringRangeParameter

public StringRangeParameter(String name,
                            org.ofbiz.core.entity.EntityOperator operator,
                            String string)
Method Detail

getName

public String getName()
Description copied from interface: SearchParameter
Get issue field name.

Specified by:
getName in interface SearchParameter
Overrides:
getName in class AbstractSearchParameter
Returns:
issue field name

getXmlElementName

protected String getXmlElementName()
Description copied from class: SingleFieldSingleValueLuceneParameter
For some parameters, the parameter name may not be a valid XML element name (eg, if it contains a ':' in the case of custom fields. For those parameters, you can override the element name here).

Overrides:
getXmlElementName in class SingleFieldSingleValueLuceneParameter
Returns:
The element name to describe this parameter. By default, it returns the same as AbstractSearchParameter.getName()

setName

public void setName(String name)
Description copied from interface: SearchParameter
Specify issue field name to limit search by. Either a predefined name (from IssueFieldConstants, or Field.getId().

Specified by:
setName in interface SearchParameter
Overrides:
setName in class AbstractSearchParameter
Parameters:
name - field name

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 SingleFieldSingleValueLuceneParameter
Returns:
a collection of Query objects.
Throws:
org.apache.lucene.queryParser.ParseException

getXml

public electric.xml.Element getXml()
Description copied from interface: SearchParameter
Return an XML elemnt representation of this search parameter.

Specified by:
getXml in interface SearchParameter
Overrides:
getXml in class SingleFieldSingleValueLuceneParameter
Returns:
XML element

setXml

public void setXml(electric.xml.Element el)
Description copied from interface: SearchParameter
Initialise this search parameter using an XML element.

Usual process is:

    SearchParameter param = new MySearchParameter();
    param.setXml(element);
 

Specified by:
setXml in interface SearchParameter
Overrides:
setXml in class AbstractSearchParameter
Parameters:
el - XML element

getOperator

public org.ofbiz.core.entity.EntityOperator getOperator()

setOperator

public void setOperator(org.ofbiz.core.entity.EntityOperator operator)

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 SingleFieldSingleValueLuceneParameter
Returns:
true if valid, false otherwise

getQueryStringPrefix

protected String getQueryStringPrefix()
Description copied from class: AbstractSearchParameter
Query parameter name, suitable for inclusion in URL. Note that implementations of this method should ensure that the values that they return are URLEncoded, perhaps using the URLEncoder.encode(String) method.

Overrides:
getQueryStringPrefix in class AbstractSearchParameter
Returns:
nothing, always throws UnsupportedOperationException


Copyright © 2002-2009 Atlassian. All Rights Reserved.