biz.c24.io.api.data
Class ValidationEvent

java.lang.Object
  extended by java.util.EventObject
      extended by biz.c24.io.api.data.ValidationEvent
All Implemented Interfaces:
Serializable

public class ValidationEvent
extends EventObject

Signals that some event has occurred during the validation of a data object.

This event contains references to the context and particular field which were being validated. It also provides a validation result which can be used to distinguish between the possible resons for the event.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ValidationEvent(ComplexDataObject object, ValidationResultEnum reason, EventMessage message)
           
ValidationEvent(ComplexDataObject object, ValidationResultEnum reason, String message)
           
ValidationEvent(ComplexDataObject object, ValidationResultEnum reason, Throwable cause)
           
ValidationEvent(Object object, DataComponent component, ComplexDataObject context, ValidationResultEnum reason)
           
ValidationEvent(Object object, DataComponent component, ComplexDataObject context, ValidationResultEnum reason, EventMessage message)
           
ValidationEvent(Object object, DataComponent component, ComplexDataObject context, ValidationResultEnum reason, String message)
           
ValidationEvent(Object object, DataComponent component, ComplexDataObject context, ValidationResultEnum reason, Throwable cause)
           
 
Method Summary
 boolean equals(Object o)
           
 Throwable getCause()
           
 DataComponent getComponent()
           
 ComplexDataObject getContext()
          Returns the containing object of the field which failed validation.
 String getFieldName()
          Returns the name of the field which failed validation.
 String getMessage()
          Returns the message.
 Object getObject()
           
 ValidationResultEnum getValidationResult()
          Returns the validation result.
 int hashCode()
           
 boolean isSuccessful()
          Return whether this event was created due to a successful validation.
 String toString()
           
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValidationEvent

public ValidationEvent(ComplexDataObject object,
                       ValidationResultEnum reason,
                       EventMessage message)

ValidationEvent

public ValidationEvent(ComplexDataObject object,
                       ValidationResultEnum reason,
                       Throwable cause)

ValidationEvent

public ValidationEvent(Object object,
                       DataComponent component,
                       ComplexDataObject context,
                       ValidationResultEnum reason)

ValidationEvent

public ValidationEvent(Object object,
                       DataComponent component,
                       ComplexDataObject context,
                       ValidationResultEnum reason,
                       EventMessage message)

ValidationEvent

public ValidationEvent(Object object,
                       DataComponent component,
                       ComplexDataObject context,
                       ValidationResultEnum reason,
                       Throwable cause)

ValidationEvent

public ValidationEvent(Object object,
                       DataComponent component,
                       ComplexDataObject context,
                       ValidationResultEnum reason,
                       String message)

ValidationEvent

public ValidationEvent(ComplexDataObject object,
                       ValidationResultEnum reason,
                       String message)
Method Detail

isSuccessful

public boolean isSuccessful()
Return whether this event was created due to a successful validation.

Returns:
Whether the validation result is ValidationResultEnum.VALID.

getObject

public Object getObject()

getComponent

public DataComponent getComponent()

getContext

public ComplexDataObject getContext()
Returns the containing object of the field which failed validation.

Returns:
The containing object.

getValidationResult

public ValidationResultEnum getValidationResult()
Returns the validation result.

Returns:
The reason for this exception.

getMessage

public String getMessage()
Returns the message.

Returns:
The message.

getCause

public Throwable getCause()

getFieldName

public String getFieldName()
Returns the name of the field which failed validation.

Returns:
The field name.

toString

public String toString()
Overrides:
toString in class EventObject

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


C24 Technologies © 2002-2012: All Rights Reserved.