## org.eclipse.emf.codegen.ecore.generator
Interface GeneratorAdapterFactory

All Superinterfaces:
  AdapterFactory

All Known Implementing Classes:
  AbstractGeneratorAdapterFactory, GenModelGeneratorAdapterFactory

    public interface GeneratorAdapterFactory

extends AdapterFactory

A factory for adapters that perform code generation for a `Generator`.

A single `GeneratorAdapterFactory` is associated with an EMF or Java package, and can return an adapter that implements `GeneratorAdapter` for instances of any or all of the classes within that package. Multiple factories can be associated can be associated with a single package, with all of their adapters contributing functionality to code generation for an object.

A type of `GeneratorAdapterFactory` is registered, via a `descriptor`, against a package ID in a `registry`, in order to create adapters for that package. Typically, this is done via the `org.eclipse.emf.codegen.ecore.generatorAdapters` extension point, using an `adapterFactory` element.

A `GeneratorAdapterFactory` is a factory for type `GeneratorAdapter.class`; that is, its `isFactoryForType(Object)` method should return `true` for this type. However, because EMF's adapter framework supports only one adapter of a given type on any object and because each of many generator adapter factories needs to be able to have a generator on a single object, `GeneratorAdapter.class` cannot be used as the type of the adapters. Instead, each generator adapter factory should use itself as the type of its adapters.

This interface is typically implemented by extending either `AbstractGeneratorAdapterFactory` or the generated adapter factory for a package. The latter approach provides efficient, package-specific type switching for `createAdapter(Notifier)`, while the former provides simple implementations for several other required methods.

There is also a generic implementation provided by the framework that can create a single adapter for just one type of object. This implementation is used under the covers for adapters registered via the above extension point with an `adapter` element.

Since:
  2.2.0

Nested Class Summary
`static interface` `GeneratorAdapterFactory.Descriptor` In essence, a factory for generator adapter factories.

Method Summary
`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.
`void` `setGenerator(Generator generator)` Sets the `Generator` associated with this adapter factory.

Methods inherited from interface org.eclipse.emf.common.notify.AdapterFactory
`adapt, adapt, adaptAllNew, adaptNew, isFactoryForType`

Method Detail

### getGenerator

    Generator getGenerator()

  Returns the `Generator` associated with this adapter factory.

  See Also:
    `setGenerator(Generator)`

### setGenerator

    void setGenerator(Generator generator)

  Sets the `Generator` associated with this adapter factory.

  See Also:
    `getGenerator()`

### initialize

    void initialize(java.lang.Object input)

  Performs initialization for the given model-level input object. Typically, this involves setting `options` on the associated `Generator`.

### dispose

    void dispose()

  Disposes this adapter factory and all of the adapters it has created.

Copyright 2001-2006 IBM Corporation and others. All Rights Reserved.