Class HierarchyScope
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.search.AbstractSearchScope
org.aspectj.org.eclipse.jdt.internal.core.search.HierarchyScope
- All Implemented Interfaces:
Cloneable,IJavaSearchScope,IParallelizable,SuffixConstants
Scope limited to the subtype and supertype hierarchy of a given type.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intbooleanFields inherited from interface org.aspectj.org.eclipse.jdt.core.search.IJavaSearchScope
APPLICATION_LIBRARIES, JAR_FILE_ENTRY_SEPARATOR, REFERENCED_PROJECTS, SOURCES, SYSTEM_LIBRARIESFields inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.util.SuffixConstants
EXTENSION_aj, EXTENSION_AJ, EXTENSION_class, EXTENSION_CLASS, EXTENSION_java, EXTENSION_JAVA, EXTENSION_jmod, EXTENSION_JMOD, SUFFIX_aj, SUFFIX_AJ, SUFFIX_class, SUFFIX_CLASS, SUFFIX_java, SUFFIX_JAVA, SUFFIX_STRING_aj, SUFFIX_STRING_AJ, SUFFIX_STRING_class, SUFFIX_STRING_CLASS, SUFFIX_STRING_java, SUFFIX_STRING_JAVA -
Constructor Summary
ConstructorsConstructorDescriptionHierarchyScope(IJavaProject project, IType type, WorkingCopyOwner owner, boolean onlySubtypes, boolean noMembersOrEnclosingTypes, boolean includeFocusType) Creates a new hierarchy scope for the given type with the given configuration options.HierarchyScope(IType type, WorkingCopyOwner owner) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(org.eclipse.core.resources.IResource element) booleanChecks whether the resource at the given path is enclosed by this scope.booleanbooleanencloses(IJavaElement element) Checks whether this scope encloses the given element.booleanencloses(IJavaElement element, org.eclipse.core.runtime.IProgressMonitor progressMonitor) booleanenclosesFineGrained(IJavaElement element) Optionally perform additional checks after element has already passed matching based on index/documents.org.eclipse.core.runtime.IPath[]Returns the paths to the enclosing projects and JARs for this search scope.voidinitBeforeSearch(org.eclipse.core.runtime.IProgressMonitor monitor) Initialize all needed data before search is startedprotected voidprotected voidinitialize(org.eclipse.core.runtime.IProgressMonitor progressMonitor) booleanAnswerstrueif the current instance supports parallel index searchvoidprocessDelta(IJavaElementDelta delta, int eventType) protected voidrefresh()protected voidrefresh(org.eclipse.core.runtime.IProgressMonitor progressMonitor) toString()Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.search.AbstractSearchScope
clone, includesBinaries, includesClasspaths, setIncludesBinaries, setIncludesClasspaths
-
Field Details
-
focusType
-
elements
-
elementCount
protected int elementCount -
needsRefresh
public boolean needsRefresh
-
-
Constructor Details
-
HierarchyScope
public HierarchyScope(IJavaProject project, IType type, WorkingCopyOwner owner, boolean onlySubtypes, boolean noMembersOrEnclosingTypes, boolean includeFocusType) throws JavaModelException Creates a new hierarchy scope for the given type with the given configuration options.- Parameters:
project- constrain the search result to this project, ornullif search should consider all types in the workspacetype- the focus type of the hierarchyowner- the owner of working copies that take precedence over original compilation units, ornullif the primary working copy owner should be usedonlySubtypes- if true search only subtypes of 'type'noMembersOrEnclosingTypes- if true the hierarchy is strict, i.e., no additional member types or enclosing types of types spanning the hierarchy are included, otherwise all member and enclosing types of types in the hierarchy are included.includeFocusType- if true the focus typetypeis included in the resulting scope, otherwise it is excluded- Throws:
JavaModelException
-
HierarchyScope
- Throws:
JavaModelException
-
-
Method Details
-
add
public void add(org.eclipse.core.resources.IResource element) -
encloses
Description copied from interface:IJavaSearchScopeChecks whether the resource at the given path is enclosed by this scope.- Specified by:
enclosesin interfaceIJavaSearchScope- Parameters:
resourcePath- if the resource is contained in a JAR file, the path is composed of 2 paths separated byJAR_FILE_ENTRY_SEPARATOR: the first path is the full OS path to the JAR (if it is an external JAR), or the workspace relativeIPathto 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
-
encloses
public boolean encloses(String resourcePath, org.eclipse.core.runtime.IProgressMonitor progressMonitor) -
enclosesFineGrained
Optionally perform additional checks after element has already passed matching based on index/documents.- Parameters:
element- the given element- Returns:
trueif the element is enclosed or if no fine grained checking (regarding subtypes and members) is requested
-
encloses
Description copied from interface:IJavaSearchScopeChecks whether this scope encloses the given element.- Specified by:
enclosesin interfaceIJavaSearchScope- Parameters:
element- the given element- Returns:
trueif the element is in this scope
-
encloses
public boolean encloses(IJavaElement element, org.eclipse.core.runtime.IProgressMonitor progressMonitor) -
enclosingProjectsAndJars
public org.eclipse.core.runtime.IPath[] enclosingProjectsAndJars()Description copied from interface:IJavaSearchScopeReturns 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
- Specified by:
enclosingProjectsAndJarsin interfaceIJavaSearchScope- Returns:
- an array of paths to the enclosing projects and JARS.
- If the path is a project path, this is the full path of the project
(see
-
initialize
- Throws:
JavaModelException
-
initialize
protected void initialize(org.eclipse.core.runtime.IProgressMonitor progressMonitor) throws JavaModelException - Throws:
JavaModelException
-
processDelta
- Specified by:
processDeltain classAbstractSearchScope
-
refresh
- Throws:
JavaModelException
-
refresh
protected void refresh(org.eclipse.core.runtime.IProgressMonitor progressMonitor) throws JavaModelException - Throws:
JavaModelException
-
toString
-
isParallelSearchSupported
public boolean isParallelSearchSupported()Description copied from interface:IParallelizableAnswerstrueif the current instance supports parallel index search- Specified by:
isParallelSearchSupportedin interfaceIParallelizable- Overrides:
isParallelSearchSupportedin classAbstractSearchScope- Returns:
- Returns
trueif the implementation is safe to be used in a parallel search.
-
initBeforeSearch
public void initBeforeSearch(org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException Description copied from interface:IParallelizableInitialize all needed data before search is started- Specified by:
initBeforeSearchin interfaceIParallelizable- Parameters:
monitor- non null progress callback- Throws:
JavaModelException
-