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.


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.Collection getAllErrors(java.util.Hashtable errorMap, int errorType)
           
 java.util.Collection getAllErrors(int errorType)
           
 TypeController getController()
           
 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.Collection getOptimizedErrors()
           
 java.util.Collection getOptimizedErrors(java.util.Comparator comparator)
           
 void handleValidationException(Type type, ValidationException exception)
           
 boolean hasPageErrors(Type type, boolean validate)
          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(Rule rule, 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 removeError(Type errorHolder)
          Removes the validationError of the give source type.
 void removeErrors(java.util.List errors)
           
 void removeErrors(java.util.List errors, boolean fireEvent)
           
 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)
           
 void setErrorsDelegate(java.util.Hashtable delegate)
           
 
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

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

addValidationChangeListener

public void addValidationChangeListener(ValidationChangeListener newListener)
Adds a validationChangeListener.

Parameters:
newListener - a validationChangeListener that should be added

fireUnhandledValidationExceptions

public void fireUnhandledValidationExceptions()

getAllErrors

public java.util.Collection getAllErrors()

getAllErrors

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

getAllErrors

public java.util.Collection getAllErrors(java.util.Hashtable errorMap,
                                         int errorType)

getAllErrors

public java.util.Collection getAllErrors(int errorType)

getController

public TypeController getController()

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

getErrorsForType

public java.util.Vector getErrorsForType(Type source)

getErrorsForType

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

getOptimizedErrors

public java.util.Collection getOptimizedErrors()

getOptimizedErrors

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

handleValidationException

public void handleValidationException(Type type,
                                      ValidationException exception)

hasPageErrors

public boolean hasPageErrors(Type type,
                             boolean validate)
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

isBlocked

public boolean isBlocked()

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

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

removeConditionalError

public void removeConditionalError(Rule rule,
                                   ConditionExpression condition,
                                   Type sourceType)

removeError

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

Parameters:
source - a type that has an error

removeError

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

Parameters:
source - a type that has an error

removeError

public void removeError(Type errorHolder)
Removes the validationError of the give source type.

Parameters:
source - a type that has an error

removeErrors

public void removeErrors(java.util.List errors)

removeErrors

public void removeErrors(java.util.List errors,
                         boolean fireEvent)

removeMandatoryAndCardinalityValidationErrors

public void removeMandatoryAndCardinalityValidationErrors()
Removes all mandatory violation exceptions.


removeMandatoryAndCardinalityValidationErrors

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


removeUserError

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

removeValidationChangeListener

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

Parameters:
listener - a ValidationChangeListener that should be removed

removeValidationError

public void removeValidationError(Type sourceType)

setBlocked

public void setBlocked(boolean blocked)

setErrorsDelegate

public void setErrorsDelegate(java.util.Hashtable delegate)