org.eclipse.etrice.generator.base
Class AbstractGenerator

java.lang.Object
  extended by org.eclipse.etrice.generator.base.AbstractGenerator
Direct Known Subclasses:
Main, Main, Main

public abstract class AbstractGenerator
extends java.lang.Object

Author:
Henrik Rentz-Reichert

Field Summary
protected  IDiagnostician diagnostician
          
Constructor Summary
AbstractGenerator()
           
 
Method Summary
protected static void createAndRunGenerator(Module generatorModule, java.lang.String[] args)
          creates an instance of the generator and invokes the runGenerator(String[]) method
protected  Root createGeneratorModel(ResourceSet rs, boolean asLibrary, java.lang.String genModelPath)
           
static Injector getInjector()
           
protected  boolean loadModel(java.lang.String uriString, ResourceSet rs)
           
protected  boolean loadModels(java.util.List<java.lang.String> uriList, ResourceSet rs)
          load all models into a ResourceSet
protected abstract  void runGenerator(java.lang.String[] args)
          abstract method which is finally called by createAndRunGenerator(Module, String[])
static void setOutput(ILineOutput out)
           
protected  void setupRoomModel()
          setup the ROOM core model plug-in and create a validator using injection
protected  boolean validateModels(ResourceSet rs)
          validate the models
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

output

protected static ILineOutput output

resourceSetProvider


logger


diagnostician


fileAccess


uriResolver


validator

protected IResourceValidator validator
Constructor Detail

AbstractGenerator

public AbstractGenerator()
Method Detail

setOutput

public static void setOutput(ILineOutput out)

createAndRunGenerator

protected static void createAndRunGenerator(Module generatorModule,
                                            java.lang.String[] args)
creates an instance of the generator and invokes the runGenerator(String[]) method

Parameters:
generatorModule - a Guice module from which the Injector is created

getInjector

public static Injector getInjector()

setupRoomModel

protected void setupRoomModel()
setup the ROOM core model plug-in and create a validator using injection


createGeneratorModel

protected Root createGeneratorModel(ResourceSet rs,
                                    boolean asLibrary,
                                    java.lang.String genModelPath)
Parameters:
rs - the ResourceSet to which the generator model should be added
genModelPath - path to store the generator model (not stored if null)
Returns:
the Root object of the generator model (is added to a new Resource also)

validateModels

protected boolean validateModels(ResourceSet rs)
validate the models

Parameters:
rs -

loadModel

protected boolean loadModel(java.lang.String uriString,
                            ResourceSet rs)
                     throws java.lang.RuntimeException,
                            java.io.IOException
Throws:
java.lang.RuntimeException
java.io.IOException

loadModels

protected boolean loadModels(java.util.List<java.lang.String> uriList,
                             ResourceSet rs)
load all models into a ResourceSet

Parameters:
uriList - a list of URIs as Strings
rs - the ResourceSet

runGenerator

protected abstract void runGenerator(java.lang.String[] args)
abstract method which is finally called by createAndRunGenerator(Module, String[])

Parameters:
args -