Acceleo Stand Alone Launch

Stand Alone Launch

 

 

You can launch an Acceleo generator without any dependencies with Eclipse directly from the launch configuration by using the Java Application runner or by using the generated Java launcher class programmatically. When you are using the Acceleo runtime in stand alone, you have a bit more work to do since you will have to register the packages of your metamodel and the resource factories by yourself.

 

In order to register your metamodel, you just have to follow the instructions on the "registerPackages" method.

Here is an example of package registration for the UML metamodel:

resourceSet.getPackageRegistry().put(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getNsURI(), org.eclipse.uml2.uml.UMLPackage.eINSTANCE);

 

If your models have a custom extension (other than ecore or xmi) you will have to register a resource factory in order to tell EMF how your file should be opened. Use the instructions available on the "registerResourceFactories" method.

Here is an example of resource factory registration for the ".uml" files:

resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);


© 2014     Created by Obeo.

Badges  |  Report an Issue  |  Terms of Service