com.raritantechnologies.utils.comparators
Class CollectionContainsComparator

java.lang.Object
  extended bycom.raritantechnologies.utils.comparators.CollectionContainsComparator
All Implemented Interfaces:
java.util.Comparator, IComparator, IConfigurable

public class CollectionContainsComparator
extends java.lang.Object
implements IComparator

Comparator that matches an object against a set of objects.

XML Configuration Template:
   <Comparator class="com.raritantechnologies.utils.comparators.CollectionContainsComparator"
                  caseSensitive="[true|false(default) ]" >
       <ValidValues>
          <Value>a valid value</Value>
          <Value>another value</Value>
       </ValidValues>

       <!-- Alternatively can use a data source: -->
       <DataSource searchSource="searchSourceName"
                dataValueFields="[comma separated list of field ID(s) from search result that has data value(s)]" >

          <!-- Optional query to search source -->
          <Query>
            <!-- one or more query parameter id=value pairs -->
            <Param ID="[ parameter ID ]" value="[ query value ]" />
          </Query>

          <!-- Optional StringFilter to filter the data values before insertion into data list -->
          <ValueFilter class=" [ class of com.raritantechnologies.utils.filter.IStringFilter ] " >
      
          </ValueFilter>

        </DataSource>

        <!-- Alternately, can use a FileSource to get a set of values (one per line) -->
        <FileSource fileName="[ name of external file ]" >
          <!-- Optional StringFilter to filter the data values before insertion into data list -->
          <ValueFilter class=" [ class of com.raritantechnologies.utils.filter.IStringFilter ] " >
      
          </ValueFilter>
        </FileSource>

   </Comparator>
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Field Summary
 
Fields inherited from interface com.raritantechnologies.utils.comparators.IComparator
TEMPLATE
 
Constructor Summary
CollectionContainsComparator()
           
CollectionContainsComparator(java.util.Collection collection)
           
 
Method Summary
 int compare(java.lang.Object ob1, java.lang.Object ob2)
           
 boolean equals(java.lang.Object object)
           
 java.lang.String getConfigurationXML()
           
 java.lang.String getConfigurationXML(java.lang.String configurationTemplate)
           
 void getConfigurationXML(java.io.Writer writer)
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionContainsComparator

public CollectionContainsComparator()

CollectionContainsComparator

public CollectionContainsComparator(java.util.Collection collection)
Method Detail

equals

public boolean equals(java.lang.Object object)
Specified by:
equals in interface java.util.Comparator

compare

public int compare(java.lang.Object ob1,
                   java.lang.Object ob2)
Specified by:
compare in interface java.util.Comparator

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 void getConfigurationXML(java.io.Writer writer)
                         throws java.io.IOException
Throws:
java.io.IOException

getConfigurationXML

public java.lang.String getConfigurationXML()

getConfigurationXML

public java.lang.String getConfigurationXML(java.lang.String configurationTemplate)