Java 类org.eclipse.xtext.naming.IQualifiedNameConverter 实例源码

项目:n4js    文件:IsInScopeWithOptionalPositionPredicate.java   
public IsInScopeWithOptionalPositionPredicate(IQualifiedNameConverter converter, URI currentURI,
        boolean withLineNumber, IScope scope) {
    super();
    this.converter = converter;
    this.scope = scope;
    this.currentURI = currentURI;
    this.withLineNumber = withLineNumber;
}
项目:xtext-extras    文件:ClasspathBasedConstructorScopeTest.java   
@Before
public void setUp() throws Exception {
    factory = new ClasspathTypeProviderFactory(getClass().getClassLoader(), null);
    resourceSet = new ResourceSetImpl();
    typeScope = new ClasspathBasedTypeScope(factory.createTypeProvider(resourceSet), new IQualifiedNameConverter.DefaultImpl(), Predicates.<IEObjectDescription>alwaysTrue());
    constructorScope = new ClasspathBasedConstructorScope(typeScope);
}
项目:xtext-extras    文件:AbstractConstructorScopeTest.java   
@Test public void testGetElementByInstance_01() {
    JvmConstructor constructor = TypesFactory.eINSTANCE.createJvmConstructor();
    JvmGenericType type = TypesFactory.eINSTANCE.createJvmGenericType();
    type.setPackageName("java.lang");
    type.setSimpleName("Object");
    constructor.setSimpleName("Object");
    type.getMembers().add(constructor);
    IEObjectDescription element = getConstructorScope().getSingleElement(constructor);
    assertNotNull(element);
    assertEquals(new IQualifiedNameConverter.DefaultImpl().toQualifiedName("java.lang.Object"), element.getName());
    assertEquals(new IQualifiedNameConverter.DefaultImpl().toQualifiedName("java.lang.Object"), element.getQualifiedName());
}
项目:xtext-extras    文件:AbstractTypeScope.java   
protected AbstractTypeScope(IJvmTypeProvider typeProvider, IQualifiedNameConverter qualifiedNameConverter,
        Predicate<IEObjectDescription> filter) {
    super(IScope.NULLSCOPE, false);
    this.typeProvider = typeProvider;
    this.qualifiedNameConverter = qualifiedNameConverter;
    this.filter = filter;
}
项目:xtext-core    文件:ImportedNamespaceAwareLocalScopeProvider.java   
public ImportedNamespaceAwareLocalScopeProvider(IGlobalScopeProvider globalScopeProvider,
        IQualifiedNameProvider qualifiedNameProvider, IQualifiedNameConverter qualifiedNameConverter,
        ICaseInsensitivityHelper caseInsensitivityHelper) {
    super(globalScopeProvider, caseInsensitivityHelper);
    this.qualifiedNameProvider = qualifiedNameProvider;
    this.qualifiedNameConverter = qualifiedNameConverter;
}
项目:xtext-core    文件:ImportedNamespaceAwareLocalScopeProviderTest.java   
@Override
public void setUp() throws Exception {
    super.setUp();
    with(new IndexTestLanguageStandaloneSetup());

    globalScopeProvider = new ResourceSetGlobalScopeProvider();
    nameProvider = new DefaultDeclarativeQualifiedNameProvider();
    nameConverter = new IQualifiedNameConverter.DefaultImpl();
    final DefaultResourceDescriptionStrategy strategy = new DefaultResourceDescriptionStrategy();
    strategy.setQualifiedNameProvider(nameProvider);
    final DefaultResourceDescriptionManager resourceDescMnr = new DefaultResourceDescriptionManager() {
        @Override
        public IResourceDescription getResourceDescription(Resource resource) {
            DefaultResourceDescription resourceDescription = new DefaultResourceDescription(resource,
                    strategy);
            return resourceDescription;
        }

    };
    final DefaultResourceServiceProvider provider = new DefaultResourceServiceProvider() {
        @Override
        public Manager getResourceDescriptionManager() {
            return resourceDescMnr;
        }
    };
    globalScopeProvider.setGlobalResourceDecriptionProvider(new GlobalResourceDescriptionProvider(new ResourceServiceProviderRegistryImpl() {
        @Override
        public IResourceServiceProvider getResourceServiceProvider(URI uri, String contentType) {
            return provider;
        }
    }));
    CaseInsensitivityHelper caseInsensitivityHelper = new CaseInsensitivityHelper();
    globalScopeProvider.setCaseInsensitivityHelper(caseInsensitivityHelper);
    scopeProvider = new ImportedNamespaceAwareLocalScopeProvider(globalScopeProvider, nameProvider, nameConverter, caseInsensitivityHelper);
}
项目:xtext-core    文件:FQNPrefixMatcher.java   
public String getDelimiter() {
  if ((this.qualifiedNameConverter instanceof IQualifiedNameConverter.DefaultImpl)) {
    return ((IQualifiedNameConverter.DefaultImpl)this.qualifiedNameConverter).getDelimiter();
  } else {
    return ".";
  }
}
项目:bts    文件:AbstractJavaBasedContentProposalProvider.java   
/**
 * @since 2.1
 */
public DefaultProposalCreator(ContentAssistContext contentAssistContext, String ruleName,
        IQualifiedNameConverter qualifiedNameConverter) {
    this.contentAssistContext = contentAssistContext;
    this.ruleName = ruleName;
    this.qualifiedNameConverter = qualifiedNameConverter;
}
项目: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);

}
项目:n4js    文件:InternalTypeSystem.java   
public IQualifiedNameConverter getQualifiedNameConverter() {
  return this.qualifiedNameConverter;
}
项目:n4js    文件:InternalTypeSystem.java   
public void setQualifiedNameConverter(final IQualifiedNameConverter qualifiedNameConverter) {
  this.qualifiedNameConverter = qualifiedNameConverter;
}
项目:n4js    文件:N4JSRuntimeModule.java   
/**
 * Binds a custom qualified name converter changing the delimiter to "/".
 */
public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() {
    return N4JSQualifiedNameConverter.class;
}
项目:xtext-extras    文件:DefaultXbaseRuntimeModule.java   
public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() {
    return XbaseQualifiedNameConverter.class;
}
项目:xtext-extras    文件:XImportSectionNamespaceScopeProvider.java   
public IQualifiedNameConverter getQualifiedNameConverter() {
    return qualifiedNameConverter;
}
项目:xtext-extras    文件:ClasspathBasedTypeScopeTest.java   
@Before
public void setUp() throws Exception {
    factory = new ClasspathTypeProviderFactory(getClass().getClassLoader(), null);
    resourceSet = new ResourceSetImpl();
    typeScope = new ClasspathBasedTypeScope(factory.createTypeProvider(resourceSet), new IQualifiedNameConverter.DefaultImpl(),Predicates.<IEObjectDescription>alwaysTrue());
}
项目:xtext-extras    文件:AbstractConstructorScope.java   
public IQualifiedNameConverter getQualifiedNameConverter() {
    return getTypeScope().getQualifiedNameConverter();
}
项目:xtext-extras    文件:ClasspathBasedTypeScope.java   
public ClasspathBasedTypeScope(ClasspathTypeProvider typeProvider, IQualifiedNameConverter qualifiedNameConverter, Predicate<IEObjectDescription> filter) {
    super(typeProvider, qualifiedNameConverter, filter);
}
项目:xtext-extras    文件:AbstractTypeScope.java   
public IQualifiedNameConverter getQualifiedNameConverter() {
    return qualifiedNameConverter;
}
项目:xtext-extras    文件:ReflectionTypeScope.java   
public ReflectionTypeScope(ReflectionTypeProvider typeProvider, IQualifiedNameConverter qualifiedNameConverter,
        Predicate<IEObjectDescription> filter) {
    super(typeProvider, qualifiedNameConverter, filter);
}
项目:xtext-core    文件:ImportedNamespaceAwareLocalScopeProvider.java   
/**
 * @since 2.10
 */
public IQualifiedNameConverter getQualifiedNameConverter() {
    return qualifiedNameConverter;
}
项目:xtext-core    文件:PartialLinkingTest.java   
@Override
public void setUp() throws Exception {
    super.setUp();
    with(ReferenceGrammarTestLanguageStandaloneSetup.class);
    IQualifiedNameConverter nameConverter = new IQualifiedNameConverter.DefaultImpl();
    IQualifiedNameProvider nameProvider = new DefaultDeclarativeQualifiedNameProvider();
    ImportUriGlobalScopeProvider globalScopeProvider = new ImportUriGlobalScopeProvider();
    globalScopeProvider.setImportResolver(new ImportUriResolver());
    globalScopeProvider.setCache(IResourceScopeCache.NullImpl.INSTANCE);
    final ResourceDescriptionsProvider provider = new ResourceDescriptionsProvider();
    provider.setResourceDescriptions(new Provider<IResourceDescriptions>() {
        @Override
        public IResourceDescriptions get() {
            return new IResourceDescriptions.NullImpl();
        }
    });
    globalScopeProvider.setResourceDescriptionsProvider(provider);
    globalScopeProvider.setLoadOnDemandDescriptions(new Provider<LoadOnDemandResourceDescriptions>() {
        @Override
        public LoadOnDemandResourceDescriptions get() {
            return PartialLinkingTest.this.get(LoadOnDemandResourceDescriptions.class);
        }
    });
    CaseInsensitivityHelper caseInsensitivityHelper = new CaseInsensitivityHelper();
    globalScopeProvider.setCaseInsensitivityHelper(caseInsensitivityHelper);
    scopeProvider = new ImportedNamespaceAwareLocalScopeProvider(globalScopeProvider, nameProvider, nameConverter, caseInsensitivityHelper);
    modelAsText =
        "spielplatz 1 {\n" +
        "  kind( Bommel1 1)\n" +
        "  kind( Bommel2 2)\n" +
        "  kind( Bommel3 3)\n" +
        "  erwachsener( Bob 4)\n" +
        "  erwachsener( Joe 5)\n" +
        "  familie( Familienname Bob Joe Bommel2 )\n" +
        "}";
    resource = getResourceFromString(modelAsText);
    assertTrue(resource.getErrors().toString(), resource.getErrors().isEmpty());
    model = resource.getParseResult().getRootASTElement();
    final Iterator<EObject> iter = model.eAllContents();
    while (iter.hasNext() && context == null) {
        final EObject candidate = iter.next();
        final String className = candidate.eClass().getName();
        if (className.endsWith("Familie"))
            context = candidate;
    }
    reference = (EReference) context.eClass().getEStructuralFeature("kinder");
}
项目:xtext-core    文件:IdeCrossrefProposalProvider.java   
@Pure
protected IQualifiedNameConverter getQualifiedNameConverter() {
  return this.qualifiedNameConverter;
}
项目:xtext-core    文件:IdeContentProposalProvider.java   
@Pure
protected IQualifiedNameConverter getQualifiedNameConverter() {
  return this.qualifiedNameConverter;
}
项目:dsl-devkit    文件:AbstractExportedNameProvider.java   
protected IQualifiedNameConverter getConverter() {
  return converter;
}
项目:bts    文件:AbstractContentProposalProvider.java   
public IQualifiedNameConverter getQualifiedNameConverter() {
    return qualifiedNameConverter;
}
项目:bts    文件:DefaultQuickfixProvider.java   
/**
 * @since 2.0
 */
protected IQualifiedNameConverter getQualifiedNameConverter() {
    return qualifiedNameConverter;
}
项目:gama    文件:GamlProposalProvider.java   
/**
 * @param contentAssistContext
 * @param ruleName
 * @param qualifiedNameConverter
 */
public GamlProposalCreator(final ContentAssistContext contentAssistContext, final String ruleName,
        final IQualifiedNameConverter qualifiedNameConverter) {
    super(contentAssistContext, ruleName, qualifiedNameConverter);
    context = contentAssistContext;
}
项目:txtUML    文件:XtxtUMLReferenceProposalTypeScope.java   
public XtxtUMLReferenceProposalTypeScope(IJdtTypeProvider typeProvider,
        IQualifiedNameConverter qualifiedNameConverter, Predicate<IEObjectDescription> filter) {
    super(typeProvider, qualifiedNameConverter, filter);
}
项目:sadlos2    文件:SadlRuntimeModule.java   
public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() {
    return SadlQualifiedNameConverter.class;
}
项目:dsl-devkit    文件:ScopeRuntimeModule.java   
/**
 * binds custom qualified name converter.
 *
 * @return implementation
 */
public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() {
  return ScopeQualifiedNameConverter.class;
}
项目:dsl-devkit    文件:FormatRuntimeModule.java   
/**
 * Binds custom qualified name converter.
 *
 * @return the implementation
 */
@Override
public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() {
  return FormatQualifiedNameConverter.class;
}
项目:dsl-devkit    文件:ExportRuntimeModule.java   
/**
 * binds custom qualified name converter.
 *
 * @return implementation
 */
public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() {
  return ExportQualifiedNameConverter.class;
}
项目:dsl-devkit    文件:Index.java   
/**
 * Creates a new query for a type, using a given domain mapper and name converter.
 *
 * @param mapper
 *          to use
 * @param nameConverter
 *          to use
 * @param type
 *          to look for
 * @return a query object
 */
protected Query(final IDomain.Mapper mapper, final IQualifiedNameConverter nameConverter, final EClass type) {
  this.realQuery = ContainerQuery.newBuilder(mapper, type);
  this.nameConverter = nameConverter;
}
项目:dsl-devkit    文件:Index.java   
/**
 * Creates a new wrapper for an IEObjectDescription, using the given name converter and query context object. The context object is used to resolve the
 * EObject, if needed.
 *
 * @param context
 *          of the query that produced this result
 * @param nameConverter
 *          to use
 * @param internalDescription
 *          to wrap
 */
protected Entry(final EObject context, final IQualifiedNameConverter nameConverter, final IEObjectDescription internalDescription) {
  this.context = context;
  this.nameConverter = nameConverter;
  this.delegate = internalDescription;
}
项目:dsl-devkit    文件:ValidRuntimeModule.java   
/**
 * binds custom qualified name converter.
 * 
 * @return implementation
 */
public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() {
  return ValidQualifiedNameConverter.class;
}