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


Java BindFactory.getBindings方法代碼示例

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


在下文中一共展示了BindFactory.getBindings方法的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(),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

示例2: getGuiceBindingsRt

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
/**
 * @since 2.11
 */
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
	if (isBindEPackageAndEFactory()) {
		BindFactory bindFactory = new BindFactory();
		// Register generated EPackage and EFactory instances in the runtime module
		for (EPackage pkg: getGeneratedEPackages(grammar)) {
			GenPackage genPkg = GenModelUtil2.getGenPackage(pkg, grammar.eResource().getResourceSet());
			bindFactory
				.addTypeToInstance(genPkg.getQualifiedPackageInterfaceName(), genPkg.getQualifiedPackageInterfaceName()+".eINSTANCE")
				.addTypeToInstance(genPkg.getQualifiedFactoryInterfaceName(), genPkg.getQualifiedFactoryInterfaceName()+".eINSTANCE");
		}
		return bindFactory.getBindings();
	} else {
		return Collections.emptySet();
	}
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:20,代碼來源:EMFGeneratorFragment.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: 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.jface.viewers.ILabelProvider", getEObjectLabelProviderQualifiedName(grammar, getNaming()))
			.addConfiguredBinding("ResourceUIServiceLabelProvider",
				"binder.bind(org.eclipse.jface.viewers.ILabelProvider.class)" +
				".annotatedWith(org.eclipse.xtext.ui.resource.ResourceServiceDescriptionLabelProvider.class)" +
				".to(" + getDescriptionLabelProviderQualifiedName(grammar, getNaming()) + ".class)");
	else if(doesUseXbase(grammar))
		bindFactory.addTypeToType("org.eclipse.jface.viewers.ILabelProvider", "org.eclipse.xtext.xbase.ui.labeling.XbaseLabelProvider")
			.addConfiguredBinding("ResourceUIServiceLabelProvider",
					"binder.bind(org.eclipse.jface.viewers.ILabelProvider.class)" +
							".annotatedWith(org.eclipse.xtext.ui.resource.ResourceServiceDescriptionLabelProvider.class)" +
							".to(org.eclipse.xtext.xbase.ui.labeling.XbaseDescriptionLabelProvider.class)");
	return bindFactory.getBindings();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:19,代碼來源:LabelProviderFragment.java

示例5: getGuiceBindingsRt

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  Set<Binding> _xblockexpression = null;
  {
    final BindFactory bindFactory = new BindFactory();
    if (this.generateStub) {
      bindFactory.addTypeToTypeEagerSingleton(
        this._validatorNaming.getValidatorName(grammar), 
        this._validatorNaming.getValidatorName(grammar));
    } else {
      bindFactory.addTypeToTypeEagerSingleton(
        this._validatorNaming.getAbstractValidatorName(), 
        this._validatorNaming.getAbstractValidatorName());
    }
    _xblockexpression = bindFactory.getBindings();
  }
  return _xblockexpression;
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:19,代碼來源:ValidatorFragment.java

示例6: 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

示例7: 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

示例8: 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

示例9: getGuiceBindingsRt

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

  bindFactory.addTypeToType(IScopeProvider.class.getName(), prefix + "ScopeProvider");
  bindFactory.addTypeToType(IScopeNameProvider.class.getName(), prefix + "ScopeNameProvider");
  bindFactory.addTypeToType(ILinkingService.class.getName(), "com.avaloq.tools.ddk.xtext.linking.LinkingService");

  return bindFactory.getBindings();
}
 
開發者ID:dsldevkit,項目名稱:dsl-devkit,代碼行數:13,代碼來源:ScopingFragment.java

示例10: getGuiceBindingsRt

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  BindFactory factory = new BindFactory();
  if (generateModelInference) {
    factory.addTypeToTypeSingleton(IInferredModelAssociations.class.getName(), InferredModelAssociator.class.getName());
    factory.addTypeToTypeSingleton(IInferredModelAssociator.class.getName(), InferredModelAssociator.class.getName());
    factory.addTypeToTypeSingleton(IDerivedStateComputer.class.getName(), InferredModelAssociator.class.getName());
  }
  return factory.getBindings();
}
 
開發者ID:dsldevkit,項目名稱:dsl-devkit,代碼行數:11,代碼來源:ModelInferenceFragment.java

示例11: getGuiceBindingsUi

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsUi(final Grammar grammar) {
  BindFactory factory = new BindFactory();
  if (generateModelInference) {
    factory.addTypeToType(ReferenceQueryExecutor.class.getName(), InferredModelReferenceQueryExecutor.class.getName());
  }
  return factory.getBindings();
}
 
開發者ID:dsldevkit,項目名稱:dsl-devkit,代碼行數:9,代碼來源:ModelInferenceFragment.java

示例12: 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

示例13: 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

示例14: getGuiceBindingsUi

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
public Set<Binding> getGuiceBindingsUi(final Grammar grammar) {
  if (hasQuickfixes(getValidModel(grammar))) {
    final BindFactory addTypeToInstance = new BindFactory().addTypeToType(IssueResolutionProvider.class.getName(), getQuickfixProviderName(grammar, getNaming()));
    return addTypeToInstance.getBindings();
  } else {
    return Collections.emptySet();
  }
}
 
開發者ID:dsldevkit,項目名稱:dsl-devkit,代碼行數:11,代碼來源:ValidValidatorFragment.java

示例15: 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


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