From 1d7f646168219d67ce739b7131fff39d5e084f7d Mon Sep 17 00:00:00 2001 From: Florian Hoelzl <hoelzl@fortiss.org> Date: Wed, 7 Sep 2011 13:28:21 +0000 Subject: [PATCH] fixed platform architecture transformation algorithm refs 136 --- .../kernel/utils/TransformationUtils.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/TransformationUtils.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/TransformationUtils.java index fa4c93ecd..210be9b7d 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/TransformationUtils.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/TransformationUtils.java @@ -75,4 +75,22 @@ public final class TransformationUtils { } }; } + + /** + * Searches a transformation chain for the given model element and the + * target class and returns the transformation result. This method returns + * <code>null</code> if the transformation failed. The exception is + * suppressed. + */ + public static <T extends Object> T createTransformedObjectWithoutExceptionFor( + final EObject modelElement, final Class<T> targetClass, + ITransformationContext context) { + try { + T result = createTransformedObjectFor(modelElement, targetClass, + context); + return result; + } catch (ChainTransformationFailedException ctfe) { + return null; + } + } } -- GitLab