本文整理汇总了Java中org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter类的典型用法代码示例。如果您正苦于以下问题:Java GenBaseGeneratorAdapter类的具体用法?Java GenBaseGeneratorAdapter怎么用?Java GenBaseGeneratorAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GenBaseGeneratorAdapter类属于org.eclipse.emf.codegen.ecore.genmodel.generator包,在下文中一共展示了GenBaseGeneratorAdapter类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: generate
import org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter; //导入依赖的package包/类
public void generate(GenModel genModel) {
// Generate Code
genModel.setCanGenerate(true);
GeneratorAdapterFactory.Descriptor.Registry.INSTANCE.addDescriptor(
GenModelPackage.eNS_URI,
GenModelGeneratorAdapterFactory.DESCRIPTOR);
// Create the generator and set the model-level input object.
Generator generator = new Generator();
generator.setInput(genModel);
// Generator model code.
Diagnostic d = generator.generate(genModel,
GenBaseGeneratorAdapter.MODEL_PROJECT_TYPE,
new BasicMonitor.Printing(System.out));
System.out.println(d.getMessage());
}
开发者ID:diverse-project,项目名称:k3,代码行数:20,代码来源:GenerateGenModelCode.java
示例2: executeTransformation
import org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter; //导入依赖的package包/类
public void executeTransformation(IExecutionInformation executionInformation) throws Exception {
ResourceSet resourceSet = new ResourceSetImpl();
Resource resource = resourceSet.createResource(locator.getEMFURI(inputModels.get(0).getModel()));
resource.load(null);
EcoreUtil.resolveAll(resourceSet);
GenModel genModel = (GenModel) resource.getContents().get(0);
genModel.setDynamicTemplates(true);
genModel.setTemplateDirectory("platform:/plugin/emf-rest/templates");
genModel.setCanGenerate(true);
genModel.setModelDirectory(genModel.getModelDirectory()+"/main/java");
System.out.println("test");
// generate the code
Generator generator = new Generator();
generator.setInput(genModel);
generator.generate(genModel, GenBaseGeneratorAdapter.MODEL_PROJECT_TYPE, new BasicMonitor.Printing(System.err));
for (OutputFile outFile : outputFiles) {
executionEnvironment.fileReady(outFile.getFile(), transformation);
}
}
开发者ID:SOM-Research,项目名称:emf-rest,代码行数:20,代码来源:EMFGenerator.java
示例3: generate
import org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter; //导入依赖的package包/类
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;
}
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:35,代码来源:DataObjectGenerator.java
示例4: doGenerate
import org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter; //导入依赖的package包/类
protected void doGenerate(final GenModel genModel) {
final Generator generator = new Generator() {
@Override
public JControlModel getJControlModel() {
if ((this.jControlModel == null)) {
JControlModel _jControlModel = new JControlModel();
this.jControlModel = _jControlModel;
this.jControlModel.initialize(null, this.options.mergeRulesURI);
}
return this.jControlModel;
}
};
GeneratorAdapterFactory.Descriptor.Registry _adapterFactoryDescriptorRegistry = generator.getAdapterFactoryDescriptorRegistry();
String _lineDelimiter = this.codeConfig.getLineDelimiter();
CvsIdFilteringGeneratorAdapterFactoryDescriptor _cvsIdFilteringGeneratorAdapterFactoryDescriptor = new CvsIdFilteringGeneratorAdapterFactoryDescriptor(_lineDelimiter);
_adapterFactoryDescriptorRegistry.addDescriptor(GenModelPackage.eNS_URI, _cvsIdFilteringGeneratorAdapterFactoryDescriptor);
genModel.setCanGenerate(true);
generator.setInput(genModel);
BasicMonitor _basicMonitor = new BasicMonitor();
final Diagnostic diagnostic = generator.generate(genModel, GenBaseGeneratorAdapter.MODEL_PROJECT_TYPE, _basicMonitor);
int _severity = diagnostic.getSeverity();
boolean _notEquals = (_severity != Diagnostic.OK);
if (_notEquals) {
EMFGeneratorFragment2.LOG.warn(diagnostic);
}
if (this.generateEdit) {
BasicMonitor _basicMonitor_1 = new BasicMonitor();
final Diagnostic editDiag = generator.generate(genModel, GenBaseGeneratorAdapter.EDIT_PROJECT_TYPE, _basicMonitor_1);
int _severity_1 = editDiag.getSeverity();
boolean _notEquals_1 = (_severity_1 != Diagnostic.OK);
if (_notEquals_1) {
EMFGeneratorFragment2.LOG.warn(editDiag);
}
}
if (this.generateEditor) {
BasicMonitor _basicMonitor_2 = new BasicMonitor();
final Diagnostic editorDiag = generator.generate(genModel, GenBaseGeneratorAdapter.EDITOR_PROJECT_TYPE, _basicMonitor_2);
int _severity_2 = editorDiag.getSeverity();
boolean _notEquals_2 = (_severity_2 != Diagnostic.OK);
if (_notEquals_2) {
EMFGeneratorFragment2.LOG.warn(editorDiag);
}
}
}
开发者ID:eclipse,项目名称:xtext-core,代码行数:45,代码来源:EMFGeneratorFragment2.java
示例5: doGenerate
import org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter; //导入依赖的package包/类
@Override
protected void doGenerate(final GenModel genModel) {
if (LOGGER.isInfoEnabled()) {
LOGGER.info("generating EMF code for " + genModel.eResource().getURI()); //$NON-NLS-1$
}
Generator generator = new Generator() {
@Override
public JControlModel getJControlModel() {
return new JControlModel() {
@Override
public boolean canMerge() {
return false;
}
};
}
};
genModel.setNonNLSMarkers(generateNonNLSMarkers);
generator.getAdapterFactoryDescriptorRegistry().addDescriptor(GenModelPackage.eNS_URI, new GeneratorAdapterDescriptor(getTypeMapper()));
generator.setInput(genModel);
Diagnostic diagnostic = generator.generate(genModel, GenBaseGeneratorAdapter.MODEL_PROJECT_TYPE, new BasicMonitor());
if (diagnostic.getSeverity() != Diagnostic.OK) {
LOGGER.info(diagnostic);
}
if (isGenerateEdit()) {
Diagnostic editDiag = generator.generate(genModel, GenBaseGeneratorAdapter.EDIT_PROJECT_TYPE, new BasicMonitor());
if (editDiag.getSeverity() != Diagnostic.OK) {
LOGGER.info(editDiag);
}
}
if (isGenerateEditor()) {
Diagnostic editorDiag = generator.generate(genModel, GenBaseGeneratorAdapter.EDITOR_PROJECT_TYPE, new BasicMonitor());
if (editorDiag.getSeverity() != Diagnostic.OK) {
LOGGER.info(editorDiag);
}
}
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:44,代码来源:CustomClassEcoreGeneratorFragment.java
注:本文中的org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论