当前位置: 首页>>代码示例>>Java>>正文


Java IGenerator类代码示例

本文整理汇总了Java中org.eclipse.xtext.generator.IGenerator的典型用法代码示例。如果您正苦于以下问题:Java IGenerator类的具体用法?Java IGenerator怎么用?Java IGenerator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IGenerator类属于org.eclipse.xtext.generator包,在下文中一共展示了IGenerator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configure

import org.eclipse.xtext.generator.IGenerator; //导入依赖的package包/类
@Override
protected void configure() {
  this.<Resource.Factory>bind(Resource.Factory.class).to(JavaResource.Factory.class);
  this.<IResourceValidator>bind(IResourceValidator.class).toInstance(IResourceValidator.NULL);
  this.<IGenerator>bind(IGenerator.class).to(IGenerator.NullGenerator.class);
  this.<IEncodingProvider>bind(IEncodingProvider.class).to(IEncodingProvider.Runtime.class);
  this.<IResourceServiceProvider>bind(IResourceServiceProvider.class).to(JavaResourceServiceProvider.class);
  this.<IContainer.Manager>bind(IContainer.Manager.class).to(SimpleResourceDescriptionsBasedContainerManager.class);
  this.<IResourceDescription.Manager>bind(IResourceDescription.Manager.class).to(JavaResourceDescriptionManager.class);
  this.<IQualifiedNameProvider>bind(IQualifiedNameProvider.class).to(JvmIdentifiableQualifiedNameProvider.class);
  this.<String>bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("java");
  this.<String>bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.java.Java");
  this.<IJvmTypeProvider.Factory>bind(IJvmTypeProvider.Factory.class).to(ClasspathTypeProviderFactory.class);
  this.<ClassLoader>bind(ClassLoader.class).toInstance(JavaSourceLanguageRuntimeModule.class.getClassLoader());
  this.<IReferableElementsUnloader>bind(IReferableElementsUnloader.class).to(IReferableElementsUnloader.GenericUnloader.class);
  final IResourceDescriptionsProvider _function = (ResourceSet it) -> {
    return ChunkedResourceDescriptions.findInEmfObject(it);
  };
  this.<IResourceDescriptionsProvider>bind(IResourceDescriptionsProvider.class).toInstance(_function);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:21,代码来源:JavaSourceLanguageRuntimeModule.java

示例2: printHelp

import org.eclipse.xtext.generator.IGenerator; //导入依赖的package包/类
public void printHelp(Log log) {
    IGenerator generator = executor.getGenerator();
    if (generator instanceof IJoynrGenerator) {
        IJoynrGenerator joynrGenerator = (IJoynrGenerator) generator;
        Set<String> parameters = joynrGenerator.supportedParameters();
        StringBuffer sb = new StringBuffer();
        sb.append("Supported configuration parameters by the generator: ");
        if (parameters != null && parameters.size() > 0) {
            for (String parameter : parameters) {
                sb.append(parameter + ",");
            }
            sb.deleteCharAt(sb.length() - 1);
        } else {
            sb.append("none");
        }
        log.info(sb.toString());
    } else {
        log.info("no additional information available for the provider generator");
    }
}
 
开发者ID:bmwcarit,项目名称:joynr,代码行数:21,代码来源:GeneratorTask.java

示例3: createGenerator

import org.eclipse.xtext.generator.IGenerator; //导入依赖的package包/类
private IGenerator createGenerator(Injector injector) throws ClassNotFoundException, InstantiationException,
                                                     IllegalAccessException {
    String rootGenerator = arguments.getRootGenerator();
    Class<?> rootGeneratorClass = Class.forName(rootGenerator, true, Thread.currentThread().getContextClassLoader());
    Object templateRootInstance = rootGeneratorClass.newInstance();

    if (templateRootInstance instanceof IGenerator) {
        // This is a standard generator
        IGenerator generator = (IGenerator) templateRootInstance;
        if (generator instanceof IJoynrGenerator) {
            IJoynrGenerator joynrGenerator = (IJoynrGenerator) generator;
            if (joynrGenerator.getGeneratorModule() != null) {
                injector = injector.createChildInjector(joynrGenerator.getGeneratorModule());
            }
            injector.injectMembers(generator);
            joynrGenerator.setParameters(arguments.getParameter());
        } else {
            injector.injectMembers(generator);
        }
        return generator;
    } else {
        throw new IllegalStateException("Root generator \"" + "\" is not implementing interface \""
                + IGenerator.class.getName() + "\"");
    }

}
 
开发者ID:bmwcarit,项目名称:joynr,代码行数:27,代码来源:Executor.java

示例4: invokeGenerator

import org.eclipse.xtext.generator.IGenerator; //导入依赖的package包/类
protected void invokeGenerator(IGenerator generator,
                               String fileName,
                               String outputDirectory,
                               String... referencedResources) {
    final IFileSystemAccess fileSystemAccess = createFileSystemAccess(outputDirectory);

    final URI uri = URI.createFileURI(new File(fileName).getAbsolutePath());
    final Set<URI> uris = new HashSet<URI>();
    uris.add(uri);
    for (String refRes : referencedResources) {
        uris.add(URI.createFileURI(new File(refRes).getAbsolutePath()));
    }
    File file = new File(fileName);
    IUriProvider uriProvider = null;
    if (file.isDirectory()) {
        uriProvider = new FolderUriProvider(Sets.newHashSet("fidl"), file);
    } else {
        uriProvider = new IUriProvider() {

            @Override
            public Iterable<URI> allUris() {
                return Lists.newArrayList(uris);
            }
        };
    }

    ModelStore modelStore = ModelStore.modelsIn(uriProvider);

    for (URI foundUri : uriProvider.allUris()) {
        final Resource r = modelStore.getResource(foundUri);
        generator.doGenerate(r, fileSystemAccess);
    }

}
 
开发者ID:bmwcarit,项目名称:joynr,代码行数:35,代码来源:AbstractGeneratorTest.java

示例5: bindIGenerator

import org.eclipse.xtext.generator.IGenerator; //导入依赖的package包/类
public Class<? extends IGenerator> bindIGenerator() {
	return JvmModelGenerator.class;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:4,代码来源:DefaultXbaseRuntimeModule.java

示例6: bindIGenerator

import org.eclipse.xtext.generator.IGenerator; //导入依赖的package包/类
public Class<? extends IGenerator> bindIGenerator() {
	return ContentAssistTestLanguageGenerator.class;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:4,代码来源:ContentAssistTestLanguageRuntimeModule.java

示例7: bindIGenerator

import org.eclipse.xtext.generator.IGenerator; //导入依赖的package包/类
public Class<? extends IGenerator> bindIGenerator() {
	return MyGenerator.class;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:4,代码来源:BuilderTestLanguageRuntimeModule.java

示例8: getGuiceBindingsRt

import org.eclipse.xtext.generator.IGenerator; //导入依赖的package包/类
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
	if (isGenerateStub(grammar))
		return new BindFactory().addTypeToType(IGenerator.class.getName(), getGeneratorName(grammar, getNaming())).getBindings();
	return Collections.emptySet();
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:7,代码来源:GeneratorFragment.java

示例9: bindIGenerator

import org.eclipse.xtext.generator.IGenerator; //导入依赖的package包/类
/** Creates a properties file in the .settings folder. {@inheritDoc} */
@Override
public Class<? extends IGenerator> bindIGenerator() {
  return CheckCfgGenerator.class;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:6,代码来源:CheckCfgRuntimeModule.java

示例10: bindIGenerator

import org.eclipse.xtext.generator.IGenerator; //导入依赖的package包/类
@Override
public Class<? extends IGenerator> bindIGenerator() {
	return DataTypesGenerator.class;
}
 
开发者ID:visor-vu,项目名称:chariot,代码行数:5,代码来源:DatatypesRuntimeModule.java

示例11: bindIGenerator

import org.eclipse.xtext.generator.IGenerator; //导入依赖的package包/类
@Override
public Class<? extends IGenerator> bindIGenerator() {
	return AuxGenerator.class;
}
 
开发者ID:fmca,项目名称:Tupi,代码行数:5,代码来源:TupiRuntimeModule.java

示例12: bindIGenerator

import org.eclipse.xtext.generator.IGenerator; //导入依赖的package包/类
public Class<? extends IGenerator> bindIGenerator() {
	return XtxtUMLGenerator.class;
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:4,代码来源:XtxtUMLRuntimeModule.java

示例13: bindIGenerator

import org.eclipse.xtext.generator.IGenerator; //导入依赖的package包/类
public Class<? extends IGenerator> bindIGenerator() {
	return IGenerator.NullGenerator.class;
}
 
开发者ID:JanKoehnlein,项目名称:XRobot,代码行数:4,代码来源:XRobotDSLRuntimeModule.java

示例14: bindIGenerator

import org.eclipse.xtext.generator.IGenerator; //导入依赖的package包/类
@Override
public Class<? extends IGenerator> bindIGenerator() {
	return ch.vorburger.xobjects.generator.XObjectsJavaGenerator.class;
}
 
开发者ID:vorburger,项目名称:XObjects,代码行数:5,代码来源:XObjectsRuntimeModule.java

示例15: getGenerator

import org.eclipse.xtext.generator.IGenerator; //导入依赖的package包/类
public IGenerator getGenerator() {
    return generator;
}
 
开发者ID:bmwcarit,项目名称:joynr,代码行数:4,代码来源:Executor.java


注:本文中的org.eclipse.xtext.generator.IGenerator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。