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 fa4c93ecd1930bd5f66f03d4079201d0d6951160..210be9b7d05300d8735f1d531704088c93abf4d4 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; + } + } }