Class MappingController
- java.lang.Object
-
- com._1c.g5.v8.dt.form.mapping.core.MappingController
-
public class MappingController extends Object
Class for managing director of all of the registered mapping.
-
-
Constructor Summary
Constructors Constructor Description MappingController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInputListener(IEventListener listener)
Register new mapping model listener.void
addOutputListener(IEventListener listener)
Register new mapping model listener.void
dispose()
Disposes the current controller and all mappings of it.void
fullUpdate()
Forcedly updates all stored mappings.<TResult,TRoot extends org.eclipse.emf.ecore.EObject>
TResultget(Class<TRoot> rootClass, IQuery<TResult,TRoot> query)
Gets data from projective model of root model object by query object(IQuery
).<TRoot> TRoot
getMappingRoot(Class<TRoot> rootClass)
Get or createsIMappingRoot
object by class.<TRoot> void
getMappingRootAsync(Class<TRoot> rootClass, ICompletedRootHandler<TRoot> completedRootHandler)
Asynchronously provides a completeIMappingRoot
object by class and runs the given handler.protected void
pushEvent(AbstractEvent event)
Fire all mapping model listenervoid
register(Mapping<?,?> mapping)
Registration of a specific mappingvoid
removeInputListener(IEventListener listener)
Remove mapping model listenervoid
removeOutputListener(IEventListener listener)
Remove mapping model listenervoid
update(AbstractEvent... events)
Updates all mappings with the given events.
-
-
-
Method Detail
-
register
public void register(Mapping<?,?> mapping)
Registration of a specific mapping- Parameters:
mapping
- is registered mapping
-
getMappingRoot
public <TRoot> TRoot getMappingRoot(Class<TRoot> rootClass)
Get or createsIMappingRoot
object by class.The method looks for the root mapping object in registered the mappings. In case, if root mapping is not completed yet, it will be loaded synchronously.
- Parameters:
rootClass
- the type of root mapping object- Returns:
- The root mapping object, if not found object returns
null
-
getMappingRootAsync
public <TRoot> void getMappingRootAsync(Class<TRoot> rootClass, ICompletedRootHandler<TRoot> completedRootHandler)
Asynchronously provides a completeIMappingRoot
object by class and runs the given handler.- Parameters:
rootClass
- the type of root mapping object, can not benull
completedRootHandler
- the handler for completion, can not benull
-
get
public <TResult,TRoot extends org.eclipse.emf.ecore.EObject> TResult get(Class<TRoot> rootClass, IQuery<TResult,TRoot> query)
Gets data from projective model of root model object by query object(IQuery
).- Parameters:
rootClass
- the root projection model.query
- the query object.- Returns:
- the result of query.
-
addInputListener
public void addInputListener(IEventListener listener)
Register new mapping model listener.- Parameters:
listener
- the listener
-
removeInputListener
public void removeInputListener(IEventListener listener)
Remove mapping model listener- Parameters:
listener
- the listener
-
addOutputListener
public void addOutputListener(IEventListener listener)
Register new mapping model listener.- Parameters:
listener
- the listener
-
removeOutputListener
public void removeOutputListener(IEventListener listener)
Remove mapping model listener- Parameters:
listener
- the listener
-
update
public void update(AbstractEvent... events)
Updates all mappings with the given events.
-
fullUpdate
public void fullUpdate()
Forcedly updates all stored mappings.
-
dispose
public void dispose()
Disposes the current controller and all mappings of it. Also removes all listeners of events to prevent input and output notifications.
-
pushEvent
protected void pushEvent(AbstractEvent event)
Fire all mapping model listener- Parameters:
event
- the mapping model event
-
-