org.openbp.guiclient.objectvalidators
Class ValidatorBase

java.lang.Object
  extended by org.openbp.guiclient.objectvalidators.ValidatorBase
All Implemented Interfaces:
PropertyValidator, ObjectValidator
Direct Known Subclasses:
DescriptionObjectValidator

public class ValidatorBase
extends java.lang.Object
implements ObjectValidator

Base class for object validators.

Author:
Heiko Erhardt

Constructor Summary
ValidatorBase()
           
 
Method Summary
 void displayErrorMsg(java.lang.String msg)
          Outputs an error message in a message box.
 boolean displayMsgContainer()
          Prints the contents of the CoreModule's message container - if any - in a message box.
 boolean validateObject(java.lang.Object editedObject, PropertyBrowser pb)
          Validates the entire object before it will be saved.
 boolean validateProperty(java.lang.String propertyName, java.lang.Object propertyValue, java.lang.Object editedObject, PropertyEditor propertyEditor, boolean complete)
          Validates an edited property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatorBase

public ValidatorBase()
Method Detail

validateProperty

public boolean validateProperty(java.lang.String propertyName,
                                java.lang.Object propertyValue,
                                java.lang.Object editedObject,
                                PropertyEditor propertyEditor,
                                boolean complete)
Validates an edited property.

Specified by:
validateProperty in interface PropertyValidator
Parameters:
propertyName - Name of the edited property
propertyValue - Current value of the property
editedObject - Edited object that contains the property
propertyEditor - Property editor that edits the property value
complete - true The value has been completely entered. This is the case if the user wishes to leave the field.
false The value is being typed/edited.
Returns:
true The property value is valid.
false The property value is invalid. In this case, the focus should not be set to the next component.

validateObject

public boolean validateObject(java.lang.Object editedObject,
                              PropertyBrowser pb)
Validates the entire object before it will be saved.

Specified by:
validateObject in interface ObjectValidator
Parameters:
editedObject - Edited object that contains the property
pb - Property browser that edits the object
Returns:
true The object value is valid and can be saved.
false The object value is invalid. In this case, the save operation should be aborted and the focus should not be set outside the property browser.

displayErrorMsg

public void displayErrorMsg(java.lang.String msg)
Outputs an error message in a message box.

Parameters:
msg - The message

displayMsgContainer

public boolean displayMsgContainer()
Prints the contents of the CoreModule's message container - if any - in a message box.

Returns:
true The message container is null, does not contain any messages or only warning messages (which have been displayed) false The message container contains error messages


Copyright © 2011. All Rights Reserved.