org.eclipse.emf.codegen.ecore.genmodel.GenRuntimeVersion Java Examples

The following examples show how to use org.eclipse.emf.codegen.ecore.genmodel.GenRuntimeVersion. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EMFGeneratorFragment2.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Sets the target EMF runtime version to generate for to the specified value.
 * Defaults to 2.20.
 */
public void setEmfRuntimeVersion(final String emfRuntimeVersion) {
  this.emfRuntimeVersion = GenRuntimeVersion.get(emfRuntimeVersion);
  if ((this.emfRuntimeVersion == null)) {
    EMFGeneratorFragment2.LOG.warn(("Illegal EMF runtime version: " + emfRuntimeVersion));
  }
}
 
Example #2
Source File: DataObjectGenerator.java    From BIMserver with GNU Affero General Public License v3.0 5 votes vote down vote up
public VirtualFile generate(VirtualFile basedir) throws DatabaseException {
		GenModel genModel = GenModelFactory.eINSTANCE.createGenModel();
		genModel.setRuntimeVersion(GenRuntimeVersion.EMF25);
		genModel.setComplianceLevel(GenJDKLevel.JDK60_LITERAL);
		genModel.setFeatureDelegation(GenDelegationKind.REFLECTIVE_LITERAL);
		genModel.setRootExtendsClass("org.bimserver.emf.IdEObjectImpl");
		genModel.setRootExtendsInterface("org.bimserver.emf.IdEObject");
		genModel.setSuppressContainment(true);
		genModel.setCodeFormatting(true);
		genModel.setCopyrightText(StringUtils.readFromFile(new File("copyright.txt")));
		genModel.setCanGenerate(true);
		genModel.setModelDirectory("test");
		genModel.setModelName("model name");
		genModel.setForceOverwrite(true);
		genModel.setSuppressNotification(false);
		genModel.setContainmentProxies(false);
		genModel.setBinaryCompatibleReflectiveMethods(false);
		genModel.setPublicConstructors(false);
		genModel.setMinimalReflectiveMethods(true); // More code, but faster
		genModel.setUpdateClasspath(false);

		genModel.initialize(schema.getEPackages());
		
		GeneratorAdapterFactory.Descriptor.Registry.INSTANCE.addDescriptor(GenModelPackage.eNS_URI, GenModelGeneratorAdapterFactory.DESCRIPTOR);
		Generator generator = new Generator();
		generator.setInput(genModel);
		generator.generate(genModel, GenBaseGeneratorAdapter.MODEL_PROJECT_TYPE, new BasicMonitor.Printing(System.out));

		
//		List<GenPackage> genPackages = createGenPackages(genModel, basedir);
//		generatePackages(genModel, genPackages, basedir);

		return basedir;
	}
 
Example #3
Source File: EMFGeneratorFragment.java    From xtext-extras with Eclipse Public License 2.0 3 votes vote down vote up
/**
 * Sets the target EMF runtime version to generate for to the specified value.
 * Default is 2.20
 * 
 * @param emfRuntimeVersion the EMF runtime version.
 * @since 2.3
 */
public void setEmfRuntimeVersion(String emfRuntimeVersion) {
	this.emfRuntimeVerison = GenRuntimeVersion.get(emfRuntimeVersion);
	if(this.emfRuntimeVerison == null) {
		log.warn("Illegal EMF runtime verison " + emfRuntimeVersion + ". Using default version instead.");
	}
}