biz.c24.io.api.data
Class ValidationEventCollector

java.lang.Object
  extended by biz.c24.io.api.data.ValidationEventCollector
All Implemented Interfaces:
ValidationListener, Serializable, EventListener

public class ValidationEventCollector
extends Object
implements ValidationListener

A validation listener implementation which collects the events it receives.

See Also:
Serialized Form

Constructor Summary
ValidationEventCollector()
          Constructs a new instance.
 
Method Summary
 ValidationEvent[] getFailEvents()
          Returns an array of the fail events.
 ValidationEvent[] getPassEvents()
          Returns an array of the pass events.
 boolean hasEvents()
          Returns whether any events have been collected.
 boolean hasFailEvents()
          Returns whether any fail events have been collected.
 boolean hasPassEvents()
          Returns whether any pass events have been collected.
 void reset()
          Resets the collector by clearing all events.
 String toFailString()
          Returns a string representation of the fail events.
 String toPassString()
          Returns a string representation of the pass events.
 void validationFailed(ValidationEvent ve)
          Invoked when a validation call is unsuccessful.
 void validationPassed(ValidationEvent ve)
          Invoked when a validation call has been successful.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationEventCollector

public ValidationEventCollector()
Constructs a new instance.

Method Detail

getPassEvents

public ValidationEvent[] getPassEvents()
Returns an array of the pass events.

Returns:
The pass events.

getFailEvents

public ValidationEvent[] getFailEvents()
Returns an array of the fail events.

Returns:
The fail events.

reset

public void reset()
Resets the collector by clearing all events.


hasEvents

public boolean hasEvents()
Returns whether any events have been collected.

Returns:
Whether any events have been collected.

hasPassEvents

public boolean hasPassEvents()
Returns whether any pass events have been collected.

Returns:
Whether any pass events have been collected.

hasFailEvents

public boolean hasFailEvents()
Returns whether any fail events have been collected.

Returns:
Whether any fail events have been collected.

validationPassed

public void validationPassed(ValidationEvent ve)
Description copied from interface: ValidationListener
Invoked when a validation call has been successful.

Specified by:
validationPassed in interface ValidationListener
Parameters:
ve - The validation event.

validationFailed

public void validationFailed(ValidationEvent ve)
Description copied from interface: ValidationListener
Invoked when a validation call is unsuccessful.

Specified by:
validationFailed in interface ValidationListener
Parameters:
ve - The validation event.

toPassString

public String toPassString()
Returns a string representation of the pass events.

Returns:
A string representation of the pass events.

toFailString

public String toFailString()
Returns a string representation of the fail events.

Returns:
A string representation of the fail events.


C24 Technologies © 2002-2012: All Rights Reserved.