public final class TransformationServiceUtil
extends java.lang.Object
In addition to the properties defined in the transformation descriptor, the transform context has several special properties that the underlying transformation engine uses. The two key properties are the "source" for the transformation and the "target container" where the transformed source will be created. Before a transform can be executed, its populated transform context should be validated.
Modifier and Type | Method and Description |
---|---|
static AbstractTransform |
createTransformation(ITransformationDescriptor descriptor)
Create a transformation instance for the given transformation
descriptor.
|
static ITransformExtension[] |
getExtensions(ITransformationDescriptor descriptor)
Obtain the registered extensions that target the given transformation.
|
static ITransformationDescriptor |
getTransformationDescriptor(java.lang.String id)
Obtain the transformation descriptor for the given identifier.
|
static ITransformationDescriptor[] |
listTransformations()
Return an array of descriptors for the registered 'public' transformations
|
static org.eclipse.core.runtime.IStatus |
validateContext(ITransformationDescriptor descriptor,
ITransformContext context)
Validate the context for the corresponding transformation.
|
public static AbstractTransform createTransformation(ITransformationDescriptor descriptor)
descriptor
- the transformation descriptorpublic static ITransformationDescriptor getTransformationDescriptor(java.lang.String id)
id
- the unique identifier fo the transformationpublic static org.eclipse.core.runtime.IStatus validateContext(ITransformationDescriptor descriptor, ITransformContext context)
This method can return either a single status object or multiple status objects depending upon the validation performed. If multiple warnings/errors are to be returned use a MultiStatus object. If one of its child status objects has a severity of ERROR, the multi-status is assumed to be an error.
A valid context should return a single status object with a severity of OK. A "null" return value indicates a major error (e.g., the service could not locate or load the provider).
descriptor
- the transformation descriptorcontext
- the context to be validatedMultiStatus
,
Status
public static ITransformationDescriptor[] listTransformations()
public static ITransformExtension[] getExtensions(ITransformationDescriptor descriptor)
descriptor
- The transformation descriptor of the transformation
for which to find extensions.