com.raritantechnologies.searchApp.resultComparators
Class QueryResultMatcher
java.lang.Object
com.raritantechnologies.searchApp.resultComparators.QueryResultMatcher
- All Implemented Interfaces:
- IConfigurable, IQueryResultMatcher, IResultMatcher
- public class QueryResultMatcher
- extends java.lang.Object
- implements IResultMatcher, IQueryResultMatcher
IResultMatcher
that uses a set of name=value pairs as match criteria. Field match criterion can be
specified either by specifying a match value or by including an IComparator element.
In addition, an optional IStringFilter element can be specified to normalize result
values prior to comparison.
XML Configuration Template:
<ResultMatcher class="com.raritantechnologies.searchApp.resultComparators.QueryResultMatcher"
isAnd="true(default)|false" >
<Fields>
<Field ID="[ query field ]" value="[ its value ]" rule="[MATCH|CONTAINS]" />
<Field ID="[ query field ]" resultFields="[ optional list of results fields to match query value ]" />
<!-- Match criterion can be specified using an IComparator element: -->
<Field ID="[another field]" >
<Comparator class="[ class of com.raritantechnologies.utils.comparators.IComparator ]" >
<!-- configuration parameters of comparator -->
</Comparator>
</Field>
<!-- A StringFilter can be used to normalize values prior to comparison: -->
<Field ID="[another field]" >
<StringFilter class="[ class of com.raritantechnologies.utils.filters.IStringFilter ]" >
<!-- configuration parameters of StringFilter -->
</StringFilter>
</Field>
</Fields>
</ResultMatcher>
Developed by
Raritan Technologies .
- Author:
- Ted Sullivan
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QueryResultMatcher
public QueryResultMatcher()
QueryResultMatcher
public QueryResultMatcher(OrderedMap query)
QueryResultMatcher
public QueryResultMatcher(OrderedMap query,
java.util.Map queryRules)
equals
public boolean equals(ILoginInfo user,
OrderedMap queryParams,
IResult result)
- Specified by:
equals in interface IQueryResultMatcher
equals
public boolean equals(ILoginInfo user,
IResult result)
- Specified by:
equals in interface IResultMatcher
setQuery
public void setQuery(OrderedMap query)
setQueryRules
public void setQueryRules(java.util.Map queryRules)
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
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