public class DefaultModelServiceInterceptorContext extends Object implements InterceptorContext
InterceptorContext.| Constructor and Description |
|---|
DefaultModelServiceInterceptorContext(DefaultModelService parent,
Collection<Object> initialElements,
ModelWrapperContext wrapperContext) |
DefaultModelServiceInterceptorContext(DefaultModelService parent,
PersistenceOperation defaultPersistenceOperation,
Collection<? extends Object> initialElements,
ModelWrapperContext wrapperContext) |
| 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.
|
InterceptorContextSnapshot |
createSnapshot() |
RegisteredElements |
elementsRegisteredFor(PersistenceOperation operation) |
boolean |
exists(Object model) |
Set<Object> |
getAllRegisteredElements() |
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) |
RegisteredElements |
getInitialElements() |
Collection<ModelWrapper> |
getInitialWrappers() |
ModelService |
getModelService() |
Schedule |
getSchedule() |
Object |
getSource(Object model)
Deprecated.
|
WrapperRegistry |
getWrapperRegistry() |
boolean |
isAlreadyNotified(Object model) |
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 |
markAsNotified(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)
Register the given
model to this InterceptorContext using the InterceptorContext's default operation. |
void |
registerElementFor(Object model,
PersistenceOperation operation)
Register the given
model to this InterceptorContext using the given operation. |
void |
registerWrappedElementsFor(Collection<ModelWrapper> wrappers,
PersistenceOperation operation) |
void |
schedule(ModelWrapper wrapper) |
void |
setAttribute(String key,
Object value) |
Collection<ModelWrapper> |
wrap(Collection<? extends Object> models,
PersistenceOperation operation) |
public DefaultModelServiceInterceptorContext(DefaultModelService parent, PersistenceOperation defaultPersistenceOperation, Collection<? extends Object> initialElements, ModelWrapperContext wrapperContext)
public DefaultModelServiceInterceptorContext(DefaultModelService parent, Collection<Object> initialElements, ModelWrapperContext wrapperContext)
public void registerElement(Object model, Object source)
InterceptorContextmodel to this InterceptorContext using the InterceptorContext's default operation.registerElement in interface InterceptorContextmodel - the model to be registered.source - the source of the model (optional)public void registerElement(Object model)
InterceptorContextmodel to this InterceptorContext using the InterceptorContext's default operation.registerElement in interface InterceptorContextmodel - the model to be registered.public void registerElementFor(Object model, PersistenceOperation operation)
InterceptorContextmodel to this InterceptorContext using the given operation.registerElementFor in interface InterceptorContextmodel - the model to be registered.operation - the operation to be performed with the given modelpublic RegisteredElements elementsRegisteredFor(PersistenceOperation operation)
public Set<Object> getAllRegisteredElements()
getAllRegisteredElements in interface InterceptorContextpublic Set<Object> getElementsRegisteredFor(PersistenceOperation operation)
getElementsRegisteredFor in interface InterceptorContext@Deprecated public boolean contains(Object model)
InterceptorContextcontains in interface InterceptorContextmodel - model instance to be searched forpublic boolean contains(Object model, PersistenceOperation operation)
InterceptorContextcontains in interface InterceptorContextmodel - model instance to be searched foroperation - the operation to be searched for@Deprecated public Object getSource(Object model)
getSource in interface InterceptorContextmodel - passed inDefaultModelService.get(Object)public boolean isNew(Object model)
InterceptorContextisNew in interface InterceptorContextmodel - model instance to be searched forModelConverter.isNew(Object) for
registered model converter for passed modelpublic boolean exists(Object model)
exists in interface InterceptorContextmodel - model instance to be searched forModelConverter.exists(Object) for
registered model converter for passed modelpublic boolean isModified(Object model)
isModified in interface InterceptorContextmodel - model instance to be searched forModelConverter.isModified(Object)
for registered model converter for passed modelpublic boolean isModified(Object model, String attribute)
isModified in interface InterceptorContextmodel - model instance to be searched forattribute - attribute name to be searched forModelConverter.isModified(Object, String) for
registered model converter for passed model , attributepublic boolean isRemoved(Object model)
isRemoved in interface InterceptorContextmodel - model instance to be searched forModelConverter.isRemoved(Object)
for registered model converter for passed modelpublic ModelService getModelService()
getModelService in interface InterceptorContextpublic Object getAttribute(String key)
getAttribute in interface InterceptorContextkey - attribute namepublic void setAttribute(String key, Object value)
setAttribute in interface InterceptorContextkey - attribute namevalue - attribute passed into contextpublic Map<String,Set<Locale>> getDirtyAttributes(Object model)
InterceptorContextnull the key is a
non-localized attribute qualifier else the map value contains the locale in which language the localized attribute
was modified.getDirtyAttributes in interface InterceptorContextmodel - the new (not saved) modelpublic void registerWrappedElementsFor(Collection<ModelWrapper> wrappers, PersistenceOperation operation)
public InterceptorContextSnapshot createSnapshot()
public RegisteredElements getInitialElements()
public void markAsNotified(Object model)
public boolean isAlreadyNotified(Object model)
public Collection<ModelWrapper> getInitialWrappers()
public void schedule(ModelWrapper wrapper)
public Schedule getSchedule()
public Collection<ModelWrapper> wrap(Collection<? extends Object> models, PersistenceOperation operation)
public WrapperRegistry getWrapperRegistry()
Copyright © 2017 SAP SE. All Rights Reserved.