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

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.GenClassGeneratorAdapter
All Implemented Interfaces:
GeneratorAdapter, Adapter, Adapter.Internal

public class GenClassGeneratorAdapter
extends GenBaseGeneratorAdapter

A GeneratorAdapter for instances of GenClass. This contributes the artifacts for every class to EMF's default code generation.

This implementation should not be extended merely to augment the default code generation for classes. 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 CLASS_ID
           
protected static int CREATE_CHILD_ICON_ID
           
protected static int ITEM_ICON_ID
           
protected static int ITEM_PROVIDER_ID
           
protected static int TEST_CASE_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
GenClassGeneratorAdapter(GeneratorAdapterFactory generatorAdapterFactory)
           
 
Method Summary
protected  int countCreateChildIcons(GenClass genClass)
           
protected  void generateClass(GenClass genClass, Monitor monitor)
           
protected  void generateCreateChildIcons(GenClass genClass, Monitor monitor)
           
protected  Diagnostic generateEdit(java.lang.Object object, Monitor monitor)
           
protected  void generateInterface(GenClass genClass, Monitor monitor)
           
protected  void generateItemIcon(GenClass genClass, Monitor monitor)
           
protected  void generateItemProvider(GenClass genClass, Monitor monitor)
           
protected  Diagnostic generateModel(java.lang.Object object, Monitor monitor)
           
protected  void generateTestCase(GenClass genClass, Monitor monitor)
           
protected  Diagnostic generateTests(java.lang.Object object, Monitor monitor)
           
 java.lang.Object getGenerateParent(java.lang.Object object, java.lang.Object projectType)
          Returns the GenPackage that contains the given GenClass.
protected  java.lang.String[] getInputPathNames()
          Returns the set of GIFEmitter input paths used by the adapter.
protected  AbstractGeneratorAdapter.JETEmitterDescriptor[] getJETEmitterDescriptors()
          Returns the set of JETEmitterDescriptors 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, generateEditor, getGenerateChildren, 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, doPreGenerate, 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

CLASS_ID

protected static final int CLASS_ID
See Also:
Constant Field Values

ITEM_PROVIDER_ID

protected static final int ITEM_PROVIDER_ID
See Also:
Constant Field Values

TEST_CASE_ID

protected static final int TEST_CASE_ID
See Also:
Constant Field Values

ITEM_ICON_ID

protected static final int ITEM_ICON_ID
See Also:
Constant Field Values

CREATE_CHILD_ICON_ID

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

GenClassGeneratorAdapter

public GenClassGeneratorAdapter(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.


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.


getGenerateParent

public java.lang.Object getGenerateParent(java.lang.Object object,
                                          java.lang.Object projectType)
Returns the GenPackage that contains the given GenClass.

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

generateModel

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

generateInterface

protected void generateInterface(GenClass genClass,
                                 Monitor monitor)

generateClass

protected void generateClass(GenClass genClass,
                             Monitor monitor)

generateEdit

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

generateItemProvider

protected void generateItemProvider(GenClass genClass,
                                    Monitor monitor)

generateItemIcon

protected void generateItemIcon(GenClass genClass,
                                Monitor monitor)

countCreateChildIcons

protected int countCreateChildIcons(GenClass genClass)

generateCreateChildIcons

protected void generateCreateChildIcons(GenClass genClass,
                                        Monitor monitor)

generateTests

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

generateTestCase

protected void generateTestCase(GenClass genClass,
                                Monitor monitor)

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