當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。