public class PartOfModelRegisterForRemoveInterceptor extends Object implements RemoveInterceptor
ItemModel the partOf
attributes of this model and add the attribute value (if this is an ItemModel) to the
InterceptorContext. This interceptor is invoked by ModelService.removeAll(Collection) and there will
be the additionally registered models deleted. For dealing with special part-of attributes (like
ProductModel.europe1prices) extend this class and overwrite
registerForRemoval(InterceptorContext, ItemModel, ItemModel, String) to implement special behaviour for a
given attribute.| Constructor and Description |
|---|
PartOfModelRegisterForRemoveInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
protected Set<String> |
excludeIgnoredFromWritablePartOfAttributes(Set<String> partOfSet,
Set<String> ignoreSet) |
protected void |
extractAndRegisterForRemoval(InterceptorContext ctx,
ItemModel parentModel,
Object attrValue,
String partOfAttrQualifier)
Goes through the
attrValue content and calls for each found ItemModel the method
registerForRemoval(InterceptorContext, ItemModel, ItemModel, String). |
void |
onRemove(Object model,
InterceptorContext ctx)
Called in the
modelService.removeAll() method. |
protected void |
registerForRemoval(InterceptorContext ctx,
ItemModel parentModel,
ItemModel subModel,
String partOfAttrQualifier)
Hook-in method for special attribute dealing.
|
void |
setIgnoreAttributes(Set<String> ignoreAttributes) |
void |
setTypeService(TypeService typeService) |
public PartOfModelRegisterForRemoveInterceptor()
public void setTypeService(TypeService typeService)
public void onRemove(Object model, InterceptorContext ctx) throws InterceptorException
RemoveInterceptormodelService.removeAll() method.onRemove in interface RemoveInterceptormodel - the model which should be removedctx - the InterceptorContextInterceptorException - if the remove reports an errorprotected void registerForRemoval(InterceptorContext ctx, ItemModel parentModel, ItemModel subModel, String partOfAttrQualifier)
InterceptorContext.registerElement(Object, Object) with the parameters: submodel, null.
Overwrite this method to execute your own logic for a given partOf attribute.ctx - the Interceptor context. The submodel will be registered to it.parentModel - this is the model which has the part-of attributesubModel - the content of the part-of attribute from the parentModelpartOfAttrQualifier - the attribute qualifier of the part-of attributeprotected void extractAndRegisterForRemoval(InterceptorContext ctx, ItemModel parentModel, Object attrValue, String partOfAttrQualifier)
attrValue content and calls for each found ItemModel the method
registerForRemoval(InterceptorContext, ItemModel, ItemModel, String).protected Set<String> excludeIgnoredFromWritablePartOfAttributes(Set<String> partOfSet, Set<String> ignoreSet)
Copyright © 2017 SAP SE. All Rights Reserved.