public IsInScopeWithOptionalPositionPredicate(IQualifiedNameConverter converter, URI currentURI, boolean withLineNumber, IScope scope) { super(); this.converter = converter; this.scope = scope; this.currentURI = currentURI; this.withLineNumber = withLineNumber; }
@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); }
@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()); }
protected AbstractTypeScope(IJvmTypeProvider typeProvider, IQualifiedNameConverter qualifiedNameConverter, Predicate<IEObjectDescription> filter) { super(IScope.NULLSCOPE, false); this.typeProvider = typeProvider; this.qualifiedNameConverter = qualifiedNameConverter; this.filter = filter; }
public ImportedNamespaceAwareLocalScopeProvider(IGlobalScopeProvider globalScopeProvider, IQualifiedNameProvider qualifiedNameProvider, IQualifiedNameConverter qualifiedNameConverter, ICaseInsensitivityHelper caseInsensitivityHelper) { super(globalScopeProvider, caseInsensitivityHelper); this.qualifiedNameProvider = qualifiedNameProvider; this.qualifiedNameConverter = qualifiedNameConverter; }
@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); }
public String getDelimiter() { if ((this.qualifiedNameConverter instanceof IQualifiedNameConverter.DefaultImpl)) { return ((IQualifiedNameConverter.DefaultImpl)this.qualifiedNameConverter).getDelimiter(); } else { return "."; } }
/** * @since 2.1 */ public DefaultProposalCreator(ContentAssistContext contentAssistContext, String ruleName, IQualifiedNameConverter qualifiedNameConverter) { this.contentAssistContext = contentAssistContext; this.ruleName = ruleName; this.qualifiedNameConverter = qualifiedNameConverter; }
@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); }
public IQualifiedNameConverter getQualifiedNameConverter() { return this.qualifiedNameConverter; }
public void setQualifiedNameConverter(final IQualifiedNameConverter qualifiedNameConverter) { this.qualifiedNameConverter = qualifiedNameConverter; }
/** * Binds a custom qualified name converter changing the delimiter to "/". */ public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() { return N4JSQualifiedNameConverter.class; }
public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() { return XbaseQualifiedNameConverter.class; }
public IQualifiedNameConverter getQualifiedNameConverter() { return qualifiedNameConverter; }
@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()); }
public IQualifiedNameConverter getQualifiedNameConverter() { return getTypeScope().getQualifiedNameConverter(); }
public ClasspathBasedTypeScope(ClasspathTypeProvider typeProvider, IQualifiedNameConverter qualifiedNameConverter, Predicate<IEObjectDescription> filter) { super(typeProvider, qualifiedNameConverter, filter); }
public ReflectionTypeScope(ReflectionTypeProvider typeProvider, IQualifiedNameConverter qualifiedNameConverter, Predicate<IEObjectDescription> filter) { super(typeProvider, qualifiedNameConverter, filter); }
/** * @since 2.10 */ public IQualifiedNameConverter getQualifiedNameConverter() { return qualifiedNameConverter; }
@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"); }
@Pure protected IQualifiedNameConverter getQualifiedNameConverter() { return this.qualifiedNameConverter; }
protected IQualifiedNameConverter getConverter() { return converter; }
/** * @since 2.0 */ protected IQualifiedNameConverter getQualifiedNameConverter() { return qualifiedNameConverter; }
/** * @param contentAssistContext * @param ruleName * @param qualifiedNameConverter */ public GamlProposalCreator(final ContentAssistContext contentAssistContext, final String ruleName, final IQualifiedNameConverter qualifiedNameConverter) { super(contentAssistContext, ruleName, qualifiedNameConverter); context = contentAssistContext; }
public XtxtUMLReferenceProposalTypeScope(IJdtTypeProvider typeProvider, IQualifiedNameConverter qualifiedNameConverter, Predicate<IEObjectDescription> filter) { super(typeProvider, qualifiedNameConverter, filter); }
public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() { return SadlQualifiedNameConverter.class; }
/** * binds custom qualified name converter. * * @return implementation */ public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() { return ScopeQualifiedNameConverter.class; }
/** * Binds custom qualified name converter. * * @return the implementation */ @Override public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() { return FormatQualifiedNameConverter.class; }
/** * binds custom qualified name converter. * * @return implementation */ public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() { return ExportQualifiedNameConverter.class; }
/** * 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; }
/** * 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; }
/** * binds custom qualified name converter. * * @return implementation */ public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() { return ValidQualifiedNameConverter.class; }