Package org.eclipse.emf.codegen.ecore.generator

Examples of org.eclipse.emf.codegen.ecore.generator.Generator


    //genModel.gen(new BasicMonitor.Printing(System.out));
    GeneratorAdapterFactory.Descriptor.Registry.INSTANCE.addDescriptor
    (GenModelPackage.eNS_URI, GenModelGeneratorAdapterFactory.DESCRIPTOR);
   
    Generator generator = new Generator();

    if ((genOptions & OPTION_NO_EMF) != 0)
    {
      generator.getAdapterFactoryDescriptorRegistry().addDescriptor
        (GenModelPackage.eNS_URI, SDOGenModelGeneratorAdapterFactory.DESCRIPTOR);
    }
   
    generator.setInput(genModel);
    generator.generate(genModel, GenBaseGeneratorAdapter.MODEL_PROJECT_TYPE, new BasicMonitor.Printing(System.out));


    for (Iterator j = resource.getContents().iterator(); j.hasNext();)
    {
      EObject eObject = (EObject)j.next();
View Full Code Here


    //genModel.gen(new BasicMonitor.Printing(System.out));
    GeneratorAdapterFactory.Descriptor.Registry.INSTANCE.addDescriptor
    (GenModelPackage.eNS_URI, GenModelGeneratorAdapterFactory.DESCRIPTOR);
   
    Generator generator = new Generator();

    if ((genOptions & OPTION_NO_EMF) != 0)
    {
      generator.getAdapterFactoryDescriptorRegistry().addDescriptor
        (GenModelPackage.eNS_URI, SDOGenModelGeneratorAdapterFactory.DESCRIPTOR);
    }
   
    generator.setInput(genModel);
    generator.generate(genModel, GenBaseGeneratorAdapter.MODEL_PROJECT_TYPE, new BasicMonitor.Printing(System.out));


    for (Iterator j = resource.getContents().iterator(); j.hasNext();)
    {
      EObject eObject = (EObject)j.next();
View Full Code Here

      GenModel genModel = (GenModel) resource.getContents().get(0);
      genModel.setForceOverwrite(true);
      genModel.setCanGenerate(true);
      genModel.reconcile();

      Generator generator = new Generator();
      generator.getAdapterFactoryDescriptorRegistry().addDescriptor(GenModelPackage.eNS_URI,
          new GeneratorAdapterFactory.Descriptor() {
            public GeneratorAdapterFactory createAdapterFactory() {
              return new GenModelGeneratorAdapterFactory() {

                @Override
                public Adapter createGenClassAdapter() {
                  return new GenClassGeneratorAdapter(this) {
                    @Override
                    protected OutputStream createOutputStream(URI workspacePath) throws Exception {
                      return new LineFilterOutputStream(getURIConverter().createOutputStream(workspacePath),
                          " * $Id" + "$");
                    }

                    @Override
                    protected URI toURI(String pathName) {
                      return URI.createFileURI(uri);
                    }
                  };
                }

                @Override
                public Adapter createGenPackageAdapter() {
                  return new GenPackageGeneratorAdapter(this) {
                    @Override
                    protected URI toURI(String pathName) {
                      return URI.createFileURI(uri);
                    }

                    @Override
                    protected OutputStream createOutputStream(URI workspacePath) throws Exception {
                      return new LineFilterOutputStream(getURIConverter().createOutputStream(workspacePath),
                          " * $Id" + "$");
                    }

                  };
                }
              };
            }
          });
      generator.setInput(genModel);
      Diagnostic diagnostic = generator.generate(genModel, GenBaseGeneratorAdapter.MODEL_PROJECT_TYPE,
          new BasicMonitor());

      if (diagnostic.getSeverity() != Diagnostic.OK)
        System.err.println(diagnostic);
    } catch (Throwable t) {
View Full Code Here

    //genModel.gen(new BasicMonitor.Printing(System.out));
    GeneratorAdapterFactory.Descriptor.Registry.INSTANCE.addDescriptor
    (GenModelPackage.eNS_URI, GenModelGeneratorAdapterFactory.DESCRIPTOR);
   
    //Generator generator = new Generator();
    Generator generator = new Generator()
    {
      public JControlModel getJControlModel()
      {
        if (jControlModel == null)
        {
          jControlModel = new JControlModel();
        }
        return jControlModel;
      }
    };


    //if ((genOptions & OPTION_USE_EMF_PATTERNS) == 0)
    {
      generator.getAdapterFactoryDescriptorRegistry().addDescriptor
      (GenModelPackage.eNS_URI, SDOGenModelGeneratorAdapterFactory.DESCRIPTOR);
    }
   
    generator.setInput(genModel);
    generator.generate(genModel, GenBaseGeneratorAdapter.MODEL_PROJECT_TYPE, new BasicMonitor.Printing(System.out));


    for (Iterator j = resource.getContents().iterator(); j.hasNext();)
    {
      EObject eObject = (EObject)j.next();
View Full Code Here

    //genModel.gen(new BasicMonitor.Printing(System.out));
    GeneratorAdapterFactory.Descriptor.Registry.INSTANCE.addDescriptor
    (GenModelPackage.eNS_URI, GenModelGeneratorAdapterFactory.DESCRIPTOR);
   
    Generator generator = new Generator();

    //if ((genOptions & OPTION_USE_EMF_PATTERNS) == 0)
    {
      generator.getAdapterFactoryDescriptorRegistry().addDescriptor
        (GenModelPackage.eNS_URI, SDOGenModelGeneratorAdapterFactory.DESCRIPTOR);
    }
   
    generator.setInput(genModel);
    generator.generate(genModel, GenBaseGeneratorAdapter.MODEL_PROJECT_TYPE, new BasicMonitor.Printing(System.out));


    for (Iterator j = resource.getContents().iterator(); j.hasNext();)
    {
      EObject eObject = (EObject)j.next();
View Full Code Here

    //genModel.gen(new BasicMonitor.Printing(System.out));
    GeneratorAdapterFactory.Descriptor.Registry.INSTANCE.addDescriptor
    (GenModelPackage.eNS_URI, GenModelGeneratorAdapterFactory.DESCRIPTOR);
   
    Generator generator = new Generator();

    //if ((genOptions & OPTION_USE_EMF_PATTERNS) == 0)
    {
      generator.getAdapterFactoryDescriptorRegistry().addDescriptor
      (GenModelPackage.eNS_URI, SDOGenModelGeneratorAdapterFactory.DESCRIPTOR);
    }
   
    generator.setInput(genModel);
    generator.generate(genModel, GenBaseGeneratorAdapter.MODEL_PROJECT_TYPE, new BasicMonitor.Printing(System.out));


    for (Iterator j = resource.getContents().iterator(); j.hasNext();)
    {
      EObject eObject = (EObject)j.next();
View Full Code Here

TOP

Related Classes of org.eclipse.emf.codegen.ecore.generator.Generator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.