org.aspectj.org.eclipse.jdt.internal.core.search
Class JavaWorkspaceScope

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.core.search.AbstractSearchScope
      extended by org.aspectj.org.eclipse.jdt.internal.core.search.AbstractJavaSearchScope
          extended by org.aspectj.org.eclipse.jdt.internal.core.search.JavaWorkspaceScope
All Implemented Interfaces:
IJavaSearchScope

public class JavaWorkspaceScope
extends AbstractJavaSearchScope

A Java-specific scope for searching the entire workspace. The scope can be configured to not search binaries. By default, binaries are included.


Field Summary
 
Fields inherited from interface org.aspectj.org.eclipse.jdt.core.search.IJavaSearchScope
APPLICATION_LIBRARIES, JAR_FILE_ENTRY_SEPARATOR, REFERENCED_PROJECTS, SOURCES, SYSTEM_LIBRARIES
 
Constructor Summary
JavaWorkspaceScope()
           
 
Method Summary
 boolean encloses(IJavaElement element)
          Checks whether this scope encloses the given element.
 boolean encloses(java.lang.String resourcePathString)
          Checks whether the resource at the given path is enclosed by this scope.
 IPath[] enclosingProjectsAndJars()
          Returns the paths to the enclosing projects and JARs for this search scope.
 boolean equals(java.lang.Object o)
           
 AccessRuleSet getAccessRuleSet(java.lang.String relativePath, java.lang.String containerPath)
          Get access rule set corresponding to a given path.
 int hashCode()
           
 IPackageFragmentRoot packageFragmentRoot(java.lang.String resourcePathString, int jarSeparatorIndex, java.lang.String jarPath)
          Returns the package fragment root corresponding to a given resource path.
 void processDelta(IJavaElementDelta delta, int eventType)
           
 java.lang.String toString()
           
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.search.AbstractSearchScope
includesBinaries, includesClasspaths, setIncludesBinaries, setIncludesClasspaths
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaWorkspaceScope

public JavaWorkspaceScope()
Method Detail

encloses

public boolean encloses(IJavaElement element)
Description copied from interface: IJavaSearchScope
Checks whether this scope encloses the given element.

Parameters:
element - the given element
Returns:
true if the element is in this scope

encloses

public boolean encloses(java.lang.String resourcePathString)
Description copied from interface: IJavaSearchScope
Checks whether the resource at the given path is enclosed by this scope.

Parameters:
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.
Returns:
whether the resource is enclosed by this scope

enclosingProjectsAndJars

public IPath[] enclosingProjectsAndJars()
Description copied from interface: IJavaSearchScope
Returns the paths to the enclosing projects and JARs for this search scope.

Returns:
an array of paths to the enclosing projects and JARS.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getAccessRuleSet

public AccessRuleSet getAccessRuleSet(java.lang.String relativePath,
                                      java.lang.String containerPath)
Description copied from class: AbstractJavaSearchScope
Get access rule set corresponding to a given path.

Specified by:
getAccessRuleSet in class AbstractJavaSearchScope
Parameters:
relativePath - The path user want to have restriction access
Returns:
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.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

packageFragmentRoot

public IPackageFragmentRoot packageFragmentRoot(java.lang.String resourcePathString,
                                                int jarSeparatorIndex,
                                                java.lang.String jarPath)
Description copied from class: AbstractJavaSearchScope
Returns the package fragment root corresponding to a given resource path.

Specified by:
packageFragmentRoot in class AbstractJavaSearchScope
Parameters:
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
Returns:
the package fragment root which path match the given one or null if none was found.
See Also:
AbstractJavaSearchScope.packageFragmentRoot(String, int, String)

processDelta

public void processDelta(IJavaElementDelta delta,
                         int eventType)
Specified by:
processDelta in class AbstractSearchScope

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object