com.raritantechnologies.xml.sax.filter.comparators
Class CDataAndComparator

java.lang.Object
  extended bycom.raritantechnologies.xml.sax.filter.comparators.CDataAndComparator
All Implemented Interfaces:
CDataComparator

public class CDataAndComparator
extends java.lang.Object
implements CDataComparator

Implementation of CDataComparator that enables AND logic to be applied to character data comparisons. Delegates to two contained CDataComparators and implements the interface by returning true only if both child comparators match the source character array. Works with a ProgrammableSAXFilter as a component of an ElementComparator.

XML Configuration Template:
  <CDataComparator class="com.raritantechnologies.xml.sax.filter.comparators.CDataAndComparator" >
    <CDataComparator class="[ class of CDataComparator ]" >
       <!-- configuration parameters -->
    </CDataComparator>

    <CDataComparator class="[ class of CDataComparator ]" >
       <!-- configuration parameters -->
    </CDataComparator>
  </CDataComparator>
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Constructor Summary
CDataAndComparator()
           
CDataAndComparator(CDataComparator compA, CDataComparator compB)
           
 
Method Summary
 void initialize(org.w3c.dom.Element elem)
           
 boolean matches(char[] source, int start, int length)
          determines if the character data source matches the criteria of this comparator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CDataAndComparator

public CDataAndComparator()

CDataAndComparator

public CDataAndComparator(CDataComparator compA,
                          CDataComparator compB)
Method Detail

matches

public boolean matches(char[] source,
                       int start,
                       int length)
Description copied from interface: CDataComparator
determines if the character data source matches the criteria of this comparator.

Specified by:
matches in interface CDataComparator
Parameters:
source - character array obtained from original SAX parser.
start - position of the first character in the array to consider.
length - number of characters to consider.
Returns:
true if the characters match the criteria defined by this comparator. false otherwise.

initialize

public void initialize(org.w3c.dom.Element elem)
Specified by:
initialize in interface CDataComparator