|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IMappingRegistry
Defines an interface for a registry that gathers modifications made to a listened objects.
This file is part of Malai.
Copyright (c) 2009-2012 Arnaud BLOUIN
Malai is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later version.
Malai is distributed without any warranty; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
05/15/2010
Method Summary | ||
---|---|---|
void |
addMapping(IMapping mapping)
Adds a mapping to the registry. |
|
|
getSourceFromTarget(java.lang.Object target,
java.lang.Class<T> sourceType)
|
|
|
getTargetFromSource(java.lang.Object source,
java.lang.Class<T> targetType)
|
|
void |
initMappings()
At start, mappings must be executed one time to initialise the mapping. |
|
void |
onListCleaned(java.lang.Object list)
Executes the mapping when all the elements of the source were removed. |
|
|
onObjectAdded(IActiveList<T> list,
T object,
int index)
Executes mappings related to the given list for the addition of an object. |
|
void |
onObjectModified(java.lang.Object object)
Executes mappings related to the given list for the modification of an object. |
|
|
onObjectMoved(IActiveList<T> list,
T object,
int srcIndex,
int targetIndex)
Executes mappings related to the given list for the move of an object. |
|
void |
onObjectRemoved(IActiveList<?> list,
java.lang.Object object,
int index)
Executes mappings related to the given list for the deletion of an object. |
|
|
onObjectReplaced(IUnary<T> object,
T replacedObject)
Executes the mapping when an object has been replaced by an other one. |
|
void |
removeMappingsUsingSource(java.lang.Object source)
Removes the mappings that use the given object as source. |
|
void |
removeMappingsUsingSource(java.lang.Object source,
java.lang.Class<? extends IMapping> clazz)
Removes the mappings of the given type that use the given object as source. |
|
void |
removeMappingsUsingTarget(java.lang.Object target)
Removes the mappings that use the given object as target. |
|
void |
removeMappingsUsingTarget(java.lang.Object target,
java.lang.Class<? extends IMapping> clazz)
Removes the mappings that use the given object as target. |
Method Detail |
---|
void initMappings()
void addMapping(IMapping mapping)
mapping
- The mapping to add.<T> void onObjectAdded(IActiveList<T> list, T object, int index)
list
- The modified source list.object
- The added object.index
- The position where the object has been added.void onObjectRemoved(IActiveList<?> list, java.lang.Object object, int index)
list
- The modified source list.object
- The deleted object.index
- The position where the object has been deleted.void onListCleaned(java.lang.Object list)
list
- The list before the cleaning, i.e. it still contains all the elements in
order to know which elements have been removed.<T> void onObjectMoved(IActiveList<T> list, T object, int srcIndex, int targetIndex)
list
- The modified source list.object
- The move object.srcIndex
- The source position of the object.targetIndex
- The target position of the object.void onObjectModified(java.lang.Object object)
object
- The modified object.<T> void onObjectReplaced(IUnary<T> object, T replacedObject)
object
- The singleton that contains the new object.replacedObject
- The old object contained in the singleton that has been replaced.void removeMappingsUsingSource(java.lang.Object source)
source
- A source object of the mappings to remove.void removeMappingsUsingTarget(java.lang.Object target, java.lang.Class<? extends IMapping> clazz)
target
- A target object of the mappings to remove.clazz
- The type of the mappings to remove.void removeMappingsUsingTarget(java.lang.Object target)
target
- A target object of the mappings to remove.void removeMappingsUsingSource(java.lang.Object source, java.lang.Class<? extends IMapping> clazz)
source
- A source object of the mappings to remove.clazz
- The type of the mappings to remove.<T> T getTargetFromSource(java.lang.Object source, java.lang.Class<T> targetType)
source
- The source object used to find the target object matching the given class.targetType
- The class of the target object to find.
<T> T getSourceFromTarget(java.lang.Object target, java.lang.Class<T> sourceType)
target
- The target object used to find the source object matching the given class.sourceType
- The class of the source object to find.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |