net.sf.doolin.gui.validation.support
Class ValidationSupportImpl<B>

java.lang.Object
  extended by net.sf.doolin.bus.bean.Bean
      extended by net.sf.doolin.gui.validation.support.ValidationSupportImpl<B>
Type Parameters:
B - Type of bean that is validated
All Implemented Interfaces:
Serializable, IBean, ValidationSupport<B>
Direct Known Subclasses:
WindowValidationSupportImpl

public class ValidationSupportImpl<B>
extends Bean
implements ValidationSupport<B>

Implementation for the ValidationSupport.

Author:
Damien Coraboeuf
See Also:
Serialized Form

Constructor Summary
ValidationSupportImpl(B model, SubscriberValidator subscriberValidator)
          Instantiates a new validation support.
 
Method Summary
 SubscriberValidator getSubscriberValidator()
          Gets the subscription validator that is used.
 GUIValidation getValidation()
          Gets the validation
 void invalidate()
          Sets the validation as being invalid (used for Cancel actions)
 boolean isValid()
          Checks the result of the validation
 boolean isValidationEnabled()
          Checks if is validation enabled.
 Map<Object,GUIValidation> keyMap()
          Index of validation results, indexed by field keys
 void setValidator(GUIValidator<B> newValidator)
          Sets the validator to use
 String toString()
           
protected  void updateValidation()
          Updates the validation state.
 
Methods inherited from class net.sf.doolin.bus.bean.Bean
getBeanNotificationSupport, getParentBean, notify, setParentBean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValidationSupportImpl

public ValidationSupportImpl(B model,
                             SubscriberValidator subscriberValidator)
Instantiates a new validation support.

Parameters:
model - the model that is validated
subscriberValidator - the validator to use
Method Detail

getSubscriberValidator

public SubscriberValidator getSubscriberValidator()
Description copied from interface: ValidationSupport
Gets the subscription validator that is used.

Specified by:
getSubscriberValidator in interface ValidationSupport<B>
Returns:
Subscription validator

getValidation

public GUIValidation getValidation()
Gets the validation

Specified by:
getValidation in interface ValidationSupport<B>
Returns:
the validation

invalidate

public void invalidate()
Description copied from interface: ValidationSupport
Sets the validation as being invalid (used for Cancel actions)

Specified by:
invalidate in interface ValidationSupport<B>

isValid

public boolean isValid()
Checks the result of the validation

Specified by:
isValid in interface ValidationSupport<B>
Returns:
Validation result

isValidationEnabled

public boolean isValidationEnabled()
Checks if is validation enabled.

Specified by:
isValidationEnabled in interface ValidationSupport<B>
Returns:
true, if is validation enabled

keyMap

public Map<Object,GUIValidation> keyMap()
Description copied from interface: ValidationSupport
Index of validation results, indexed by field keys

Specified by:
keyMap in interface ValidationSupport<B>
Returns:
Index of validation results, indexed by field keys

setValidator

public void setValidator(GUIValidator<B> newValidator)
Sets the validator to use

Specified by:
setValidator in interface ValidationSupport<B>
Parameters:
newValidator - Validator to use

toString

public String toString()
Overrides:
toString in class Object

updateValidation

protected void updateValidation()
Updates the validation state.

See Also:
GUIValidator.validate(Object)


Copyright © 2011. All Rights Reserved.