IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.transform.core
Class AbstractTransformationProvider

java.lang.Object
  extended bycom.ibm.xtools.common.core.service.AbstractProvider
      extended bycom.ibm.xtools.transform.core.AbstractTransformationProvider
All Implemented Interfaces:
IProvider

public abstract class AbstractTransformationProvider
extends AbstractProvider

The Abstract Transformation Provider is the base class used by authors to provide transformaitons.

A transformation is defined by adding a "com.ibm.xtools.transform.core.transformationProviders" extension where the class attribute identifes a class derived from this class. A <Transformation> element in the XML defines the descriptor of the transformation which includes various properties for integrating the transformation into the transformation service. The main property that must be defined is a unique identifer for the transformation. Along with the default transformation descriptor properties, the author can define special properties to configure the transformation or to allow the user to customize.

When an instace of that transformation is wanted, this provider class is called to create it. A new instance must be created every time since a transformation can be embedded within another transformation. In addition, the provider is responsible for validating a context that will be used to execute the transformation. This context includes the selected source object(s), the target container object and various properties, some of which may have been modified by the user.


Field Summary
static int CODE_OTHER
          Somehting in the environment is invalid.
static int CODE_PROPERTY
          Some other property is invalid.
static int CODE_SOURCE
          Source property is invalid.
static int CODE_TARGET
          Target property is invalid.
static int CODE_TARGET_CONTAINER
          Target Container property is invalid.
 
Constructor Summary
AbstractTransformationProvider()
          Default constructor
 
Method Summary
abstract  AbstractTransform createTransformation(ITransformationDescriptor descriptor)
          Create an instance of the corresponding transformation.
 boolean provides(IOperation operation)
          Indicates whether this provider provides the specified operation.
 org.eclipse.core.runtime.IStatus validateContext(ITransformationDescriptor descriptor, ITransformContext context)
          Validate the context for the corresponding transformation.
 
Methods inherited from class com.ibm.xtools.common.core.service.AbstractProvider
addProviderChangeListener, fireProviderChange, removeProviderChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CODE_SOURCE

public static final int CODE_SOURCE
Source property is invalid.

See Also:
Constant Field Values

CODE_TARGET_CONTAINER

public static final int CODE_TARGET_CONTAINER
Target Container property is invalid.

See Also:
Constant Field Values

CODE_TARGET

public static final int CODE_TARGET
Target property is invalid.

See Also:
Constant Field Values

CODE_PROPERTY

public static final int CODE_PROPERTY
Some other property is invalid.

See Also:
Constant Field Values

CODE_OTHER

public static final int CODE_OTHER
Somehting in the environment is invalid.

See Also:
Constant Field Values
Constructor Detail

AbstractTransformationProvider

public AbstractTransformationProvider()
Default constructor

Method Detail

provides

public boolean provides(IOperation operation)
Description copied from interface: IProvider
Indicates whether this provider provides the specified operation.

Providers generally cast the operation to a service specific IOperation-derived class in order to determine whether they support the request.

Parameters:
operation - The operation in question.
Returns:
true if this provider provides the operation; false otherwise.
See Also:
IProvider.provides(com.ibm.xtools.common.core.service.IOperation)

createTransformation

public abstract AbstractTransform createTransformation(ITransformationDescriptor descriptor)
Create an instance of the corresponding transformation.

Every time this method is called, the provider must create a new instance of the transformation hierarchy and return the root transform of that hierarchy.

Parameters:
descriptor - the transformation descriptor
Returns:
AbstractTransform - root transform of the transformation implementation

validateContext

public org.eclipse.core.runtime.IStatus validateContext(ITransformationDescriptor descriptor,
                                                        ITransformContext context)
Validate the context for the corresponding transformation.

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).

Parameters:
descriptor - the transformation descriptor
context - the context to be validated
Returns:
IStatus - the status of the validate
See Also:
MultiStatus, Status

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.