com.jaxfront.core.type
Class ErrorController

java.lang.Object
  extended by com.jaxfront.core.type.ErrorController

public class ErrorController
extends java.lang.Object

The TypeController controls any value changes in the underlying JAXFront DOM. If a value changed the TypeController checks all relevant rules defined in the XUI document. He keeps track of all occured validation errors. In case of a validation error, a ValidationChangeEvent gets fired.

Version:
1.50

Constructor Summary
ErrorController(TypeController controller)
           
 
Method Summary
 void addError(Error error)
          Adds a validationError
 void addError(Error error, boolean shouldFireEvent)
          Adds a validationError
 void addValidationChangeListener(ValidationChangeListener newListener)
          Adds a validationChangeListener.
 void fireUnhandledValidationExceptions()
           
 java.util.Collection getAllErrors()
           
 java.util.Collection getAllErrors(java.util.Comparator comparator)
           
 java.util.Hashtable getErrors()
          Returns all current validationErrors.
 java.util.Vector getErrorsForClassification(java.lang.String errorClassification)
          Returns all current validationErrors for the given category (e.g. error, info, question, ...).
 java.util.Vector getErrorsForType(Type source)
           
 java.util.Vector getErrorsForType(Type source, int errorType)
           
 java.util.Vector getPageErrors(Type type)
          Returns all errors of the given type's represented tree node parent.
 void handleValidationException(Type type, ValidationException exception)
           
 boolean hasPageErrors(Type type)
          Returns whether a type's represented tree node parent has errors or not.
 boolean hasValidationErrors()
          Returns whether any current validationErrors exist or not.
 boolean isBlocked()
           
 void maintainErrors(Type removedType)
          Removes validation errors for all errors where the source type is derived from the passing type.
 void release()
          Releases rules, validationErrors, validationChangeListener and propertyChangeSupport.
 void removeAllErrors(boolean fireEvent)
          Removes all current validation errors of the given DOM.
 void removeConditionalError(ConditionExpression condition, Type sourceType)
           
 void removeError(Error error)
          Removes the validationError of the give source type.
 void removeError(Error error, boolean shouldFireEvent)
          Removes the validationError of the give source type.
 void removeErrors(java.util.List errors)
           
 void removeMandatoryAndCardinalityValidationErrors()
          Removes all mandatory violation exceptions.
 void removeMandatoryAndCardinalityValidationErrors(Type type)
          Removes all mandatory violation exceptions for a given type.
 void removeUserError(java.lang.Object identifierObject, Type sourceType)
           
 void removeValidationChangeListener(ValidationChangeListener newListener)
          Removes the given ValidationChangeListener.
 void removeValidationError(Type sourceType)
           
 void setBlocked(boolean blocked)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorController

public ErrorController(TypeController controller)
Method Detail

addError

public void addError(Error error)
Adds a validationError

Parameters:
ex - a validation exception that should be added
source - the type on which the error occured

addValidationChangeListener

public void addValidationChangeListener(ValidationChangeListener newListener)
Adds a validationChangeListener.

Parameters:
newListener - a validationChangeListener that should be added

addError

public void addError(Error error,
                     boolean shouldFireEvent)
Adds a validationError

Parameters:
ex - a validation exception that should be added
shouldFireEvent - indicates if an validationChanged Event should be fired

removeMandatoryAndCardinalityValidationErrors

public void removeMandatoryAndCardinalityValidationErrors()
Removes all mandatory violation exceptions.


removeMandatoryAndCardinalityValidationErrors

public void removeMandatoryAndCardinalityValidationErrors(Type type)
Removes all mandatory violation exceptions for a given type.


getPageErrors

public java.util.Vector getPageErrors(Type type)
Returns all errors of the given type's represented tree node parent.

Parameters:
type - a type of which the errors of its represented tree node parent are returned
Returns:
a vector that contains all pageErrors

getErrorsForType

public java.util.Vector getErrorsForType(Type source)

getErrorsForType

public java.util.Vector getErrorsForType(Type source,
                                         int errorType)

getErrors

public java.util.Hashtable getErrors()
Returns all current validationErrors.

Returns:
all validationErrors

getErrorsForClassification

public java.util.Vector getErrorsForClassification(java.lang.String errorClassification)
Returns all current validationErrors for the given category (e.g. error, info, question, ...).

Returns:
all validationErrors for a category

hasPageErrors

public boolean hasPageErrors(Type type)
Returns whether a type's represented tree node parent has errors or not.

Parameters:
type - the type of which the represented tree node parent will be checked for errors
Returns:
true if a type's represented tree node parent has errors, false otherwise

hasValidationErrors

public boolean hasValidationErrors()
Returns whether any current validationErrors exist or not.

Returns:
true if any current validationErrors exist, false otherwise

release

public void release()
Releases rules, validationErrors, validationChangeListener and propertyChangeSupport.


removeAllErrors

public void removeAllErrors(boolean fireEvent)
Removes all current validation errors of the given DOM.

Parameters:
dom - a document for which the validation errors should be removed

removeErrors

public void removeErrors(java.util.List errors)

removeValidationChangeListener

public void removeValidationChangeListener(ValidationChangeListener newListener)
Removes the given ValidationChangeListener.

Parameters:
listener - a ValidationChangeListener that should be removed

removeError

public void removeError(Error error)
Removes the validationError of the give source type.

Parameters:
source - a type that has an error

removeConditionalError

public void removeConditionalError(ConditionExpression condition,
                                   Type sourceType)

removeUserError

public void removeUserError(java.lang.Object identifierObject,
                            Type sourceType)

removeValidationError

public void removeValidationError(Type sourceType)

removeError

public void removeError(Error error,
                        boolean shouldFireEvent)
Removes the validationError of the give source type.

Parameters:
source - a type that has an error

maintainErrors

public void maintainErrors(Type removedType)
Removes validation errors for all errors where the source type is derived from the passing type. Also get rid of all rules with the passed source as ancestor node.

Parameters:
removedType - type which has been removed from DOM

fireUnhandledValidationExceptions

public void fireUnhandledValidationExceptions()

handleValidationException

public void handleValidationException(Type type,
                                      ValidationException exception)

getAllErrors

public java.util.Collection getAllErrors()

getAllErrors

public java.util.Collection getAllErrors(java.util.Comparator comparator)

setBlocked

public void setBlocked(boolean blocked)

isBlocked

public boolean isBlocked()