本文整理匯總了Java中org.eclipse.xtext.generator.BindFactory類的典型用法代碼示例。如果您正苦於以下問題:Java BindFactory類的具體用法?Java BindFactory怎麽用?Java BindFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BindFactory類屬於org.eclipse.xtext.generator包,在下文中一共展示了BindFactory類的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();
}
示例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();
}
示例3: getGuiceBindingsUi
import org.eclipse.xtext.generator.BindFactory; //導入依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
return new BindFactory()
.addTypeToType("org.eclipse.xtext.ui.editor.contentassist.IProposalConflictHelper", "org.eclipse.xtext.ui.editor.contentassist.antlr.AntlrProposalConflictHelper")
.addConfiguredBinding("HighlightingLexer",
"binder.bind(" + Lexer.class.getName() + ".class)"+
".annotatedWith(com.google.inject.name.Names.named(" +
"org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING" +
")).to(" + getFragmentHelper().getLexerClassName(grammar) +".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)")
.getBindings();
}
示例4: 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();
}
}
示例5: 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();
}
示例6: getGuiceBindingsRt
import org.eclipse.xtext.generator.BindFactory; //導入依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
return new BindFactory()
.addTypeToType(IContainer.Manager.class.getName(), StateBasedContainerManager.class.getName())
.addTypeToType(IAllContainersState.Provider.class.getName(),
org.eclipse.xtext.resource.containers.ResourceSetBasedAllContainersStateProvider.class.getName())
.addConfiguredBinding(
IResourceDescriptions.class.getName(),
"binder.bind(" + IResourceDescriptions.class.getName() + ".class"
+ ").to("
+ ResourceSetBasedResourceDescriptions.class.getName() + ".class)")
.addConfiguredBinding(
IResourceDescriptions.class.getName() + "Persisted",
"binder.bind("+ IResourceDescriptions.class.getName() + ".class"
+ ").annotatedWith(com.google.inject.name.Names.named("
+ "org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to("
+ ResourceSetBasedResourceDescriptions.class.getName() + ".class)")
.getBindings();
}
示例7: getGuiceBindingsUi
import org.eclipse.xtext.generator.BindFactory; //導入依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
return new BindFactory()
.addConfiguredBinding(
IResourceDescriptions.class.getName() + "BuilderScope",
"binder.bind(" + IResourceDescriptions.class.getName() + ".class"
+ ").annotatedWith(com.google.inject.name.Names.named("
+ ResourceDescriptionsProvider.class.getName() + ".NAMED_BUILDER_SCOPE)).to("
+ "org.eclipse.xtext.builder.clustering.CurrentDescriptions.ResourceSetAware.class)")
.addTypeToType("org.eclipse.xtext.ui.editor.IXtextEditorCallback", "org.eclipse.xtext.builder.nature.NatureAddingEditorCallback")
.addTypeToType("org.eclipse.xtext.generator.IContextualOutputConfigurationProvider", "org.eclipse.xtext.builder.EclipseOutputConfigurationProvider")
.addConfiguredBinding(
IResourceDescriptions.class.getName() + "Persisted",
"binder.bind("+ IResourceDescriptions.class.getName() + ".class"
+ ").annotatedWith(com.google.inject.name.Names.named("
+ "org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to("
+ "org.eclipse.xtext.builder.builderState.IBuilderState.class)")
.addTypeToType("org.eclipse.xtext.ui.editor.DocumentBasedDirtyResource", "org.eclipse.xtext.builder.impl.PersistentDataAwareDirtyResource")
.getBindings();
}
示例8: 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();
}
示例9: 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;
}
示例10: getGuiceBindingsUi
import org.eclipse.xtext.generator.BindFactory; //導入依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsUi(final Grammar grammar) {
Set<Binding> _xblockexpression = null;
{
final BindFactory bind = new BindFactory();
StringConcatenation _builder = new StringConcatenation();
_builder.append("binder.bind(org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreInitializer.class)");
_builder.newLine();
_builder.append(".annotatedWith(com.google.inject.name.Names.named(\"taskTagPreferenceInitializer\"))");
_builder.newLine();
_builder.append(".to(org.eclipse.xtext.ui.tasks.preferences.TaskTagPreferenceInitializer.class)");
_builder.newLine();
bind.addConfiguredBinding(
"TaskTagPreferenceStoreInitializer", _builder.toString());
_xblockexpression = bind.getBindings();
}
return _xblockexpression;
}
示例11: 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();
}
示例12: 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;
}
示例13: getGuiceBindingsUi
import org.eclipse.xtext.generator.BindFactory; //導入依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsUi(final Grammar grammar) {
return new BindFactory()
.addTypeToType("org.eclipse.xtext.ui.editor.contentassist.IProposalConflictHelper",
"org.eclipse.xtext.ui.editor.contentassist.antlr.AntlrProposalConflictHelper")
.addConfiguredBinding("HighlightingLexer",
"binder.bind(" + Lexer.class.getName() + ".class)" +
".annotatedWith(com.google.inject.name.Names.named(" +
"org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING" +
")).to(" + getFragmentHelper().getLexerClassName(grammar) + ".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)")
.getBindings();
}
示例14: getGuiceBindingsUi
import org.eclipse.xtext.generator.BindFactory; //導入依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
return new BindFactory()
.addTypeToType("org.eclipse.xtext.builder.IXtextBuilderParticipant", "org.eclipse.xtext.builder.BuilderParticipant")
.addTypeToInstance("org.eclipse.core.resources.IWorkspaceRoot", "org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot()")
.addConfiguredBinding(
"BuilderPreferenceStoreInitializer",
"binder.bind(org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreInitializer.class)" +
".annotatedWith(com.google.inject.name.Names.named(\"builderPreferenceInitializer\"))" +
".to(org.eclipse.xtext.builder.preferences.BuilderPreferenceAccess.Initializer.class)")
.getBindings();
}
示例15: getGuiceBindingsUi
import org.eclipse.xtext.generator.BindFactory; //導入依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
return new BindFactory()
.addTypeToType("org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher",
"org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher")
.addTypeToType("org.eclipse.xtext.ui.refactoring.IDependentElementsCalculator",
"org.eclipse.xtext.ui.refactoring.impl.DefaultDependentElementsCalculator")
.getBindings();
}