Java 类org.eclipse.xtext.resource.IDefaultResourceDescriptionStrategy 实例源码

项目:n4js    文件:GlobalObjectScope.java   
@Override
protected void buildMap(Resource resource, Map<QualifiedName, IEObjectDescription> elements) {
    IDefaultResourceDescriptionStrategy strategy = ((XtextResource) resource).getResourceServiceProvider()
            .get(IDefaultResourceDescriptionStrategy.class);
    TreeIterator<EObject> allProperContents = EcoreUtil.getAllProperContents(resource, false);
    IAcceptor<IEObjectDescription> acceptor = new IAcceptor<IEObjectDescription>() {
        @Override
        public void accept(IEObjectDescription description) {
            elements.put(description.getQualifiedName(), description);
        }
    };
    while (allProperContents.hasNext()) {
        EObject content = allProperContents.next();
        if (!strategy.createEObjectDescriptions(content, acceptor)) {
            allProperContents.prune();
        }
    }
}
项目:statecharts    文件:SCTXtextIntegrationModule.java   
@Override
public void configure(Binder binder) {
    binder.bind(IResourceValidator.class).to(SCTResourceValidatorImpl.class);
    binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("sct");
    binder.bind(IEncodingProvider.class).to(IEncodingProvider.Runtime.class);
    binder.bind(IQualifiedNameProvider.class).to(StextNameProvider.class);
    binder.bind(org.eclipse.jface.viewers.ILabelProvider.class)
            .annotatedWith(org.eclipse.xtext.ui.resource.ResourceServiceDescriptionLabelProvider.class)
            .to(DefaultDescriptionLabelProvider.class);
    binder.bind(IDefaultResourceDescriptionStrategy.class).to(SCTResourceDescriptionStrategy.class);

    binder.bind(MarkerCreator.class).to(SCTMarkerCreator.class);
    binder.bind(MarkerTypeProvider.class).to(SCTMarkerTypeProvider.class);
    binder.bind(IDiagnosticConverter.class).to(SCTDiagnosticConverterImpl.class);
    binder.bind(IURIEditorOpener.class).annotatedWith(LanguageSpecific.class).to(SCTFileEditorOpener.class);

    binder.bind(IMarkerContributor.class).to(TaskMarkerContributor.class);
    binder.bind(ITaskFinder.class).to(DomainSpecificTaskFinder.class);
    binder.bind(TaskMarkerCreator.class).to(SCTTaskMarkerCreator.class);
    binder.bind(TaskMarkerTypeProvider.class).to(SCTTaskMarkerTypeProvider.class);
}
项目:xtext-core    文件:DefaultResourceDescription.java   
public DefaultResourceDescription(Resource resource, IDefaultResourceDescriptionStrategy strategy,
            IResourceScopeCache cache) {
    this.resource = resource;
    this.strategy = strategy;
    this.cache = cache;
    this.uri = getNormalizedURI(resource);
}
项目:dsl-devkit    文件:ExportFragment.java   
/** {@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();
}
项目:dsl-devkit    文件:AbstractCachingResourceDescriptionManager.java   
@Override
protected IResourceDescription internalGetResourceDescription(final Resource resource, final IDefaultResourceDescriptionStrategy strategy) {
  IResourceDescription result = getCache().get(CACHE_KEY, resource, new Provider<IResourceDescription>() {
    @Override
    public IResourceDescription get() {
      return createResourceDescription(resource, descriptionStrategy);
    }
  });
  return result;
}
项目:statecharts    文件:STextRuntimeModule.java   
@Override
public void configure(Binder binder) {
    super.configure(binder);
    binder.bind(IDefaultResourceDescriptionStrategy.class).to(SCTResourceDescriptionStrategy.class);
    // https://github.com/Yakindu/statecharts/issues/1199
    binder.bind(IReferableElementsUnloader.class).to(IReferableElementsUnloader.NullUnloader.class);
}
项目:gama    文件:GamlRuntimeModule.java   
@Override
public void configure(final Binder binder) {
    super.configure(binder);
    staticInitialize();
    // binder.bind(ExpressionDescriptionBuilder.class);
    // binder.bind(IDocManager.class).to(GamlResourceDocumenter.class);
    // binder.bind(GamlSyntacticConverter.class);
    binder.bind(IDefaultResourceDescriptionStrategy.class).to(GamlResourceDescriptionStrategy.class);
    binder.bind(IQualifiedNameConverter.class).to(GamlNameConverter.class);
    binder.bind(IResourceDescription.Manager.class).to(GamlResourceDescriptionManager.class);
    // binder.bind(IOutputConfigurationProvider.class).to(GamlOutputConfigurationProvider.class);
    binder.bind(IResourceValidator.class).to(GamlResourceValidator.class);
    binder.bind(ErrorToDiagnoticTranslator.class);

}
项目:gama    文件:GamlResourceDescription.java   
@Inject
public GamlResourceDescription(final Resource resource, final IDefaultResourceDescriptionStrategy strategy,
        final IResourceScopeCache cache, final BuiltinGlobalScopeProvider provider) {
    super(resource, strategy, cache);
    this.provider = provider;

}
项目:Saturn    文件:KronusRuntimeModule.java   
public Class<? extends IDefaultResourceDescriptionStrategy> bindIDefaultResourceDescriptionStrategy() {
    return KronusDefaultResourceDescriptionStrategy.class;
}
项目:xtext-extras    文件:DefaultXbaseRuntimeModule.java   
public Class<? extends IDefaultResourceDescriptionStrategy> bindIDefaultResourceDescriptionStrategy() {
    return XbaseResourceDescriptionStrategy.class;
}
项目:xtext-extras    文件:EcoreRuntimeModule.java   
public Class<? extends IDefaultResourceDescriptionStrategy> bindIDefaultResourceDescriptionStrategy() {
    return EcoreResourceDescriptionStrategy.class;
}
项目:xtext-core    文件:DefaultResourceDescription.java   
/**
 * For testing. Uses a {@link org.eclipse.xtext.util.IResourceScopeCache.NullImpl}.
 */
public DefaultResourceDescription(Resource resource, IDefaultResourceDescriptionStrategy strategy) {
    this(resource, strategy, new IResourceScopeCache.NullImpl());
}
项目:xtext-core    文件:DefaultResourceDescriptionManager.java   
protected IResourceDescription internalGetResourceDescription(Resource resource, IDefaultResourceDescriptionStrategy strategy) {
    return new DefaultResourceDescription(resource, strategy, cache);
}
项目:xtext-core    文件:DefaultResourceDescriptionManager.java   
public void setStrategy(IDefaultResourceDescriptionStrategy strategy) {
    this.strategy = strategy;
}
项目:xtext-core    文件:XtextRuntimeModule.java   
public Class<? extends IDefaultResourceDescriptionStrategy> bindIDefaultResourceDescriptionStrategy() {
    return XtextResourceDescriptionStrategy.class;
}
项目:xtext-core    文件:EcoreRuntimeModule.java   
public Class<? extends IDefaultResourceDescriptionStrategy> bindIDefaultResourceDescriptionStrategy() {
    return EcoreResourceDescriptionStrategy.class;
}
项目:dsl-devkit    文件:AbstractCachingResourceDescriptionManager.java   
@Override
protected IResourceDescription createResourceDescription(final Resource resource, final IDefaultResourceDescriptionStrategy strategy) {
  return new ResourceDescription2(resource, strategy, getCache());
}
项目:dsl-devkit    文件:ResourceDescription2.java   
public ResourceDescription2(final Resource resource, final IDefaultResourceDescriptionStrategy strategy, final IResourceScopeCache cache) {
  super(resource, strategy, cache);
  this.strategy = strategy;
}
项目:gama    文件:GamlResourceDescriptionManager.java   
@Override
protected IResourceDescription internalGetResourceDescription(final Resource resource,
        final IDefaultResourceDescriptionStrategy strategy) {
    return new GamlResourceDescription(resource, strategy, getCache(), provider);
}
项目:sadlos2    文件:JenaRuntimeModule.java   
public Class<? extends IDefaultResourceDescriptionStrategy> bindIDefaultResourceDescriptionStrategy() {
    return JenaResourceDescriptionStrategy.class;
}
项目:sadlos2    文件:SadlRuntimeModule.java   
public Class<? extends IDefaultResourceDescriptionStrategy> bindIDefaultResourceDescriptionStrategy() {
    return SadlResourceDescriptionStrategy.class;
}
项目:XRobot    文件:XRobotDSLRuntimeModule.java   
public Class<? extends IDefaultResourceDescriptionStrategy> bindIDefaultResourceDescriptionStrategy() {
    return XRobotResourceDescriptionStrategy.class;
}
项目:packtpub-xtext-book-examples    文件:SmallJavaRuntimeModule.java   
public Class<? extends IDefaultResourceDescriptionStrategy> bindIDefaultResourceDescriptionStrategy() {
    return SmallJavaResourceDescriptionsStrategy.class;
}
项目:dsl-devkit    文件:ScopeRuntimeModule.java   
/**
 * Binds {@link IDefaultResourceDescriptionStrategy}.
 *
 * @return {@link ScopeResourceDescriptionStrategy}
 */
public Class<? extends IDefaultResourceDescriptionStrategy> bindIDefaultResourceDescriptionStrategy() {
  return ScopeResourceDescriptionStrategy.class;
}