當前位置: 首頁>>代碼示例>>Java>>正文


Java BindFactory.addTypeToType方法代碼示例

本文整理匯總了Java中org.eclipse.xtext.generator.BindFactory.addTypeToType方法的典型用法代碼示例。如果您正苦於以下問題:Java BindFactory.addTypeToType方法的具體用法?Java BindFactory.addTypeToType怎麽用?Java BindFactory.addTypeToType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.xtext.generator.BindFactory的用法示例。


在下文中一共展示了BindFactory.addTypeToType方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getGuiceBindingsRt

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
	BindFactory factory = new BindFactory()
		.addTypeToType(IParser.class.getName(),getParserClassName(grammar, getNaming()))
		.addTypeToType(ITokenToStringConverter.class.getName(),AntlrTokenToStringConverter.class.getName())
		.addTypeToType(IAntlrTokenFileProvider.class.getName(),getAntlrTokenFileProviderClassName(grammar, getNaming()))
		.addTypeToType(Lexer.class.getName(), getLexerClassName(grammar, getNaming()))
		.addTypeToProviderInstance(getLexerClassName(grammar, getNaming()), "org.eclipse.xtext.parser.antlr.LexerProvider.create(" + getLexerClassName(grammar, getNaming()) + ".class)")
		.addConfiguredBinding("RuntimeLexer",
				"binder.bind(" + Lexer.class.getName() + ".class)"+
				".annotatedWith(com.google.inject.name.Names.named(" +
				"org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME" +
				")).to(" + getLexerClassName(grammar, getNaming()) +".class)")
		.addTypeToType(ITokenDefProvider.class.getName(), AntlrTokenDefProvider.class.getName());
	if (containsUnorderedGroup(grammar))
		factory = factory.addTypeToType(IUnorderedGroupHelper.class.getName(), UnorderedGroupHelper.class.getName());
	return factory.getBindings();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:19,代碼來源:XtextAntlrGeneratorFragment.java

示例2: getGuiceBindingsRt

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
	BindFactory factory = new BindFactory()
		.addTypeToType(IParser.class.getName(),getFragmentHelper().getParserClassName(grammar))
		.addTypeToType(ITokenToStringConverter.class.getName(),AntlrTokenToStringConverter.class.getName())
		.addTypeToType(IAntlrTokenFileProvider.class.getName(),getFragmentHelper().getAntlrTokenFileProviderClassName(grammar))
		.addTypeToType(Lexer.class.getName(), getFragmentHelper().getLexerClassName(grammar))
		.addTypeToProviderInstance(getFragmentHelper().getLexerClassName(grammar), "org.eclipse.xtext.parser.antlr.LexerProvider.create(" + getFragmentHelper().getLexerClassName(grammar) + ".class)")
		.addConfiguredBinding("RuntimeLexer",
				"binder.bind(" + Lexer.class.getName() + ".class)"+
				".annotatedWith(com.google.inject.name.Names.named(" +
				"org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME" +
				")).to(" + getFragmentHelper().getLexerClassName(grammar) +".class)")
		.addTypeToType(ITokenDefProvider.class.getName(),AntlrTokenDefProvider.class.getName());
	if (containsUnorderedGroup(grammar))
		factory = factory.addTypeToType(IUnorderedGroupHelper.class.getName(), UnorderedGroupHelper.class.getName());
	if (getOptions().isIgnoreCase()) {
		factory = factory
			.addTypeToType(ITokenSerializer.IKeywordSerializer.class.getName(), IgnoreCaseKeywordSerializer.class.getName())
			.addTypeToType(AbstractIDValueConverter.class.getName(), IgnoreCaseIDValueConverter.class.getName());
	}
	return factory.getBindings();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:24,代碼來源:AntlrGeneratorFragment.java

示例3: getGuiceBindingsRt

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
	BindFactory factory = new BindFactory();
	if (!XbaseGeneratorFragment.doesUseXbase(grammar)) {
		if(isGenerateStub) {
			factory.addTypeToType(IScopeProvider.class.getName(), getScopeProviderName(grammar, getNaming()));
		} else {
			factory.addTypeToType(IScopeProvider.class.getName(), getLocalScopeProvider().getName());
		}
		factory.addConfiguredBinding(
				IScopeProvider.class.getName() + "Delegate",
				"binder.bind(" + IScopeProvider.class.getName() + ".class"
						+ ").annotatedWith(com.google.inject.name.Names.named("
						+ AbstractDeclarativeScopeProvider.class.getName() + ".NAMED_DELEGATE" + ")).to("
						+ getLocalScopeProvider().getName() + ".class)");
		factory.addTypeToType(IGlobalScopeProvider.class.getName(), getGlobalScopeProvider().getName());
	}
	factory.addConfiguredBinding(IgnoreCaseLinking.class.getSimpleName(), "binder.bindConstant().annotatedWith("
			+ IgnoreCaseLinking.class.getName() + ".class).to(" + isIgnoreCase() + ")");
	return factory.getBindings();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:22,代碼來源:AbstractScopingFragment.java

示例4: getGuiceBindingsRt

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  final StringBuilder cfg = new StringBuilder();
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("binder.bind(");
  String _name = IPreferenceValuesProvider.class.getName();
  _builder.append(_name);
  _builder.append(".class)");
  cfg.append(_builder);
  StringConcatenation _builder_1 = new StringConcatenation();
  _builder_1.append(".annotatedWith(");
  String _name_1 = FormatterPreferences.class.getName();
  _builder_1.append(_name_1);
  _builder_1.append(".class)");
  cfg.append(_builder_1);
  StringConcatenation _builder_2 = new StringConcatenation();
  _builder_2.append(".to(");
  String _name_2 = FormatterPreferenceValuesProvider.class.getName();
  _builder_2.append(_name_2);
  _builder_2.append(".class);");
  cfg.append(_builder_2);
  final BindFactory bf = new BindFactory();
  bf.addTypeToType(IFormatter2.class.getName(), this.stubGenerator.getStubQualifiedName());
  bf.addConfiguredBinding(FormatterPreferences.class.getName(), cfg.toString());
  return bf.getBindings();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:27,代碼來源:Formatter2Fragment.java

示例5: getGuiceBindingsUi

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsUi(final Grammar grammar) {
  Set<Binding> _xblockexpression = null;
  {
    final BindFactory bindFactory = new BindFactory();
    if (this.generateStub) {
      bindFactory.addTypeToType("org.eclipse.xtext.ui.editor.contentassist.IContentProposalProvider", 
        this.getProposalProviderName(grammar));
    } else {
      bindFactory.addTypeToType("org.eclipse.xtext.ui.editor.contentassist.IContentProposalProvider", 
        this.getGenProposalProviderName());
    }
    _xblockexpression = bindFactory.getBindings();
  }
  return _xblockexpression;
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:17,代碼來源:ContentAssistFragment.java

示例6: getGuiceBindingsUi

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
	BindFactory binder = new BindFactory();
		binder.addTypeToType("org.eclipse.xtext.ui.editor.contentassist.IProposalConflictHelper", "org.eclipse.xtext.ui.editor.contentassist.antlr.AntlrProposalConflictHelper");
		if(getNaming().hasIde()){
			binder.addConfiguredBinding("HighlightingLexer",
					"binder.bind(" + Lexer.class.getName() + ".class)"+
					".annotatedWith(com.google.inject.name.Names.named(" +
					"org.eclipse.xtext.ide.LexerIdeBindings.HIGHLIGHTING" +
					")).to(" + getLexerClassName(grammar, getNaming()) +".class)")
				   .addConfiguredBinding("HighlightingTokenDefProvider",
					"binder.bind(" + ITokenDefProvider.class.getName() + ".class)"+
					".annotatedWith(com.google.inject.name.Names.named(" +
					"org.eclipse.xtext.ide.LexerIdeBindings.HIGHLIGHTING" +
					")).to(" + AntlrTokenDefProvider.class.getName() +".class)");
		} else {
			binder.addConfiguredBinding("HighlightingLexer",
					"binder.bind(" + Lexer.class.getName() + ".class)"+
					".annotatedWith(com.google.inject.name.Names.named(" +
					"org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING" +
					")).to(" + getLexerClassName(grammar, getNaming()) +".class)")
				   .addConfiguredBinding("HighlightingTokenDefProvider",
					"binder.bind(" + ITokenDefProvider.class.getName() + ".class)"+
					".annotatedWith(com.google.inject.name.Names.named(" +
					"org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING" +
					")).to(" + AntlrTokenDefProvider.class.getName() +".class)");
		}
		return binder.getBindings();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:30,代碼來源:XtextAntlrGeneratorFragment.java

示例7: getGuiceBindingsRt

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  final Set<Binding> bindings = super.getGuiceBindingsRt(grammar);
  final BindFactory factory = new BindFactory();
  factory.addTypeToType(IContainer.Manager.class.getName(), "com.avaloq.tools.ddk.xtext.builder.CachingStateBasedContainerManager");
  factory.addTypeToType(LazyLinkingResource.class.getName(), LazyLinkingResource2.class.getName());
  factory.addTypeToType(LazyURIEncoder.class.getName(), FastLazyURIEncoder.class.getName());
  final Set<Binding> result = factory.getBindings();
  result.addAll(bindings);
  return result;
}
 
開發者ID:dsldevkit,項目名稱:dsl-devkit,代碼行數:12,代碼來源:BuilderIntegrationFragment.java

示例8: getGuiceBindingsRt

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
	BindFactory bindFactory = new BindFactory();
	// generating this binding for terminals will break existing languages
	if(!equal("org.eclipse.xtext.common.Terminals", grammar.getName())) {
		bindFactory
			.addTypeToInstance(ClassLoader.class.getName(), "getClass().getClassLoader()");
	}
	bindFactory.addTypeToType(IGrammarAccess.class.getName(), GrammarAccessUtil.getGrammarAccessFQName(grammar, getNaming()));
	return bindFactory.getBindings();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:12,代碼來源:GrammarAccessFragment.java

示例9: getGuiceBindingsUi

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
	BindFactory bindFactory = new BindFactory()
		.addTypeToProviderInstance(
				IAllContainersState.class.getName(),
				"org.eclipse.xtext.ui.shared.Access.getJavaProjectsState()");
	if (XbaseGeneratorFragment.doesUseXbase(grammar)) {
		bindFactory = bindFactory.addTypeToType("org.eclipse.xtext.ui.editor.XtextEditor", "org.eclipse.xtext.xbase.ui.editor.XbaseEditor");
		bindFactory = bindFactory.addTypeToType("org.eclipse.xtext.ui.editor.model.XtextDocumentProvider", "org.eclipse.xtext.xbase.ui.editor.XbaseDocumentProvider");
		bindFactory = bindFactory.addTypeToType("org.eclipse.xtext.ui.generator.trace.OpenGeneratedFileHandler", "org.eclipse.xtext.xbase.ui.generator.trace.XbaseOpenGeneratedFileHandler");
	}
	return bindFactory.getBindings();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:14,代碼來源:ImplicitUiFragment.java

示例10: getGuiceBindingsUi

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
	BindFactory bindFactory = new BindFactory();
	if(isGenerateStub()) {
		 bindFactory
			.addTypeToType("org.eclipse.xtext.ui.editor.quickfix.IssueResolutionProvider", getQuickfixProviderName(grammar, getNaming()));
	} else {
		 bindFactory
			.addTypeToType("org.eclipse.xtext.ui.editor.quickfix.IssueResolutionProvider", getQuickfixProviderSuperClassName(grammar));
	}
	return bindFactory.getBindings();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:13,代碼來源:QuickfixProviderFragment.java

示例11: getGuiceBindingsRt

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  Set<Binding> _xblockexpression = null;
  {
    final BindFactory bind = new BindFactory();
    bind.addTypeToType("org.eclipse.xtext.tasks.ITaskTagProvider", 
      "org.eclipse.xtext.tasks.PreferenceTaskTagProvider");
    _xblockexpression = bind.getBindings();
  }
  return _xblockexpression;
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:12,代碼來源:TaskTagPreferencePageFragment.java

示例12: getGuiceBindingsRt

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  final BindFactory bf = new BindFactory();
  bf.addTypeToType(ISemanticSequencer.class.getName(), this.names.getSemanticSequencer().getQualifiedName());
  bf.addTypeToType(ISyntacticSequencer.class.getName(), this.names.getSyntacticSequencer().getQualifiedName());
  bf.addTypeToType(ISerializer.class.getName(), Serializer.class.getName());
  return bf.getBindings();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:9,代碼來源:SerializerFragment.java

示例13: getGuiceBindingsUi

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsUi(final Grammar grammar) {
  final BindFactory bf = new BindFactory();
  bf.addTypeToType(
    "org.eclipse.xtext.ui.editor.formatting.IContentFormatterFactory", 
    "org.eclipse.xtext.ui.editor.formatting2.ContentFormatterFactory");
  return bf.getBindings();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:9,代碼來源:Formatter2Fragment.java

示例14: getGuiceBindingsRt

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  final BindFactory bindFactory = new BindFactory();
  final String namingPrefix = GrammarUtil.getNamespace(grammar) + ".naming." + GrammarUtil.getName(grammar); //$NON-NLS-1$
  final String resourcePrefix = GrammarUtil.getNamespace(grammar) + ".resource." + GrammarUtil.getName(grammar); //$NON-NLS-1$

  ExportModel m = getModel(grammar);
  if (m != null) {
    bindFactory.addTypeToType(IQualifiedNameProvider.class.getName(), namingPrefix + "ExportedNamesProvider"); //$NON-NLS-1$
    if (!m.getInterfaces().isEmpty()) {
      bindFactory.addTypeToType(IFingerprintComputer.class.getName(), resourcePrefix + "FingerprintComputer"); //$NON-NLS-1$
    }
    if (!m.getExports().isEmpty()) {
      bindFactory.addTypeToType(IDefaultResourceDescriptionStrategy.class.getName(), resourcePrefix + "ResourceDescriptionStrategy"); //$NON-NLS-1$
    }
    if (Iterables.any(m.getExports(), new Predicate<Export>() {
      @Override
      public boolean apply(final Export input) {
        return input.isFingerprint() && input.getFragmentAttribute() != null;
      }
    })) {
      bindFactory.addTypeToType(IFragmentProvider.class.getName(), resourcePrefix + "FragmentProvider");
    }
  }
  bindFactory.addTypeToType(IResourceDescription.Manager.class.getName(), resourcePrefix + "ResourceDescriptionManager"); //$NON-NLS-1$
  return bindFactory.getBindings();
}
 
開發者ID:dsldevkit,項目名稱:dsl-devkit,代碼行數:29,代碼來源:ExportFragment.java

示例15: getGuiceBindingsRt

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  final BindFactory bindFactory = new BindFactory();
  bindFactory.addTypeToType(IFormatter.class.getName(), FormatGeneratorUtil.getFormatterName(grammar, ""));
  bindFactory.addTypeToType(INodeModelFormatter.class.getName(), RegionNodeModelFormatter.class.getName());
  bindFactory.addTypeToType(INodeModelStreamer.class.getName(), DirectNodeModelStreamer.class.getName());
  return bindFactory.getBindings();
}
 
開發者ID:dsldevkit,項目名稱:dsl-devkit,代碼行數:10,代碼來源:FormatFragment.java


注:本文中的org.eclipse.xtext.generator.BindFactory.addTypeToType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。