com.raritantechnologies.searchApp.resultComparators
Class DateFieldMatcher

java.lang.Object
  extended bycom.raritantechnologies.searchApp.resultComparators.DateFieldMatcher
All Implemented Interfaces:
IConfigurable, IResultMatcher

public class DateFieldMatcher
extends java.lang.Object
implements IResultMatcher

Matches on a single IResult field interpreted as a Date/Time. Can be configured to match "ON", "AFTER", "ON OR AFTER", "ON OR BEFORE", or "BEFORE". (Note: To do date range matching use two DateFieldMatchers combined by a ResultAndMatcher) or use a TimePeriodResultMatcher, which is capable of doing relative time period matching (e.g. 'last two weeks' or '1 to 5 days ago').

XML Configuration Template:
   <ResultMatcher class="com.raritantechnologies.searchApp.resultComparators.DateFieldMatcher" 
                        fieldName="itsFieldName"
                        matchDate="04/24/2003"
                        dateFormat="MM/DD/YYYY"
                        matchCriterion="ON|AFTER|BEFORE|ON OR AFTER|ON OR BEFORE" />
 

Alternatively, can specify a date relative to the current day:

   <ResultMatcher class="com.raritantechnologies.searchApp.resultComparators.DateFieldMatcher" 
                        fieldName="itsFieldName"
                        matchDate="today| n days ago|n weeks ago|n months ago"
                        matchCriterion="ON|AFTER|BEFORE|ON OR AFTER|ON OR BEFORE" />
 

Developed by Raritan Technologies .

Author:
Ted Sullivan

Field Summary
 
Fields inherited from interface com.raritantechnologies.searchApp.IResultMatcher
TEMPLATE
 
Constructor Summary
DateFieldMatcher()
           
 
Method Summary
 boolean equals(ILoginInfo user, IResult result)
           
 java.lang.String getConfigurationXML()
           
 java.lang.String getConfigurationXML(java.lang.String configurationTemplate)
           
 java.lang.String getDateFormat(java.lang.String dateFormat)
           
 java.lang.String getFieldID()
           
 java.lang.String getMatchCriteria()
           
 long getMatchTime()
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void setDateFormat(java.lang.String dateFormat)
           
 void setFieldID(java.lang.String fieldID)
           
 void setMatchCriteria(java.lang.String matchCriteria)
           
 void setMatchTime(long matchTime)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateFieldMatcher

public DateFieldMatcher()
Method Detail

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IConfigurable

equals

public boolean equals(ILoginInfo user,
                      IResult result)
Specified by:
equals in interface IResultMatcher

setFieldID

public void setFieldID(java.lang.String fieldID)

getFieldID

public java.lang.String getFieldID()

setDateFormat

public void setDateFormat(java.lang.String dateFormat)

getDateFormat

public java.lang.String getDateFormat(java.lang.String dateFormat)

setMatchTime

public void setMatchTime(long matchTime)

getMatchTime

public long getMatchTime()

setMatchCriteria

public void setMatchCriteria(java.lang.String matchCriteria)

getMatchCriteria

public java.lang.String getMatchCriteria()

getConfigurationXML

public java.lang.String getConfigurationXML()
Specified by:
getConfigurationXML in interface IResultMatcher

getConfigurationXML

public java.lang.String getConfigurationXML(java.lang.String configurationTemplate)
Specified by:
getConfigurationXML in interface IResultMatcher