org.eclipse.emf.codegen.ecore.genmodel.GenJDKLevel Java Examples
The following examples show how to use
org.eclipse.emf.codegen.ecore.genmodel.GenJDKLevel.
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: DataObjectGenerator.java From BIMserver with GNU Affero General Public License v3.0 | 5 votes |
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 #2
Source File: EMFGeneratorFragment2.java From xtext-core with Eclipse Public License 2.0 | 3 votes |
/** * Set the JDK compatibility level. The following values are valid: * <ul> * <li>"JDK14"</li> * <li>"JDK50"</li> * <li>"JDK60"</li> * <li>"JDK70"</li> * <li>"JDK80"</li> * </ul> * The default level is "JDK80". */ public void setJdkLevel(final String jdkLevel) { this.jdkLevel = GenJDKLevel.getByName(jdkLevel); if ((this.jdkLevel == null)) { EMFGeneratorFragment2.LOG.warn(("Illegal JDK level: " + jdkLevel)); } }
Example #3
Source File: EMFGeneratorFragment.java From xtext-extras with Eclipse Public License 2.0 | 2 votes |
/** * Set the JDK compatibility level. The following values are valid: * <ul> * <li>"JDK14"</li> * <li>"JDK50"</li> * <li>"JDK60"</li> * <li>"JDK70"</li> * <li>"JDK80"</li> * </ul> * The default level is "JDK80". * * @since 2.8 */ public void setJdkLevel(String jdkLevel) { GenJDKLevel l = GenJDKLevel.getByName(jdkLevel); Assert.isNotNull(l, "Invalid JDK level"); this.jdkLevel = l; }