|
IBM Rational Software Modeler Release 6.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.xtools.common.core.service.AbstractProvider
com.ibm.xtools.transform.core.AbstractTransformationProvider
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. |
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 |
public static final int CODE_SOURCE
public static final int CODE_TARGET_CONTAINER
public static final int CODE_TARGET
public static final int CODE_PROPERTY
public static final int CODE_OTHER
Constructor Detail |
public AbstractTransformationProvider()
Method Detail |
public boolean provides(IOperation operation)
IProvider
Providers generally cast the operation to a service specific
IOperation
-derived class in order to determine whether they
support the request.
operation
- The operation in question.
true
if this provider provides the operation;
false
otherwise.IProvider.provides(com.ibm.xtools.common.core.service.IOperation)
public abstract AbstractTransform createTransformation(ITransformationDescriptor descriptor)
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.
descriptor
- the transformation descriptor
public 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 validated
MultiStatus
,
Status
|
IBM Rational Software Modeler Release 6.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2004. All rights reserved.