com.atlassian.jira.upgrade.tasks.jql
Class RelativeDateXmlHandler

java.lang.Object
  extended by com.atlassian.jira.upgrade.tasks.jql.RelativeDateXmlHandler
All Implemented Interfaces:
ClauseXmlHandler

public class RelativeDateXmlHandler
extends Object

Class that reads in old skool RelativeDateXmlHandler parameters. For example:

 <parameter class='com.atlassian.jira.issue.search.parameters.lucene.RelativeDateRangeParameter'>
   <created name='created:relative'>
   <previousOffset>259200000</previousOffset>
   <nextOffset>86400000</nextOffset>
   </created>
 </parameter>
 

Since:
v4.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.upgrade.tasks.jql.ClauseXmlHandler
ClauseXmlHandler.BestGuessConversionResult, ClauseXmlHandler.ConversionResult, ClauseXmlHandler.ConversionResultType, ClauseXmlHandler.FailedConversionNoValuesResult, ClauseXmlHandler.FailedConversionResult, ClauseXmlHandler.FullConversionResult, ClauseXmlHandler.NoOpConversionResult
 
Constructor Summary
RelativeDateXmlHandler(Collection<String> supportedXmlFieldNames)
           
 
Method Summary
 ClauseXmlHandler.ConversionResult convertXmlToClause(electric.xml.Element el)
          Produce a clause from the legacy, SearchParameter, XML storage format.
protected  String getLowerBound(String fieldName, electric.xml.Element element)
          Return the lower date from the parameter.
protected  String getUpperBound(String fieldName, electric.xml.Element element)
          Return the upper date from the parameters.
 boolean isSafeToNamifyValue()
          Some search parameters have values which when running through "namification" could lose precision or change the original meaning of the value.
protected  boolean xmlFieldIdSupported(String xmlFieldId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelativeDateXmlHandler

public RelativeDateXmlHandler(Collection<String> supportedXmlFieldNames)
Method Detail

getLowerBound

protected String getLowerBound(String fieldName,
                               electric.xml.Element element)
Return the lower date from the parameter. The return should be a value that can be placed directly into a Clause. Can return null to indicate that there is no bound.

Parameters:
fieldName - the field name of the generated clause
element - the element that is being parsed.
Returns:
the JQL string representation of the lower date. Can be null to indicate that there is no lower date.

getUpperBound

protected String getUpperBound(String fieldName,
                               electric.xml.Element element)
Return the upper date from the parameters. The return should be a value that can be converted directly into a Clause. Can return null to indicate that there is no bound.

Parameters:
fieldName - the field name of the generated clause
element - the element that is being parsed.
Returns:
the JQL string representation of the upper date. Can be null to indicate that there is no lower date.

convertXmlToClause

public ClauseXmlHandler.ConversionResult convertXmlToClause(electric.xml.Element el)
Description copied from interface: ClauseXmlHandler
Produce a clause from the legacy, SearchParameter, XML storage format.

Specified by:
convertXmlToClause in interface ClauseXmlHandler
Parameters:
el - XML element
Returns:
a Clause that corresponds to the search that is described by the XML, must not be null.

isSafeToNamifyValue

public boolean isSafeToNamifyValue()
Description copied from interface: ClauseXmlHandler
Some search parameters have values which when running through "namification" could lose precision or change the original meaning of the value. This flag indicates whether it is safe for the upgrade task to namify the values.

Specified by:
isSafeToNamifyValue in interface ClauseXmlHandler
Returns:
true if is safe to namify values produced by this handler; false otherwise.

xmlFieldIdSupported

protected boolean xmlFieldIdSupported(String xmlFieldId)


Copyright © 2002-2012 Atlassian. All Rights Reserved.