Package com.exedio.cope
Class DefaultChangeHook
java.lang.Object
com.exedio.cope.DefaultChangeHook
- All Implemented Interfaces:
ChangeHook
Implements a
ChangeHook
that calls
static beforeNewCopeItem(SetValue[])
,
Item.afterNewCopeItem
,
Item.beforeSetCopeItem
, and
Item.beforeDeleteCopeItem
according to their specifications.
Without this hook, these methods are not called at all.
If ModelBuilder.changeHooks
is not called, this hook is installed by default.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.exedio.cope.ChangeHook
ChangeHook.Factory
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Is called after any item creation.void
beforeDelete
(Item item) Is called before any item deletion.SetValue<?>[]
Is called before any item creation.SetValue<?>[]
Is called before any item modification.static ChangeHook.Factory
factory()
toString()
-
Method Details
-
factory
-
beforeNew
Description copied from interface:ChangeHook
Is called before any item creation. You may change the values of the newly created item by returning changedsetValues
. The default implementation does nothing and returnssetValues
unmodified.- Specified by:
beforeNew
in interfaceChangeHook
-
afterNew
Description copied from interface:ChangeHook
Is called after any item creation. The default implementation does nothing.- Specified by:
afterNew
in interfaceChangeHook
- See Also:
-
beforeSet
Description copied from interface:ChangeHook
Is called before any item modification. The default implementation does nothing.- Specified by:
beforeSet
in interfaceChangeHook
setValues
- is never null and never empty- Returns:
- must not return null
- See Also:
-
beforeDelete
Description copied from interface:ChangeHook
Is called before any item deletion. The default implementation does nothing.- Specified by:
beforeDelete
in interfaceChangeHook
- See Also:
-
toString
-