Keel 2.1RC2

org.keel.services.persist
Class AbstractHelper

java.lang.Object
  extended byorg.keel.services.persist.AbstractHelper
All Implemented Interfaces:
Helper
Direct Known Subclasses:
CategoryHelper, ChoiceHelper, ComponentSecurity, InstanceSecurity, InvokationSecurity, PollHelper, QuestionHelper

public abstract class AbstractHelper
extends java.lang.Object
implements Helper

Abstract helper is simply a handy superclass that implements the Helper interface. Sub-classes can then just override the methods they are interested in, rather than having to implement the entire Helper interface themselves. See the Helper interface for details on what Helper objects are all about.


Field Summary
private  Persistent myPersistent
           
 
Constructor Summary
AbstractHelper()
           
 
Method Summary
 void afterAdd(Persistent current)
          Called after the Add operation is completed successfully
 void afterDelete(Persistent current)
          Called after the Delete operation is performed
 void afterQuery(Persistent current)
          Called after a query operation
 void afterSetField(java.lang.String fieldName, java.lang.Object oldValue, java.lang.Object newValue)
          Called after a field is changed, assuming the change was allowed (e.g.
 void afterUpdate(Persistent current)
          Called after the Update operation is performed
 void beforeAdd(Persistent current)
          Called before the Add operation is performed
 void beforeClear(Persistent current)
          Called before the Clear operation is performed
 void beforeDelete(Persistent current)
          Called before the Delete operation is performed
 void beforeQuery(Persistent current)
          Called before the query operation is performed
 void beforeSetField(java.lang.String fieldName, java.lang.Object oldValue, java.lang.Object newValue)
          Called before each access to set the field value of a Persistent
 void beforeUpdate(Persistent current)
          Called before the Update operation is performed
protected  Persistent getPersistent()
           
 void setPersistent(Persistent current)
          Called when the helper is first instantiated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myPersistent

private Persistent myPersistent
Constructor Detail

AbstractHelper

public AbstractHelper()
Method Detail

getPersistent

protected Persistent getPersistent()

setPersistent

public void setPersistent(Persistent current)
Description copied from interface: Helper
Called when the helper is first instantiated

Specified by:
setPersistent in interface Helper

beforeUpdate

public void beforeUpdate(Persistent current)
Description copied from interface: Helper
Called before the Update operation is performed

Specified by:
beforeUpdate in interface Helper
Parameters:
current - The Persistent object before the update

afterUpdate

public void afterUpdate(Persistent current)
Description copied from interface: Helper
Called after the Update operation is performed

Specified by:
afterUpdate in interface Helper
Parameters:
current - The Persistent object that has just been updated

beforeAdd

public void beforeAdd(Persistent current)
Description copied from interface: Helper
Called before the Add operation is performed

Specified by:
beforeAdd in interface Helper
Parameters:
current - The Persistent object before the add operation. Fields such as auto-incremented keys will not yet have their values assigned.

afterAdd

public void afterAdd(Persistent current)
Description copied from interface: Helper
Called after the Add operation is completed successfully

Specified by:
afterAdd in interface Helper
Parameters:
current - The Persistent object after the add operation. Fields such as auto-incremented keys will have their values assigned properly

beforeDelete

public void beforeDelete(Persistent current)
Description copied from interface: Helper
Called before the Delete operation is performed

Specified by:
beforeDelete in interface Helper
Parameters:
current - The Persistent object about to be deleted

afterDelete

public void afterDelete(Persistent current)
Description copied from interface: Helper
Called after the Delete operation is performed

Specified by:
afterDelete in interface Helper
Parameters:
current - The Persistent object which has just been deleted

beforeClear

public void beforeClear(Persistent current)
Description copied from interface: Helper
Called before the Clear operation is performed

Specified by:
beforeClear in interface Helper
Parameters:
current - The Persistent object before it is cleared

beforeQuery

public void beforeQuery(Persistent current)
Description copied from interface: Helper
Called before the query operation is performed

Specified by:
beforeQuery in interface Helper
Parameters:
current - The Persistent object before the query - contains the constraint values that will be used to perform the query itself

afterQuery

public void afterQuery(Persistent current)
Description copied from interface: Helper
Called after a query operation

Specified by:
afterQuery in interface Helper
Parameters:
current - The Persistent object after the query - essentially identical to before

beforeSetField

public void beforeSetField(java.lang.String fieldName,
                           java.lang.Object oldValue,
                           java.lang.Object newValue)
Description copied from interface: Helper
Called before each access to set the field value of a Persistent

Specified by:
beforeSetField in interface Helper
Parameters:
fieldName - The field name whose value is being altered
oldValue - The field value before the changed is applied

afterSetField

public void afterSetField(java.lang.String fieldName,
                          java.lang.Object oldValue,
                          java.lang.Object newValue)
Description copied from interface: Helper
Called after a field is changed, assuming the change was allowed (e.g. by validations, type, etc)

Specified by:
afterSetField in interface Helper
Parameters:
fieldName - The field name that was changed
oldValue - The field value before the change
newValue - The updated field value

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.