org.openbp.guiclient.objectvalidators
Class ModelObjectValidator

java.lang.Object
  extended by org.openbp.guiclient.objectvalidators.ValidatorBase
      extended by org.openbp.guiclient.objectvalidators.DescriptionObjectValidator
          extended by org.openbp.guiclient.objectvalidators.DisplayObjectValidator
              extended by org.openbp.guiclient.objectvalidators.ModelObjectValidator
All Implemented Interfaces:
PropertyValidator, ObjectValidator
Direct Known Subclasses:
ComplexTypeValidator, DataMemberValidator, InitialNodeValidator, JavaActivityItemValidator, ModelValidator, NodeSocketValidator

public class ModelObjectValidator
extends DisplayObjectValidator

Model object validator.

Author:
Heiko Erhardt

Constructor Summary
ModelObjectValidator()
           
 
Method Summary
static void checkNameUniqueness(ModelObject editedObject, PropertyBrowser pb)
          Checks if the name of this object is unique in the collection it iscontain in - if any.
 boolean validateObject(java.lang.Object editedObject, PropertyBrowser pb)
          Validates the entire object before it will be saved.
 
Methods inherited from class org.openbp.guiclient.objectvalidators.DisplayObjectValidator
validateProperty
 
Methods inherited from class org.openbp.guiclient.objectvalidators.ValidatorBase
displayErrorMsg, displayMsgContainer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelObjectValidator

public ModelObjectValidator()
Method Detail

validateObject

public boolean validateObject(java.lang.Object editedObject,
                              PropertyBrowser pb)
Validates the entire object before it will be saved. Ensures uniqueness of the object name based on the original object that has been set with the property browser (i. e. this object will be skipped when checking for objects with the same name).

Specified by:
validateObject in interface ObjectValidator
Overrides:
validateObject in class ValidatorBase
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.

checkNameUniqueness

public static void checkNameUniqueness(ModelObject editedObject,
                                       PropertyBrowser pb)
Checks if the name of this object is unique in the collection it iscontain in - if any. If the contains a member with the same name as this object that is not the original object, an error message will be written to the message container of the object.

Parameters:
editedObject - Edited object that contains the property
pb - Property browser that edits the object


Copyright © 2011. All Rights Reserved.