Holger's
Java API

com.antelmann.util.gui
Interface FormValidator<T>

All Known Implementing Classes:
JPasswordChangeForm, JPropertyEntryForm

public interface FormValidator<T>

used for Form dialogs or frames that edit data.

Author:
Holger Antelmann
See Also:
Form

Method Summary
 T commitFormAction(Component formComponent)
          This method processes/stores all relevant information from the form and returns the object that was committed.
 void validateForm(Component formComponent)
          validates the given form by checking it for consistency.
 

Method Detail

validateForm

void validateForm(Component formComponent)
                  throws FormValidationWarning,
                         IOException,
                         IllegalArgumentException
validates the given form by checking it for consistency. If the form consistency check passed, the method simply returns gracefully. This method is always called before the form is then actually committed after pressing 'ok' in the form dialog. The FormDialog remains visible even after a FormValidation was thrown.

Parameters:
formComponent - the component that contains the fields to be validated
Throws:
FormValidationWarning - if any editable part of the form is inconsistent
IOException - if some resource could not be loaded to fulfill the required validation
IllegalArgumentException - if this validator doesn't accept the given formComponent

commitFormAction

T commitFormAction(Component formComponent)
                   throws IllegalArgumentException,
                          Exception
This method processes/stores all relevant information from the form and returns the object that was committed. It can be savely assumed that the validation has already passed before this method is called. If an exception occurs, it will be caught and shown by the FormDialog upon pressing the ok-button. The FormDialog will be disposed after this method returns.

Parameters:
formComponent - the component that contains the fields to be submitted for action
Returns:
the object that was committed by this method or null.
Throws:
Exception - if something prevented the successful processing of the form
IllegalArgumentException - if this validator doesn't accept the given formComponent


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads