## org.eclipse.emf.codegen.ecore.genmodel.generator
Class GenPackageGeneratorAdapter

    java.lang.Object
      org.eclipse.emf.common.notify.impl.SingletonAdapterImpl
          org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter
              org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter
                  org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter

All Implemented Interfaces:
  GeneratorAdapter, Adapter, Adapter.Internal

    public class GenPackageGeneratorAdapter

extends GenBaseGeneratorAdapter

A `GeneratorAdapter` for instances of `GenPackage`. This contributes the package level artifacts to EMF's default code generation.

This implementation should not be extended merely to augment the default code generation for packages. The recommended approach is to implement a new adapter and register the `adapter factory` that creates it, so that it is contributed to code generation. Such registration is usually done through the `org.eclipse.emf.codegen.ecore.generatorAdapters` extension point.

This implementation may be extended, however, in order to remove from or change the default code generation.

Since:
  2.2.0

Nested Class Summary

Nested classes/interfaces inherited from class org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter
`AbstractGeneratorAdapter.JETEmitterDescriptor`

Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
`Adapter.Internal`

Field Summary
`protected static int` `ACTION_BAR_CONTRIBUTOR_ID`
`protected static int` `ADAPTER_FACTORY_CLASS_ID`
`protected static int` `EDITOR_ID`
`protected static int` `FACTORY_CLASS_ID`
`protected static int` `ITEM_PROVIDER_ADAPTER_FACTORY_ID`
`protected static int` `MODEL_ICON_ID`
`protected static int` `MODEL_WIZARD_ICON_ID`
`protected static int` `MODEL_WIZARD_ID`
`protected static int` `PACKAGE_CLASS_ID`
`protected static int` `PACKAGE_EXAMPLE_ID`
`protected static int` `PACKAGE_TEST_SUITE_ID`
`protected static int` `RESOURCE_CLASS_ID`
`protected static int` `RESOURCE_FACTORY_CLASS_ID`
`protected static int` `SWITCH_CLASS_ID`
`protected static int` `VALIDATOR_CLASS_ID`
`protected static int` `XML_PROCESSOR_CLASS_ID`

Fields inherited from class org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter
`EDIT_PROJECT_TYPE, EDITOR_PROJECT_TYPE, MODEL_PROJECT_TYPE, TESTS_PROJECT_TYPE`

Fields inherited from class org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter
`adapterFactory, generatingObject, gifEmitters, importManager, jetEmitters, lineDelimiter, MANIFEST_ENCODING, message, OBJECT_ARGUMENT, PROPERTIES_ENCODING, uriConverter`

Fields inherited from class org.eclipse.emf.common.notify.impl.SingletonAdapterImpl
`targets`

Constructor Summary
`GenPackageGeneratorAdapter(GeneratorAdapterFactory generatorAdapterFactory)`

Method Summary
`protected Diagnostic` `doPostGenerate(java.lang.Object object, java.lang.Object projectType)` Cleans up the `GenPackage` after generation.
`protected Diagnostic` `doPreGenerate(java.lang.Object object, java.lang.Object projectType)` Prepares the `GenPackage` for generation.
`protected void` `generateActionBarContributor(GenPackage genPackage, Monitor monitor)`
`protected void` `generateAdapterFactoryClass(GenPackage genPackage, Monitor monitor)`
`protected Diagnostic` `generateEdit(java.lang.Object object, Monitor monitor)`
`protected void` `generateEditor(GenPackage genPackage, Monitor monitor)`
`protected Diagnostic` `generateEditor(java.lang.Object object, Monitor monitor)`
`protected void` `generateFactoryClass(GenPackage genPackage, Monitor monitor)`
`protected void` `generateFactoryInterface(GenPackage genPackage, Monitor monitor)`
`protected void` `generateItemProviderAdapterFactory(GenPackage genPackage, Monitor monitor)`
`protected Diagnostic` `generateModel(java.lang.Object object, Monitor monitor)`
`protected void` `generateModelIcon(GenPackage genPackage, Monitor monitor)`
`protected void` `generateModelWizard(GenPackage genPackage, Monitor monitor)`
`protected void` `generateModelWizardIcon(GenPackage genPackage, Monitor monitor)`
`protected void` `generatePackageClass(GenPackage genPackage, Monitor monitor)`
`protected void` `generatePackageExample(GenPackage genPackage, Monitor monitor)`
`protected void` `generatePackageInterface(GenPackage genPackage, Monitor monitor)`
`protected void` `generatePackageSerialization(GenPackage genPackage, Monitor monitor)`
`protected void` `generatePackageTestSuite(GenPackage genPackage, Monitor monitor)`
`protected void` `generateResourceClass(GenPackage genPackage, Monitor monitor)`
`protected void` `generateResourceFactoryClass(GenPackage genPackage, Monitor monitor)`
`protected void` `generateSchema(GenPackage genPackage, Monitor monitor)`
`protected void` `generateSwitchClass(GenPackage genPackage, Monitor monitor)`
`protected Diagnostic` `generateTests(java.lang.Object object, Monitor monitor)`
`protected void` `generateValidatorClass(GenPackage genPackage, Monitor monitor)`
`protected void` `generateXMLProcessorClass(GenPackage genPackage, Monitor monitor)`
`protected java.util.Collection<?>` `getGenerateEditChildren(java.lang.Object object)`
`protected java.util.Collection<?>` `getGenerateEditorChildren(java.lang.Object object)`
`protected java.util.Collection<?>` `getGenerateModelChildren(java.lang.Object object)`
`java.lang.Object` `getGenerateParent(java.lang.Object object, java.lang.Object projectType)` Returns the `GenModel` or `GenPackage` that contains the given `GenPackage`.
`protected java.util.Collection<?>` `getGenerateTestsChildren(java.lang.Object object)`
`protected java.lang.String[]` `getInputPathNames()` Returns the set of `GIFEmitter` input paths used by the adapter.
`protected AbstractGeneratorAdapter.JETEmitterDescriptor[]` `getJETEmitterDescriptors()` Returns the set of `JETEmitterDescriptor`s used by the adapter.

Methods inherited from class org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter
`addBaseTemplatePathEntries, addClasspathEntries, canGenerate, canGenerateEdit, canGenerateEditor, canGenerateModel, canGenerateTests, clearImportManager, createImportManager, doGenerate, ensureProjectExists, getGenerateChildren, getParent, getUserTemplatePath, setLineDelimiter`

Methods inherited from class org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter

`createCodeFormatter, createGIFEmitter, createInputStream, createJETEmitter, createMonitor, createOutputStream, ensureContainerExists, exists, formatCode, generate, generateGIF, generateJava, generateProperties, generateText, getAdapterFactory, getCanGenerateChildren, getCanGenerateParent, getContents, getEncoding, getGenerator, getGIFEmitter, getImportManager, getJETEmitter, getLineDelimiter, getLineDelimiter, getURIConverter, isAdapterForType, isReadOnly, postGenerate, preGenerate, setAdapterFactory, setStaticTemplateClass, setWriteable, toDiagnostic, toPlatformResourceURI, toURI, validateEdit`

Methods inherited from class org.eclipse.emf.common.notify.impl.SingletonAdapterImpl
`dispose, getTarget, notifyChanged, setTarget, unsetTarget`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.eclipse.emf.codegen.ecore.generator.GeneratorAdapter
`dispose`

Field Detail

### PACKAGE_CLASS_ID

    protected static final int PACKAGE_CLASS_ID

See Also:
  Constant Field Values

### FACTORY_CLASS_ID

    protected static final int FACTORY_CLASS_ID

See Also:
  Constant Field Values

### XML_PROCESSOR_CLASS_ID

    protected static final int XML_PROCESSOR_CLASS_ID

See Also:
  Constant Field Values

### VALIDATOR_CLASS_ID

    protected static final int VALIDATOR_CLASS_ID

See Also:
  Constant Field Values

### SWITCH_CLASS_ID

    protected static final int SWITCH_CLASS_ID

See Also:
  Constant Field Values

### ADAPTER_FACTORY_CLASS_ID

    protected static final int ADAPTER_FACTORY_CLASS_ID

See Also:
  Constant Field Values

### RESOURCE_FACTORY_CLASS_ID

    protected static final int RESOURCE_FACTORY_CLASS_ID

See Also:
  Constant Field Values

### RESOURCE_CLASS_ID

    protected static final int RESOURCE_CLASS_ID

See Also:
  Constant Field Values

### ITEM_PROVIDER_ADAPTER_FACTORY_ID

    protected static final int ITEM_PROVIDER_ADAPTER_FACTORY_ID

See Also:
  Constant Field Values

### EDITOR_ID

    protected static final int EDITOR_ID

See Also:
  Constant Field Values

### MODEL_WIZARD_ID

    protected static final int MODEL_WIZARD_ID

See Also:
  Constant Field Values

### ACTION_BAR_CONTRIBUTOR_ID

    protected static final int ACTION_BAR_CONTRIBUTOR_ID

See Also:
  Constant Field Values

### PACKAGE_TEST_SUITE_ID

    protected static final int PACKAGE_TEST_SUITE_ID

See Also:
  Constant Field Values

### PACKAGE_EXAMPLE_ID

    protected static final int PACKAGE_EXAMPLE_ID

See Also:
  Constant Field Values

### MODEL_ICON_ID

    protected static final int MODEL_ICON_ID

See Also:
  Constant Field Values

### MODEL_WIZARD_ICON_ID

    protected static final int MODEL_WIZARD_ICON_ID

See Also:
  Constant Field Values

Constructor Detail

### GenPackageGeneratorAdapter

    public GenPackageGeneratorAdapter(GeneratorAdapterFactory generatorAdapterFactory)

Method Detail

### getJETEmitterDescriptors

    protected AbstractGeneratorAdapter.JETEmitterDescriptor[] getJETEmitterDescriptors()

  Returns the set of `JETEmitterDescriptor`s used by the adapter. The contents of the returned array should never be changed. Rather, subclasses may override this method to return a different array altogether.

### getInputPathNames

    protected java.lang.String[] getInputPathNames()

  Returns the set of `GIFEmitter` input paths used by the adapter. The contents of the returned array should never be changed. Rather, subclasses may override this method to return a different array altogether.

### getGenerateModelChildren

    protected java.util.Collection<?> getGenerateModelChildren(java.lang.Object object)

  Overrides:
    `getGenerateModelChildren` in class `GenBaseGeneratorAdapter`

### getGenerateEditChildren

    protected java.util.Collection<?> getGenerateEditChildren(java.lang.Object object)

  Overrides:
    `getGenerateEditChildren` in class `GenBaseGeneratorAdapter`

### getGenerateEditorChildren

    protected java.util.Collection<?> getGenerateEditorChildren(java.lang.Object object)

  Overrides:
    `getGenerateEditorChildren` in class `GenBaseGeneratorAdapter`

### getGenerateTestsChildren

    protected java.util.Collection<?> getGenerateTestsChildren(java.lang.Object object)

  Overrides:
    `getGenerateTestsChildren` in class `GenBaseGeneratorAdapter`

### getGenerateParent

    public java.lang.Object getGenerateParent(java.lang.Object object,
                                              java.lang.Object projectType)

  Returns the `GenModel` or `GenPackage` that contains the given `GenPackage`.

  Specified by:
    `getGenerateParent` in interface `GeneratorAdapter`
  Overrides:
    `getGenerateParent` in class `AbstractGeneratorAdapter`

### doPreGenerate

    protected Diagnostic doPreGenerate(java.lang.Object object,
                                       java.lang.Object projectType)

  Prepares the `GenPackage` for generation.

  Overrides:
    `doPreGenerate` in class `AbstractGeneratorAdapter`

### doPostGenerate

    protected Diagnostic doPostGenerate(java.lang.Object object,
                                        java.lang.Object projectType)

  Cleans up the `GenPackage` after generation.

  Overrides:
    `doPostGenerate` in class `AbstractGeneratorAdapter`

### generateModel

    protected Diagnostic generateModel(java.lang.Object object,
                                       Monitor monitor)

  Overrides:
    `generateModel` in class `GenBaseGeneratorAdapter`

### generateSchema

    protected void generateSchema(GenPackage genPackage,
                                  Monitor monitor)

### generatePackageSerialization

    protected void generatePackageSerialization(GenPackage genPackage,
                                                Monitor monitor)

### generatePackageInterface

    protected void generatePackageInterface(GenPackage genPackage,
                                            Monitor monitor)

### generatePackageClass

    protected void generatePackageClass(GenPackage genPackage,
                                        Monitor monitor)

### generateFactoryInterface

    protected void generateFactoryInterface(GenPackage genPackage,
                                            Monitor monitor)

### generateFactoryClass

    protected void generateFactoryClass(GenPackage genPackage,
                                        Monitor monitor)

### generateXMLProcessorClass

    protected void generateXMLProcessorClass(GenPackage genPackage,
                                             Monitor monitor)

### generateValidatorClass

    protected void generateValidatorClass(GenPackage genPackage,
                                          Monitor monitor)

### generateSwitchClass

    protected void generateSwitchClass(GenPackage genPackage,
                                       Monitor monitor)

### generateAdapterFactoryClass

    protected void generateAdapterFactoryClass(GenPackage genPackage,
                                               Monitor monitor)

### generateResourceFactoryClass

    protected void generateResourceFactoryClass(GenPackage genPackage,
                                                Monitor monitor)

### generateResourceClass

    protected void generateResourceClass(GenPackage genPackage,
                                         Monitor monitor)

### generateEdit

    protected Diagnostic generateEdit(java.lang.Object object,
                                      Monitor monitor)

  Overrides:
    `generateEdit` in class `GenBaseGeneratorAdapter`

### generateItemProviderAdapterFactory

    protected void generateItemProviderAdapterFactory(GenPackage genPackage,
                                                      Monitor monitor)

### generateEditor

    protected Diagnostic generateEditor(java.lang.Object object,
                                        Monitor monitor)

  Overrides:
    `generateEditor` in class `GenBaseGeneratorAdapter`

### generateEditor

    protected void generateEditor(GenPackage genPackage,
                                  Monitor monitor)

### generateModelWizard

    protected void generateModelWizard(GenPackage genPackage,
                                       Monitor monitor)

### generateActionBarContributor

    protected void generateActionBarContributor(GenPackage genPackage,
                                                Monitor monitor)

### generateModelIcon

    protected void generateModelIcon(GenPackage genPackage,
                                     Monitor monitor)

### generateModelWizardIcon

    protected void generateModelWizardIcon(GenPackage genPackage,
                                           Monitor monitor)

### generateTests

    protected Diagnostic generateTests(java.lang.Object object,
                                       Monitor monitor)

  Overrides:
    `generateTests` in class `GenBaseGeneratorAdapter`

### generatePackageTestSuite

    protected void generatePackageTestSuite(GenPackage genPackage,
                                            Monitor monitor)

### generatePackageExample

    protected void generatePackageExample(GenPackage genPackage,
                                          Monitor monitor)

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