Skip to content

Adjust EcoreGnerator for extensibility #3636

@philip-iii

Description

@philip-iii

We created a custom generator to produce Java-based implementations of operations specified in OCLinEcore in the Ecore meta-model. To reuse the EcoreGenerator, we made a few minor adjustments that we would push upstream:

  • Move the adapter registration to a separate protected method that can be overridden:
generator.getAdapterFactoryDescriptorRegistry().addDescriptor(
    GenModelPackage.eNS_URI, 
    new GeneratorAdapterDescriptor(
        getTypeMapper(), 
        getLineDelimiter()));
  • Make generator a protected field
  • Optionally change genModel to protected or add a getter
  • Optionally move the generator initialisation to a method

If there is interest, we can also provide the custom OCLinEcoreGenerator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions