Skip to content
Snippets Groups Projects
Commit 98c355e8 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

Provided register method for transformation service.

refs 2590
parent 904bd696
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@
<meta.schema plugin="org.fortiss.tooling.kernel" id="modelStorageProvider" name="Model Storage Provider"/>
</appinfo>
<documentation>
Extension mechanism for model storage providers, i.e. alternative persistency implementations.
DEPRECATED use IPersistencyService.registerModelStorageProvider() instead.
</documentation>
</annotation>
......
......@@ -6,7 +6,7 @@
<meta.schema plugin="org.fortiss.tooling.kernel" id="transformationProvider" name="Transformation Provider"/>
</appinfo>
<documentation>
Register a transformation provider.
DEPRECATED use ITransformationService.registerTransformationProvider() instead.
</documentation>
</annotation>
......
......@@ -76,6 +76,13 @@ public class TransformationService extends ObjectAware2ServiceBase<ITransformati
"\n\nThe service extension point is '" + EXTENSION_POINT_NAME + "'.";
}
/** {@inheritDoc} */
@Override
public void registerTransformationProvider(ITransformationProvider provider,
Class<?> sourceClass, Class<?> targetClass) {
addHandler(sourceClass, targetClass, provider);
}
/**
* Returns the first {@link ITransformationProvider} which can connect the
* given elements (or <code>null</code>n if no such connector exists).
......
......@@ -53,6 +53,10 @@ public interface ITransformationService {
return INSTANCE;
}
/** Registers the given transformation with the service. */
public void registerTransformationProvider(ITransformationProvider provider,
Class<?> sourceClass, Class<?> targetClass);
/**
* Determines if there is a transformation provider, which can perform the
* transformation of the given source element into the given target element.
......
......@@ -74,7 +74,7 @@ import org.osgi.framework.Bundle;
* @author hoelzlf
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 87567F1378B9D6A920F7108A8A3278F5
* @ConQAT.Rating YELLOW Hash: 4C7412DFF5000A87C9EAD1F516EA2E8D
*/
public abstract class ObjectAware2ServiceBase<T extends IObjectAware2<? extends Object, ? extends Object>>
implements IIntrospectiveKernelService {
......@@ -213,7 +213,8 @@ public abstract class ObjectAware2ServiceBase<T extends IObjectAware2<? extends
}
/** Adds the given handler to the map. */
private void addHandler(Class<?> sourceElementClass, Class<?> targetElementClass, T handler) {
protected final void addHandler(Class<?> sourceElementClass, Class<?> targetElementClass,
T handler) {
insertStorage(handlersBySource, sourceElementClass, targetElementClass, handler);
insertStorage(handlersByTarget, targetElementClass, sourceElementClass, handler);
}
......
......@@ -74,7 +74,7 @@ import org.osgi.framework.Bundle;
* @author hoelzlf
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: F22816B51C59771E60DEAA1B5CB36E2C
* @ConQAT.Rating YELLOW Hash: 6263C2A9DB5B72115C3FCF1BB154CEAF
*/
public abstract class ObjectAwareServiceBase<T extends IObjectAware<? extends Object>> implements
IIntrospectiveKernelService {
......@@ -138,7 +138,7 @@ public abstract class ObjectAwareServiceBase<T extends IObjectAware<? extends Ob
}
/** Adds the given handler to the map and the set. */
private void addHandler(Class<?> modelElementClass, T handler) {
protected final void addHandler(Class<?> modelElementClass, T handler) {
List<T> list = handlerMap.get(modelElementClass);
if(list == null) {
list = new LinkedList<T>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment