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

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

public class GenEnumGeneratorAdapter
extends GenBaseGeneratorAdapter

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

This implementation should not be extended merely to augment the default code generation for enums. 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 ENUM_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
GenEnumGeneratorAdapter(GeneratorAdapterFactory generatorAdapterFactory)
           
 
Method Summary
protected  void generateEnumClass(GenEnum genEnum, Monitor monitor)
           
protected  Diagnostic generateModel(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 GenEnum.
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, generateEdit, generateEditor, generateTests, 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

ENUM_CLASS_ID

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

GenEnumGeneratorAdapter

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


getGenerateParent

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

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

generateEnumClass

protected void generateEnumClass(GenEnum genEnum,
                                 Monitor monitor)

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