org.eclipse.emf.codegen.ecore.genmodel.generator
Class GenModelGeneratorAdapter

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.SingletonAdapterImpl
      extended by org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter
          extended by org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter
              extended by org.eclipse.emf.codegen.ecore.genmodel.generator.GenModelGeneratorAdapter
All Implemented Interfaces:
GeneratorAdapter, Adapter, Adapter.Internal

public class GenModelGeneratorAdapter
extends GenBaseGeneratorAdapter

A GeneratorAdapter for instances of GenModel. This contributes the model level artifacts to EMF's default code generation.

This implementation should not be extended merely to augment the default code generation for models. 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 ADVISOR_ID
           
protected static int EDIT_BUILD_PROPERTIES_ID
           
protected static int EDIT_MANIFEST_MF_ID
           
protected static int EDIT_PLUGIN_CLASS_ID
           
protected static int EDIT_PLUGIN_PROPERTIES_ID
           
protected static int EDIT_PLUGIN_XML_ID
           
protected static int EDITOR_BUILD_PROPERTIES_ID
           
protected static int EDITOR_MANIFEST_MF_ID
           
protected static int EDITOR_PLUGIN_CLASS_ID
           
protected static int EDITOR_PLUGIN_PROPERTIES_ID
           
protected static int EDITOR_PLUGIN_XML_ID
           
protected static int MODEL_BUILD_PROPERTIES_ID
           
protected static int MODEL_MANIFEST_MF_ID
           
protected static int MODEL_PLUGIN_CLASS_ID
           
protected static int MODEL_PLUGIN_PROPERTIES_ID
           
protected static int MODEL_PLUGIN_XML_ID
           
protected static int MODEL_TEST_SUITE_ID
           
protected static int TESTS_BUILD_PROPERTIES_ID
           
protected static int TESTS_MANIFEST_MF_ID
           
protected static int TESTS_PLUGIN_PROPERTIES_ID
           
protected static int TESTS_PLUGIN_XML_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
GenModelGeneratorAdapter(GeneratorAdapterFactory generatorAdapterFactory)
           
 
Method Summary
protected  Diagnostic doPreGenerate(java.lang.Object object, java.lang.Object projectType)
          Prepares the GenModel for generation.
protected  void generateAdvisor(GenModel genModel, Monitor monitor)
           
protected  Diagnostic generateEdit(java.lang.Object object, Monitor monitor)
           
protected  void generateEditBuildProperties(GenModel genModel, Monitor monitor)
           
protected  void generateEditManifest(GenModel genModel, Monitor monitor)
           
protected  Diagnostic generateEditor(java.lang.Object object, Monitor monitor)
           
protected  void generateEditorBuildProperties(GenModel genModel, Monitor monitor)
           
protected  void generateEditorManifest(GenModel genModel, Monitor monitor)
           
protected  void generateEditorPluginClass(GenModel genModel, Monitor monitor)
           
protected  void generateEditorPluginProperties(GenModel genModel, Monitor monitor)
           
protected  void generateEditPluginClass(GenModel genModel, Monitor monitor)
           
protected  void generateEditPluginProperties(GenModel genModel, Monitor monitor)
           
protected  Diagnostic generateModel(java.lang.Object object, Monitor monitor)
           
protected  void generateModelBuildProperties(GenModel genModel, Monitor monitor)
           
protected  void generateModelManifest(GenModel genModel, Monitor monitor)
           
protected  void generateModelPluginClass(GenModel genModel, Monitor monitor)
           
protected  void generateModelPluginProperties(GenModel genModel, Monitor monitor)
           
protected  void generateModelTestSuite(GenModel genModel, Monitor monitor)
           
protected  Diagnostic generateTests(java.lang.Object object, Monitor monitor)
           
protected  void generateTestsBuildProperties(GenModel genModel, Monitor monitor)
           
protected  void generateTestsManifest(GenModel genModel, Monitor monitor)
           
protected  void generateTestsPluginProperties(GenModel genModel, Monitor monitor)
           
 java.util.Collection<?> getGenerateChildren(java.lang.Object object, java.lang.Object projectType)
          Returns the GenModel's packages.
protected  AbstractGeneratorAdapter.JETEmitterDescriptor[] getJETEmitterDescriptors()
          Returns the set of JETEmitterDescriptors used by the adapter.
 void notifyChanged(Notification notification)
          Does nothing; clients may override so that it does something.
 
Methods inherited from class org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter
addBaseTemplatePathEntries, addClasspathEntries, canGenerate, canGenerateEdit, canGenerateEditor, canGenerateModel, canGenerateTests, clearImportManager, createImportManager, doGenerate, ensureProjectExists, getGenerateEditChildren, getGenerateEditorChildren, getGenerateModelChildren, getGenerateTestsChildren, getParent, getUserTemplatePath, setLineDelimiter
 
Methods inherited from class org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter
createCodeFormatter, createGIFEmitter, createInputStream, createJETEmitter, createMonitor, createOutputStream, doPostGenerate, ensureContainerExists, exists, formatCode, generate, generateGIF, generateJava, generateProperties, generateText, getAdapterFactory, getCanGenerateChildren, getCanGenerateParent, getContents, getEncoding, getGenerateParent, 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, 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

MODEL_PLUGIN_CLASS_ID

protected static final int MODEL_PLUGIN_CLASS_ID
See Also:
Constant Field Values

MODEL_MANIFEST_MF_ID

protected static final int MODEL_MANIFEST_MF_ID
See Also:
Constant Field Values

MODEL_PLUGIN_XML_ID

protected static final int MODEL_PLUGIN_XML_ID
See Also:
Constant Field Values

MODEL_PLUGIN_PROPERTIES_ID

protected static final int MODEL_PLUGIN_PROPERTIES_ID
See Also:
Constant Field Values

MODEL_BUILD_PROPERTIES_ID

protected static final int MODEL_BUILD_PROPERTIES_ID
See Also:
Constant Field Values

EDIT_PLUGIN_CLASS_ID

protected static final int EDIT_PLUGIN_CLASS_ID
See Also:
Constant Field Values

EDIT_MANIFEST_MF_ID

protected static final int EDIT_MANIFEST_MF_ID
See Also:
Constant Field Values

EDIT_PLUGIN_XML_ID

protected static final int EDIT_PLUGIN_XML_ID
See Also:
Constant Field Values

EDIT_PLUGIN_PROPERTIES_ID

protected static final int EDIT_PLUGIN_PROPERTIES_ID
See Also:
Constant Field Values

EDIT_BUILD_PROPERTIES_ID

protected static final int EDIT_BUILD_PROPERTIES_ID
See Also:
Constant Field Values

EDITOR_PLUGIN_CLASS_ID

protected static final int EDITOR_PLUGIN_CLASS_ID
See Also:
Constant Field Values

EDITOR_MANIFEST_MF_ID

protected static final int EDITOR_MANIFEST_MF_ID
See Also:
Constant Field Values

EDITOR_PLUGIN_XML_ID

protected static final int EDITOR_PLUGIN_XML_ID
See Also:
Constant Field Values

EDITOR_PLUGIN_PROPERTIES_ID

protected static final int EDITOR_PLUGIN_PROPERTIES_ID
See Also:
Constant Field Values

EDITOR_BUILD_PROPERTIES_ID

protected static final int EDITOR_BUILD_PROPERTIES_ID
See Also:
Constant Field Values

ADVISOR_ID

protected static final int ADVISOR_ID
See Also:
Constant Field Values

MODEL_TEST_SUITE_ID

protected static final int MODEL_TEST_SUITE_ID
See Also:
Constant Field Values

TESTS_MANIFEST_MF_ID

protected static final int TESTS_MANIFEST_MF_ID
See Also:
Constant Field Values

TESTS_PLUGIN_XML_ID

protected static final int TESTS_PLUGIN_XML_ID
See Also:
Constant Field Values

TESTS_PLUGIN_PROPERTIES_ID

protected static final int TESTS_PLUGIN_PROPERTIES_ID
See Also:
Constant Field Values

TESTS_BUILD_PROPERTIES_ID

protected static final int TESTS_BUILD_PROPERTIES_ID
See Also:
Constant Field Values
Constructor Detail

GenModelGeneratorAdapter

public GenModelGeneratorAdapter(GeneratorAdapterFactory generatorAdapterFactory)
Method Detail

getJETEmitterDescriptors

protected AbstractGeneratorAdapter.JETEmitterDescriptor[] getJETEmitterDescriptors()
Returns the set of JETEmitterDescriptors 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.


getGenerateChildren

public java.util.Collection<?> getGenerateChildren(java.lang.Object object,
                                                   java.lang.Object projectType)
Returns the GenModel's packages.

Specified by:
getGenerateChildren in interface GeneratorAdapter
Overrides:
getGenerateChildren in class GenBaseGeneratorAdapter

doPreGenerate

protected Diagnostic doPreGenerate(java.lang.Object object,
                                   java.lang.Object projectType)
Prepares the GenModel for generation.

Overrides:
doPreGenerate in class AbstractGeneratorAdapter

generateModel

protected Diagnostic generateModel(java.lang.Object object,
                                   Monitor monitor)
Overrides:
generateModel in class GenBaseGeneratorAdapter

generateModelPluginClass

protected void generateModelPluginClass(GenModel genModel,
                                        Monitor monitor)

generateModelManifest

protected void generateModelManifest(GenModel genModel,
                                     Monitor monitor)

generateModelPluginProperties

protected void generateModelPluginProperties(GenModel genModel,
                                             Monitor monitor)

generateModelBuildProperties

protected void generateModelBuildProperties(GenModel genModel,
                                            Monitor monitor)

generateEdit

protected Diagnostic generateEdit(java.lang.Object object,
                                  Monitor monitor)
Overrides:
generateEdit in class GenBaseGeneratorAdapter

generateEditPluginClass

protected void generateEditPluginClass(GenModel genModel,
                                       Monitor monitor)

generateEditManifest

protected void generateEditManifest(GenModel genModel,
                                    Monitor monitor)

generateEditPluginProperties

protected void generateEditPluginProperties(GenModel genModel,
                                            Monitor monitor)

generateEditBuildProperties

protected void generateEditBuildProperties(GenModel genModel,
                                           Monitor monitor)

generateEditor

protected Diagnostic generateEditor(java.lang.Object object,
                                    Monitor monitor)
Overrides:
generateEditor in class GenBaseGeneratorAdapter

generateEditorPluginClass

protected void generateEditorPluginClass(GenModel genModel,
                                         Monitor monitor)

generateEditorManifest

protected void generateEditorManifest(GenModel genModel,
                                      Monitor monitor)

generateEditorPluginProperties

protected void generateEditorPluginProperties(GenModel genModel,
                                              Monitor monitor)

generateEditorBuildProperties

protected void generateEditorBuildProperties(GenModel genModel,
                                             Monitor monitor)

generateAdvisor

protected void generateAdvisor(GenModel genModel,
                               Monitor monitor)

generateTests

protected Diagnostic generateTests(java.lang.Object object,
                                   Monitor monitor)
Overrides:
generateTests in class GenBaseGeneratorAdapter

generateModelTestSuite

protected void generateModelTestSuite(GenModel genModel,
                                      Monitor monitor)

generateTestsManifest

protected void generateTestsManifest(GenModel genModel,
                                     Monitor monitor)

generateTestsPluginProperties

protected void generateTestsPluginProperties(GenModel genModel,
                                             Monitor monitor)

generateTestsBuildProperties

protected void generateTestsBuildProperties(GenModel genModel,
                                            Monitor monitor)

notifyChanged

public void notifyChanged(Notification notification)
Description copied from class: SingletonAdapterImpl
Does nothing; clients may override so that it does something.

Specified by:
notifyChanged in interface Adapter
Overrides:
notifyChanged in class SingletonAdapterImpl
Parameters:
notification - a description of the change.

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