org.eclipse.jet
Class AbstractContextExtender
java.lang.Object
org.eclipse.jet.AbstractContextExtender
- Direct Known Subclasses:
- TransformContextExtender, WorkspaceContextExtender, XPathContextExtender
public abstract class AbstractContextExtender
- extends java.lang.Object
Base class for extending JET2Context
. The JET execution context, JET2Context
, is capable of
storing private data for various extensions. Subclass this class to create such a private data extension. Steps to create an context
extension.
- Subclass this class
- Implement
createExtendedData(JET2Context)
to return a object representing the private data of the context extension. This method is only called the first time
an extender is constructed for a particular context.
The method getExtendedData()
returns the data to the current context instance.
- Implement additional methods that make use of this private context data.
- Create a constructor that accepts a
JET2Context
and passes it to the super constructor. It is recommended that
this constructor be private.
- (Recommended) Implement a
public static YourExtender getInstance(JET2Context)
method that returns an instance the
AbstractContextExtender subclass.
Method Summary |
protected abstract java.lang.Object |
createExtendedData(JET2Context context)
Called by the AbstractContextExtender constructor if the extender's data
has not yet been created in the context. |
JET2Context |
getContext()
Return the JET2Context that this extender instance is extending. |
protected java.lang.Object |
getExtendedData()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractContextExtender
protected AbstractContextExtender(JET2Context context)
createExtendedData
protected abstract java.lang.Object createExtendedData(JET2Context context)
- Called by the AbstractContextExtender constructor if the extender's data
has not yet been created in the context.
- Parameters:
context
- the context in which the data will be created.
- Returns:
- the extension data object.
getExtendedData
protected java.lang.Object getExtendedData()
getContext
public final JET2Context getContext()
- Return the JET2Context that this extender instance is extending.
- Returns:
- the hosting context.