com.raritantechnologies.utils.comparators
Class BeanContainerComparator

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

public class BeanContainerComparator
extends java.lang.Object
implements IComparator

BeanContainerComparator - used to determine if a object with ceratin properties is found (or not found) within a java.util.List owned by the parent (container) object.

XML Configuration Template:
   <Comparator class="com.raritantechnologies.utils.comparators.BeanContainerComparator"
                  getListMethodName="[name of bean method]"
                  matchCriterion="CONTAINS|NOT_CONTAINS|EMPTY_LIST|NOT_EMPTY" >

     <Comparator class="[implementation of IComparator]" >
       <!-- parameters required by  comparator -->
     </Comparator>

   </Comparator>
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Field Summary
static int CONTAINS
           
static int EMPTY_LIST
           
static int NOT_CONTAINS
           
static int NOT_EMPTY
           
 
Fields inherited from interface com.raritantechnologies.utils.comparators.IComparator
TEMPLATE
 
Constructor Summary
BeanContainerComparator()
           
BeanContainerComparator(java.lang.String getListMethodName, java.util.Comparator childComparator, int criterionType)
           
 
Method Summary
 int compare(java.lang.Object ob1, java.lang.Object ob2)
           
 boolean equals(java.lang.Object object)
           
 java.util.Comparator getChildComparator()
           
 java.lang.String getConfigurationXML()
           
 java.lang.String getConfigurationXML(java.lang.String configurationTemplate)
           
 void getConfigurationXML(java.io.Writer writer)
           
 int getCriterionType()
           
 java.lang.String getGetListMethodName()
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void setChildComparator(java.util.Comparator childComparator)
           
 void setCriterionType(int criterionType)
           
 void setGetListMethodName(java.lang.String getListMethodName)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTAINS

public static final int CONTAINS
See Also:
Constant Field Values

NOT_CONTAINS

public static final int NOT_CONTAINS
See Also:
Constant Field Values

EMPTY_LIST

public static final int EMPTY_LIST
See Also:
Constant Field Values

NOT_EMPTY

public static final int NOT_EMPTY
See Also:
Constant Field Values
Constructor Detail

BeanContainerComparator

public BeanContainerComparator()

BeanContainerComparator

public BeanContainerComparator(java.lang.String getListMethodName,
                               java.util.Comparator childComparator,
                               int criterionType)
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

setGetListMethodName

public void setGetListMethodName(java.lang.String getListMethodName)

getGetListMethodName

public java.lang.String getGetListMethodName()

setChildComparator

public void setChildComparator(java.util.Comparator childComparator)

getChildComparator

public java.util.Comparator getChildComparator()

setCriterionType

public void setCriterionType(int criterionType)

getCriterionType

public int getCriterionType()

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)