Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jxbeans.flow_control.comparators
Class DateComparator  view DateComparator download DateComparator.java

java.lang.Object
  extended byorg.jxbeans.AbstractJXBean
      extended byorg.jxbeans.AbstractDocumentSource
          extended byorg.jxbeans.flow_control.comparators.DateComparator
All Implemented Interfaces:
org.jxbeans.DocumentReadyListener, org.jxbeans.DocumentSource, java.util.EventListener, java.io.Serializable

public class DateComparator
extends org.jxbeans.AbstractDocumentSource
implements org.jxbeans.DocumentReadyListener

The DateComparator JXBean provides a way to make a comparison of date values and branch accordingly. A DocumentReadyListener can be set for the conditions where a date, drawn from the incoming XML document, is less than, greater than or equal to a specified control date.

Since:
1.0
Version:
1.0

Field Summary
private  java.util.Date date
           
private  java.lang.String dateFormat
           
private  java.text.SimpleDateFormat dateFormatter
           
private  java.lang.String expression
           
private  java.util.List greaterThanListeners
           
private  java.util.List lessThanListeners
           
private static org.apache.log4j.Category log
           
 
Fields inherited from class org.jxbeans.AbstractDocumentSource
listeners
 
Fields inherited from class org.jxbeans.AbstractJXBean
 
Constructor Summary
DateComparator()
           
 
Method Summary
 void addGreaterThanDocumentReadyListener(org.jxbeans.DocumentReadyListener aDocumentReadyListener)
          Adds a DocumentReadyListener that should get the document in the case where the date from the XML document is greater than the comparison date.
 void addLessThanDocumentReadyListener(org.jxbeans.DocumentReadyListener aDocumentReadyListener)
          Adds a DocumentReadyListener that should get the document in the case where the date from the XML document is less than the comparison date.
 void documentReady(org.jxbeans.DocumentReadyEvent anEvent)
          Classes implementing this method are expected to process the document contained in the DocumentReadyEvent in some fashion specific to the class implementing this interface.
 java.util.Date getComparisonDate()
           
 java.lang.String getDateFormat()
           
 java.lang.String getExpression()
           
 void removeGreaterThanDocumentReadyListener(org.jxbeans.DocumentReadyListener aDocumentReadyListener)
          Removes a DocumentReadyListener that should get the document in the case where the date from the XML document is greater than the comparison date.
 void removeLessThanDocumentReadyListener(org.jxbeans.DocumentReadyListener aDocumentReadyListener)
          Removes a DocumentReadyListener that should get the document in the case where the date from the XML document is less than the comparison date.
 void setComparisonDate(java.util.Date aDate)
          Sets the Date against which the value found in the XML document will be compared.
 void setDateFormat(java.lang.String aDateFormat)
          Sets the String that describes the date/time format of the value found by evaluating the XPath expression against the incoming XML document.
 void setExpression(java.lang.String anExpression)
          Sets the XPath expression that will be evaluated against the incoming document to retrieve a date string.
 
Methods inherited from class org.jxbeans.AbstractDocumentSource
addDocumentReadyListener, forwardDocument, forwardDocument, getDocumentReadyListeners, logDocument, removeDocumentReadyListener
 
Methods inherited from class org.jxbeans.AbstractJXBean
getName, logErrorAndRaiseException, logMethodEntry, logMethodEntry, logMethodExit, logMethodExit, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.log4j.Category log

lessThanListeners

private java.util.List lessThanListeners

greaterThanListeners

private java.util.List greaterThanListeners

expression

private java.lang.String expression

dateFormat

private java.lang.String dateFormat

date

private java.util.Date date

dateFormatter

private transient java.text.SimpleDateFormat dateFormatter
Constructor Detail

DateComparator

public DateComparator()
Method Detail

documentReady

public void documentReady(org.jxbeans.DocumentReadyEvent anEvent)
                   throws org.jxbeans.JXBeanException
Description copied from interface: org.jxbeans.DocumentReadyListener
Classes implementing this method are expected to process the document contained in the DocumentReadyEvent in some fashion specific to the class implementing this interface.

Specified by:
documentReady in interface org.jxbeans.DocumentReadyListener

addLessThanDocumentReadyListener

public void addLessThanDocumentReadyListener(org.jxbeans.DocumentReadyListener aDocumentReadyListener)
                                      throws java.util.TooManyListenersException
Adds a DocumentReadyListener that should get the document in the case where the date from the XML document is less than the comparison date.

Since:
1.0

removeLessThanDocumentReadyListener

public void removeLessThanDocumentReadyListener(org.jxbeans.DocumentReadyListener aDocumentReadyListener)
Removes a DocumentReadyListener that should get the document in the case where the date from the XML document is less than the comparison date.

Since:
1.0

addGreaterThanDocumentReadyListener

public void addGreaterThanDocumentReadyListener(org.jxbeans.DocumentReadyListener aDocumentReadyListener)
                                         throws java.util.TooManyListenersException
Adds a DocumentReadyListener that should get the document in the case where the date from the XML document is greater than the comparison date.

Since:
1.0

removeGreaterThanDocumentReadyListener

public void removeGreaterThanDocumentReadyListener(org.jxbeans.DocumentReadyListener aDocumentReadyListener)
Removes a DocumentReadyListener that should get the document in the case where the date from the XML document is greater than the comparison date.

Since:
1.0

setExpression

public void setExpression(java.lang.String anExpression)
Sets the XPath expression that will be evaluated against the incoming document to retrieve a date string.

Since:
1.0

getExpression

public java.lang.String getExpression()
Since:
1.0

setDateFormat

public void setDateFormat(java.lang.String aDateFormat)
Sets the String that describes the date/time format of the value found by evaluating the XPath expression against the incoming XML document.

Since:
1.0

getDateFormat

public java.lang.String getDateFormat()
Since:
1.0

setComparisonDate

public void setComparisonDate(java.util.Date aDate)
Sets the Date against which the value found in the XML document will be compared. Default is the date and time at the time of entry into the documentReady() method.

Since:
1.0

getComparisonDate

public java.util.Date getComparisonDate()
Since:
1.0