public abstract class AbstractGeneratorAdapterFactory extends AdapterFactoryImpl implements GeneratorAdapterFactory
GeneratorAdapterFactory
implementation. Classes that extend this implementation need only
implement createAdapter(Notifier)
and dispose()
.
An alternate approach to implementing GeneratorAdapterFactory
is to extend the adapter factory
generated for a package. GeneratorAdapterFactory
's overrides of isFactoryForType(Object)
and
adapt(Notifier, Object)
should be duplicated in classes that take such an approach.
GeneratorAdapterFactory.Descriptor
Constructor and Description |
---|
AbstractGeneratorAdapterFactory() |
Modifier and Type | Method and Description |
---|---|
Adapter |
adapt(Notifier target,
java.lang.Object type)
|
protected abstract Adapter |
createAdapter(Notifier target)
Override this to create the adapter for a
Notifier . |
protected Adapter |
createAdapter(Notifier target,
java.lang.Object type)
Calls
createAdapter(Notifier) to create an adapter for the given Notifier and sets its
adapter factory to this . |
protected GeneratorAdapter |
createAdapter(java.lang.Object object)
The given object is returned if it is, itself, a
GeneratorAdapter . |
protected java.lang.Object |
createAdapter(java.lang.Object object,
java.lang.Object type)
Calls
createAdapter(Object) to create an adapter for the given object and sets its
adapter factory to this . |
abstract void |
dispose()
Disposes this adapter factory and all of the adapters it has created.
|
Generator |
getGenerator()
Returns the
Generator associated with this adapter factory. |
void |
initialize(java.lang.Object input)
Performs initialization for the given model-level input object.
|
boolean |
isFactoryForType(java.lang.Object type)
Returns
true when the type is GeneratorAdapter.class . |
protected java.lang.Object |
resolve(java.lang.Object object,
java.lang.Object type)
There's no general way to check if a non-
Notifier already has an adapter associated with it, but in
cases where there is a way, override this method and do it here. |
void |
setGenerator(Generator generator)
Sets the
Generator associated with this adapter factory. |
adapt, adaptAllNew, adaptNew, associate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
adapt, adaptAllNew, adaptNew
protected Generator generator
public boolean isFactoryForType(java.lang.Object type)
true
when the type is GeneratorAdapter.class
.isFactoryForType
in interface AdapterFactory
isFactoryForType
in class AdapterFactoryImpl
type
- the key indicating the type of adapter in question.false
.Adapter.isAdapterForType(java.lang.Object)
public Adapter adapt(Notifier target, java.lang.Object type)
adapt(Notifier, Object)
,
substituting this
for the given type
. This substitution is necessary because each of many
generator adapter factories can have its own generator adapter on a single object.adapt
in interface AdapterFactory
adapt
in class AdapterFactoryImpl
target
- the notifier to adapt.type
- the key indicating the type of adapter required.null
otherwise.Adapter.setTarget(org.eclipse.emf.common.notify.Notifier)
,
AdapterFactory.adaptNew(org.eclipse.emf.common.notify.Notifier, java.lang.Object)
protected Adapter createAdapter(Notifier target, java.lang.Object type)
createAdapter(Notifier)
to create an adapter for the given Notifier
and sets its
adapter factory
to this
.createAdapter
in class AdapterFactoryImpl
target
- the notifier to adapt.type
- the key indicating the type of adapter required.AdapterFactoryImpl.createAdapter(Notifier)
protected abstract Adapter createAdapter(Notifier target)
Notifier
. The adapter must implement
GeneratorAdapter
.createAdapter
in class AdapterFactoryImpl
target
- the notifier to adapt.AdapterFactoryImpl.createAdapter(Notifier)
protected java.lang.Object resolve(java.lang.Object object, java.lang.Object type)
Notifier
already has an adapter associated with it, but in
cases where there is a way, override this method and do it here. This method parallels
adapt(Notifier, Object)
for plain Java objects, and is not usually needed when dealing only with
EObject
s.resolve
in class AdapterFactoryImpl
object
- arbitrary object to adapt.type
- the key indicating the type of adapter required.AdapterFactoryImpl.adapt(Object,Object)
protected java.lang.Object createAdapter(java.lang.Object object, java.lang.Object type)
createAdapter(Object)
to create an adapter for the given object and sets its
adapter factory
to this
. This
method parallels createAdapter(Notifier, Object)
for plain Java objects, and is not usually needed when
dealing only with EObject
s.protected GeneratorAdapter createAdapter(java.lang.Object object)
GeneratorAdapter
. This can be overridden to create an
appropriate adapter for a object. It parallels createAdapter(Notifier)
for plain Java objects, and is and
is not usually needed when dealing only with EObject
s.public Generator getGenerator()
GeneratorAdapterFactory
Generator
associated with this adapter factory.getGenerator
in interface GeneratorAdapterFactory
GeneratorAdapterFactory.setGenerator(Generator)
public void setGenerator(Generator generator)
GeneratorAdapterFactory
Generator
associated with this adapter factory.setGenerator
in interface GeneratorAdapterFactory
GeneratorAdapterFactory.getGenerator()
public void initialize(java.lang.Object input)
options
should be set on the generator, or other initialization
is required.initialize
in interface GeneratorAdapterFactory
public abstract void dispose()
GeneratorAdapterFactory
dispose
in interface GeneratorAdapterFactory