T - public abstract class ERXEnterpriseObjectChangeListener<T extends EOEnterpriseObject>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ClearCacheNotification |
| Constructor and Description |
|---|
ERXEnterpriseObjectChangeListener(java.lang.Class c,
boolean trackAllChanges,
boolean deep)
Constructs an ERXEnterpriseChangeListener.
|
ERXEnterpriseObjectChangeListener(java.lang.String entityName,
boolean trackAllChanges,
boolean deep)
Constructs an ERXEnterpriseChangeListener.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
clearCache()
Called when a clear cache request has been received.
|
void |
clearCache(NSNotification n)
Handler for the clearCaches notification.
|
void |
editingContextDidSaveChanges(NSNotification n)
Handler for the editingContextDidSaveChanges notification.
|
abstract void |
entitiesChanged(NSArray<T> entitiesInserted,
NSArray<T> entitiesUpdated,
NSArray<T> entitiesDeleted)
Called when the entity being listened to changes.
|
protected java.lang.String |
entityName()
Returns the name of the entity this cache is watching.
|
protected boolean |
isRelevant(EOEditingContext editingContext,
java.lang.String changedEntityName)
Returns true if the changed entity name matches the watched entity name,
or if this change listener is "deep," if the changed entity name is a
|
protected void |
registerForNotifications() |
protected NSArray<T> |
relevantChanges(EOEditingContext editingContext,
NSDictionary dict,
java.lang.String key)
Helper to check if an array of EOs contains the handled entity or its
subclasses (if deep).
|
public ERXEnterpriseObjectChangeListener(java.lang.Class c,
boolean trackAllChanges,
boolean deep)
c - the class name of the entity to watch for changestrackAllChanges - if true, entitiesChanged will pass the array of all changed
EO's (slightly slower)deep - if true, subentities of the given entity will be considered
relevent to this change listenerpublic ERXEnterpriseObjectChangeListener(java.lang.String entityName,
boolean trackAllChanges,
boolean deep)
entityName - the entity name to watch for changestrackAllChanges - if true, entitiesChanged will pass the array of all changed
EO's (slightly slower)deep - if true, subentities of the given entity will be considered
relevent to this change listenerprotected void registerForNotifications()
protected NSArray<T> relevantChanges(EOEditingContext editingContext, NSDictionary dict, java.lang.String key)
editingContext - the editingContext containing the changesdict - the notification's userInfo dictionarykey - the inserted/updated/deleted keyprotected boolean isRelevant(EOEditingContext editingContext, java.lang.String changedEntityName)
editingContext - the editing context containing the changeschangedEntityName - the name of the changed entitypublic void editingContextDidSaveChanges(NSNotification n)
n - public void clearCache(NSNotification n)
n - protected java.lang.String entityName()
public abstract void entitiesChanged(NSArray<T> entitiesInserted, NSArray<T> entitiesUpdated, NSArray<T> entitiesDeleted)
entitiesInserted - entities of this type were inserted, if null, it was not
checkedentitiesUpdated - entities of this type were updated, if null, it was not
checkedentitiesDeleted - entities of this type were deleted, if null, it was not
checkedpublic abstract void clearCache()
Copyright © 2002 – 2022 Project Wonder.