T
- public abstract class ERXEnterpriseObjectChangeListener<T extends EOEnterpriseObject> extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ClearCacheNotification |
Constructor and Description |
---|
ERXEnterpriseObjectChangeListener(Class c,
boolean trackAllChanges,
boolean deep)
Constructs an ERXEnterpriseChangeListener.
|
ERXEnterpriseObjectChangeListener(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 String |
entityName()
Returns the name of the entity this cache is watching.
|
protected boolean |
isRelevant(EOEditingContext editingContext,
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,
String key)
Helper to check if an array of EOs contains the handled entity or its
subclasses (if deep).
|
public static String ClearCacheNotification
public ERXEnterpriseObjectChangeListener(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(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, String key)
editingContext
- the editingContext containing the changesdict
- the notification's userInfo dictionarykey
- the inserted/updated/deleted keyprotected boolean isRelevant(EOEditingContext editingContext, 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 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 – 2024 Project Wonder.