Klasse JavaSearchScope

Alle implementierten Schnittstellen:
Cloneable, IJavaSearchScope, IParallelizable

public class JavaSearchScope extends AbstractJavaSearchScope
A Java-specific scope for searching relative to one or more java elements.
  • Felddetails

  • Konstruktordetails

    • JavaSearchScope

      public JavaSearchScope(boolean excludeTestCode)
  • Methodendetails

    • add

      public void add(JavaProject project, int includeMask, HashSet projectsToBeAdded) throws JavaModelException
      Add java project all fragment roots to current java search scope.
      Löst aus:
      JavaModelException
      Siehe auch:
      • add(JavaProject, IPath, int, HashSet, HashSet, IClasspathEntry)
    • add

      public void add(IJavaElement element) throws JavaModelException
      Add an element to the java search scope.
      Parameter:
      element - The element we want to add to current java search scope
      Löst aus:
      JavaModelException - May happen if some Java Model info are not available
    • encloses

      public boolean encloses(String resourcePathString)
      Beschreibung aus Schnittstelle kopiert: IJavaSearchScope
      Checks whether the resource at the given path is enclosed by this scope.
      Parameter:
      resourcePathString - if the resource is contained in a JAR file, the path is composed of 2 paths separated by JAR_FILE_ENTRY_SEPARATOR: the first path is the full OS path to the JAR (if it is an external JAR), or the workspace relative IPath to the JAR (if it is an internal JAR), the second path is the path to the resource inside the JAR.
      Gibt zurück:
      whether the resource is enclosed by this scope
    • encloses

      public boolean encloses(IJavaElement element)
      Beschreibung aus Schnittstelle kopiert: IJavaSearchScope
      Checks whether this scope encloses the given element.
      Parameter:
      element - the given element
      Gibt zurück:
      true if the element is in this scope
    • enclosingProjectsAndJars

      public org.eclipse.core.runtime.IPath[] enclosingProjectsAndJars()
      Beschreibung aus Schnittstelle kopiert: IJavaSearchScope
      Returns the paths to the enclosing projects and JARs for this search scope.
      • If the path is a project path, this is the full path of the project (see IResource.getFullPath()). For example, /MyProject
      • If the path is a JAR path and this JAR is internal to the workspace, this is the full path of the JAR file (see IResource.getFullPath()). For example, /MyProject/mylib.jar
      • If the path is a JAR path and this JAR is external to the workspace, this is the full OS path to the JAR file on the file system. For example, d:\libs\mylib.jar
      Gibt zurück:
      an array of paths to the enclosing projects and JARS.
    • getAccessRuleSet

      public AccessRuleSet getAccessRuleSet(String relativePath, String containerPath)
      Beschreibung aus Klasse kopiert: AbstractJavaSearchScope
      Get access rule set corresponding to a given path.
      Angegeben von:
      getAccessRuleSet in Klasse AbstractJavaSearchScope
      Parameter:
      relativePath - The path user want to have restriction access
      Gibt zurück:
      The access rule set for given path or null if none is set for it. Returns specific unit access rule set when scope does not enclose the given path.
    • initialize

      protected void initialize(int size)
    • processDelta

      public void processDelta(IJavaElementDelta delta, int eventType)
      Angegeben von:
      processDelta in Klasse AbstractSearchScope
    • packageFragmentRoot

      public IPackageFragmentRoot packageFragmentRoot(String resourcePathString, int jarSeparatorIndex, String jarPath)
      Beschreibung aus Klasse kopiert: AbstractJavaSearchScope
      Returns the package fragment root corresponding to a given resource path.
      Angegeben von:
      packageFragmentRoot in Klasse AbstractJavaSearchScope
      Parameter:
      resourcePathString - path of expected package fragment root.
      jarSeparatorIndex - the index of the jar separator in the resource path, or -1 if none
      jarPath - the already extracted jar path, or null if none
      Gibt zurück:
      the package fragment root which path match the given one or null if none was found.
      Siehe auch:
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • isParallelSearchSupported

      public boolean isParallelSearchSupported()
      Beschreibung aus Schnittstelle kopiert: IParallelizable
      Answers true if the current instance supports parallel index search
      Angegeben von:
      isParallelSearchSupported in Schnittstelle IParallelizable
      Setzt außer Kraft:
      isParallelSearchSupported in Klasse AbstractSearchScope
      Gibt zurück:
      Returns true if the implementation is safe to be used in a parallel search.