Package org.eclipse.xtext.findReferences
Class ReferenceFinder
- java.lang.Object
-
- org.eclipse.xtext.findReferences.ReferenceFinder
-
- All Implemented Interfaces:
IReferenceFinder
public class ReferenceFinder extends java.lang.Object implements IReferenceFinder
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.xtext.findReferences.IReferenceFinder
IReferenceFinder.Acceptor, IReferenceFinder.IResourceAccess
-
-
Field Summary
Fields Modifier and Type Field Description protected static intMONITOR_CHUNK_SIZE
-
Constructor Summary
Constructors Modifier Constructor Description ReferenceFinder()protectedReferenceFinder(IResourceServiceProvider.Registry serviceProviderRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoFindReferencesWith(IReferenceFinder referenceFinder, TargetURIs targetURIs, org.eclipse.emf.common.util.URI candidate, IReferenceFinder.IResourceAccess resourceAccess, IResourceDescriptions descriptions, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)protected booleandoProcess(org.eclipse.emf.ecore.EObject sourceCandidate, com.google.common.base.Predicate<org.eclipse.emf.common.util.URI> targetURIs)protected booleandoProcess(org.eclipse.emf.ecore.EReference reference, com.google.common.base.Predicate<org.eclipse.emf.common.util.URI> targetURIs)voidfindAllReferences(org.eclipse.emf.ecore.EObject scope, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)Finds all references from the given source object.voidfindAllReferences(org.eclipse.emf.ecore.resource.Resource scope, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)Finds all references from the given source resource.voidfindAllReferences(TargetURIs targetURIs, IReferenceFinder.IResourceAccess resourceAccess, IResourceDescriptions indexData, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)Finds all references to the giventargetURIs.protected voidfindLocalReferencesFromElement(com.google.common.base.Predicate<org.eclipse.emf.common.util.URI> targetURIs, org.eclipse.emf.ecore.EObject sourceCandidate, org.eclipse.emf.ecore.resource.Resource localResource, IReferenceFinder.Acceptor acceptor)voidfindReferences(com.google.common.base.Predicate<org.eclipse.emf.common.util.URI> targetURIs, org.eclipse.emf.ecore.EObject scope, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)Finds the references from the given source object to the giventargetURIs.voidfindReferences(com.google.common.base.Predicate<org.eclipse.emf.common.util.URI> targetURIs, org.eclipse.emf.ecore.resource.Resource resource, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)Finds the references from the given source resource to the giventargetURIs.voidfindReferences(TargetURIs targetURIs, java.util.Set<org.eclipse.emf.common.util.URI> candidates, IReferenceFinder.IResourceAccess resourceAccess, IResourceDescriptions descriptions, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)Finds all references from a set of source resources to the giventargetURIs.voidfindReferences(TargetURIs targetURIs, IResourceDescription resourceDescription, IReferenceFinder.IResourceAccess resourceAccess, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)Finds the references from the given source resource to the giventargetURIs.protected voidfindReferencesInDescription(TargetURIs targetURIs, IResourceDescription resourceDescription, IReferenceFinder.IResourceAccess resourceAccess, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)protected IReferenceFindergetLanguageSpecificReferenceFinder(org.eclipse.emf.common.util.URI candidate)protected IResourceServiceProvider.RegistrygetServiceProviderRegistry()protected org.eclipse.emf.ecore.EObjectresolveInternalProxy(org.eclipse.emf.ecore.EObject elementOrProxy, org.eclipse.emf.ecore.resource.Resource resource)protected org.eclipse.emf.ecore.EObjecttoValidInstanceOrNull(org.eclipse.emf.ecore.resource.Resource resource, com.google.common.base.Predicate<org.eclipse.emf.common.util.URI> targetURIs, org.eclipse.emf.ecore.EObject value)
-
-
-
Field Detail
-
MONITOR_CHUNK_SIZE
protected static final int MONITOR_CHUNK_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ReferenceFinder
@Inject public ReferenceFinder()
-
ReferenceFinder
protected ReferenceFinder(IResourceServiceProvider.Registry serviceProviderRegistry)
-
-
Method Detail
-
getServiceProviderRegistry
protected IResourceServiceProvider.Registry getServiceProviderRegistry()
-
findReferences
public void findReferences(TargetURIs targetURIs, java.util.Set<org.eclipse.emf.common.util.URI> candidates, IReferenceFinder.IResourceAccess resourceAccess, IResourceDescriptions descriptions, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)
Description copied from interface:IReferenceFinderFinds all references from a set of source resources to the giventargetURIs.- Specified by:
findReferencesin interfaceIReferenceFinder- Parameters:
targetURIs- the URIs of the target elements of the references. Should be normalized.candidates- the search scope for the resources containing the sources of the references.resourceAccess- used to find local references. If null, only indexed references are returned.acceptor- accepts the matches.monitor- the progress monitor. Can be null.
-
getLanguageSpecificReferenceFinder
protected IReferenceFinder getLanguageSpecificReferenceFinder(org.eclipse.emf.common.util.URI candidate)
-
doFindReferencesWith
protected void doFindReferencesWith(IReferenceFinder referenceFinder, TargetURIs targetURIs, org.eclipse.emf.common.util.URI candidate, IReferenceFinder.IResourceAccess resourceAccess, IResourceDescriptions descriptions, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)
-
findAllReferences
public void findAllReferences(org.eclipse.emf.ecore.resource.Resource scope, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)Description copied from interface:IReferenceFinderFinds all references from the given source resource.- Specified by:
findAllReferencesin interfaceIReferenceFinder- Parameters:
scope- the search scope for the resources containing the sources of the references.acceptor- accepts the matches.monitor- the progress monitor. Can be null.
-
findReferences
public void findReferences(com.google.common.base.Predicate<org.eclipse.emf.common.util.URI> targetURIs, org.eclipse.emf.ecore.resource.Resource resource, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)Description copied from interface:IReferenceFinderFinds the references from the given source resource to the giventargetURIs.- Specified by:
findReferencesin interfaceIReferenceFinder- Parameters:
targetURIs- a predicate that returns true if an URI belongs to target URIs; otherwise false.resource- the search scope for the resources containing the sources of the references.acceptor- accepts the matches.monitor- the progress monitor. Can be null.
-
findAllReferences
public void findAllReferences(org.eclipse.emf.ecore.EObject scope, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)Description copied from interface:IReferenceFinderFinds all references from the given source object.- Specified by:
findAllReferencesin interfaceIReferenceFinder- Parameters:
scope- the search scope for the object containing the sources of the references.acceptor- accepts the matches.monitor- the progress monitor. Can be null.
-
findReferences
public void findReferences(com.google.common.base.Predicate<org.eclipse.emf.common.util.URI> targetURIs, org.eclipse.emf.ecore.EObject scope, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)Description copied from interface:IReferenceFinderFinds the references from the given source object to the giventargetURIs.- Specified by:
findReferencesin interfaceIReferenceFinder- Parameters:
targetURIs- a predicate that returns true if an URI belongs to target URIs; otherwise false.scope- the search scope for the object containing the sources of the references.acceptor- accepts the matches.monitor- the progress monitor. Can be null.
-
findReferences
public void findReferences(TargetURIs targetURIs, IResourceDescription resourceDescription, IReferenceFinder.IResourceAccess resourceAccess, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)
Description copied from interface:IReferenceFinderFinds the references from the given source resource to the giventargetURIs.- Specified by:
findReferencesin interfaceIReferenceFinder- Parameters:
targetURIs- the URIs of the target elements of the references. Should be normalized.resourceDescription- the search scope for the resources containing the sources of the references.resourceAccess- used to find local references. If null, only indexed references are returned.acceptor- accepts the matches.monitor- the progress monitor. Can be null.
-
findReferencesInDescription
protected void findReferencesInDescription(TargetURIs targetURIs, IResourceDescription resourceDescription, IReferenceFinder.IResourceAccess resourceAccess, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)
-
findAllReferences
public void findAllReferences(TargetURIs targetURIs, IReferenceFinder.IResourceAccess resourceAccess, IResourceDescriptions indexData, IReferenceFinder.Acceptor acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)
Description copied from interface:IReferenceFinderFinds all references to the giventargetURIs.- Specified by:
findAllReferencesin interfaceIReferenceFinder- Parameters:
targetURIs- the URIs of the target elements of the references. Should be normalized.resourceAccess- used to find local references. If null, only indexed references are returned.acceptor- accepts the matches.monitor- the progress monitor. Can be null.
-
findLocalReferencesFromElement
protected void findLocalReferencesFromElement(com.google.common.base.Predicate<org.eclipse.emf.common.util.URI> targetURIs, org.eclipse.emf.ecore.EObject sourceCandidate, org.eclipse.emf.ecore.resource.Resource localResource, IReferenceFinder.Acceptor acceptor)
-
toValidInstanceOrNull
protected org.eclipse.emf.ecore.EObject toValidInstanceOrNull(org.eclipse.emf.ecore.resource.Resource resource, com.google.common.base.Predicate<org.eclipse.emf.common.util.URI> targetURIs, org.eclipse.emf.ecore.EObject value)
-
resolveInternalProxy
protected org.eclipse.emf.ecore.EObject resolveInternalProxy(org.eclipse.emf.ecore.EObject elementOrProxy, org.eclipse.emf.ecore.resource.Resource resource)
-
doProcess
protected boolean doProcess(org.eclipse.emf.ecore.EObject sourceCandidate, com.google.common.base.Predicate<org.eclipse.emf.common.util.URI> targetURIs)
-
doProcess
protected boolean doProcess(org.eclipse.emf.ecore.EReference reference, com.google.common.base.Predicate<org.eclipse.emf.common.util.URI> targetURIs)
-
-