本文整理匯總了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);
}
示例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");
}
}
示例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() + "\"");
}
}
示例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);
}
}
示例5: bindIGenerator
import org.eclipse.xtext.generator.IGenerator; //導入依賴的package包/類
public Class<? extends IGenerator> bindIGenerator() {
return JvmModelGenerator.class;
}
示例6: bindIGenerator
import org.eclipse.xtext.generator.IGenerator; //導入依賴的package包/類
public Class<? extends IGenerator> bindIGenerator() {
return ContentAssistTestLanguageGenerator.class;
}
示例7: bindIGenerator
import org.eclipse.xtext.generator.IGenerator; //導入依賴的package包/類
public Class<? extends IGenerator> bindIGenerator() {
return MyGenerator.class;
}
示例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();
}
示例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;
}
示例10: bindIGenerator
import org.eclipse.xtext.generator.IGenerator; //導入依賴的package包/類
@Override
public Class<? extends IGenerator> bindIGenerator() {
return DataTypesGenerator.class;
}
示例11: bindIGenerator
import org.eclipse.xtext.generator.IGenerator; //導入依賴的package包/類
@Override
public Class<? extends IGenerator> bindIGenerator() {
return AuxGenerator.class;
}
示例12: bindIGenerator
import org.eclipse.xtext.generator.IGenerator; //導入依賴的package包/類
public Class<? extends IGenerator> bindIGenerator() {
return XtxtUMLGenerator.class;
}
示例13: bindIGenerator
import org.eclipse.xtext.generator.IGenerator; //導入依賴的package包/類
public Class<? extends IGenerator> bindIGenerator() {
return IGenerator.NullGenerator.class;
}
示例14: bindIGenerator
import org.eclipse.xtext.generator.IGenerator; //導入依賴的package包/類
@Override
public Class<? extends IGenerator> bindIGenerator() {
return ch.vorburger.xobjects.generator.XObjectsJavaGenerator.class;
}
示例15: getGenerator
import org.eclipse.xtext.generator.IGenerator; //導入依賴的package包/類
public IGenerator getGenerator() {
return generator;
}