public interface InterceptorContext
Interceptor instances. Provides information about other models in the current context
as well as useful utility methods. InterceptorContext has a default operation for elements registered with
registerElement(java.lang.Object, java.lang.Object) or
registerElement(java.lang.Object). InterceptorContext that are passed to interceptors during
ModelService.save(java.lang.Object) and
ModelService.saveAll() the default operation is
PersistenceOperation.SAVE. InterceptorContext that are passed to interceptors during
ModelService.remove(Object) and
ModelService.removeAll(java.util.Collection) the default operation is
PersistenceOperation.DELETE.| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Object model)
Deprecated.
|
boolean |
contains(Object model,
PersistenceOperation operation)
Checks is the given model is already registered in this InterceptorContext with the given operation.
|
boolean |
exists(Object model) |
Set<Object> |
getAllRegisteredElements()
Deprecated.
|
Object |
getAttribute(String key) |
Map<String,Set<Locale>> |
getDirtyAttributes(Object model)
Returns a map with all modified attribute qualifiers for the given model.
|
Set<Object> |
getElementsRegisteredFor(PersistenceOperation operation) |
ModelService |
getModelService() |
Object |
getSource(Object model)
Deprecated.
|
boolean |
isModified(Object model) |
boolean |
isModified(Object model,
String attribute) |
boolean |
isNew(Object model)
Tells if the model has been created and has not been saved yet.
|
boolean |
isRemoved(Object model) |
void |
registerElement(Object model)
Register the given
model to this InterceptorContext using the InterceptorContext's default operation. |
void |
registerElement(Object model,
Object source)
|
void |
registerElementFor(Object model,
PersistenceOperation operation)
Register the given
model to this InterceptorContext using the given operation. |
void |
setAttribute(String key,
Object value) |
@Deprecated Object getSource(Object model)
model - passed inDefaultModelService.get(Object)@Deprecated Set<Object> getAllRegisteredElements()
getElementsRegisteredFor(PersistenceOperation)Set<Object> getElementsRegisteredFor(PersistenceOperation operation)
@Deprecated void registerElement(Object model, Object source)
registerElement(Object) or
registerElementFor(java.lang.Object, PersistenceOperation)model to this InterceptorContext using the InterceptorContext's default operation.model - the model to be registered.source - the source of the model (optional)void registerElement(Object model)
model to this InterceptorContext using the InterceptorContext's default operation.model - the model to be registered.void registerElementFor(Object model, PersistenceOperation operation)
model to this InterceptorContext using the given operation.model - the model to be registered.operation - the operation to be performed with the given model@Deprecated boolean contains(Object model)
contains(java.lang.Object, PersistenceOperation)model - model instance to be searched forboolean contains(Object model, PersistenceOperation operation)
model - model instance to be searched foroperation - the operation to be searched forboolean isNew(Object model)
model - model instance to be searched forModelConverter.isNew(Object) for
registered model converter for passed modelboolean exists(Object model)
model - model instance to be searched forModelConverter.exists(Object) for
registered model converter for passed modelboolean isModified(Object model)
model - model instance to be searched forModelConverter.isModified(Object)
for registered model converter for passed modelboolean isModified(Object model, String attribute)
model - model instance to be searched forattribute - attribute name to be searched forModelConverter.isModified(Object, String) for
registered model converter for passed model , attributeboolean isRemoved(Object model)
model - model instance to be searched forModelConverter.isRemoved(Object)
for registered model converter for passed modelModelService getModelService()
Object getAttribute(String key)
key - attribute namevoid setAttribute(String key, Object value)
key - attribute namevalue - attribute passed into contextMap<String,Set<Locale>> getDirtyAttributes(Object model)
null the key is a
non-localized attribute qualifier else the map value contains the locale in which language the localized attribute
was modified.model - the new (not saved) modelCopyright © 2017 SAP SE. All Rights Reserved.