public class ResourceTraversal extends Object
The flags of the traversal indicate which special resources should be
included or excluded from the traversal. The flags used are the same as
those passed to the IResource.accept(IResourceVisitor, int, int)
method.
This class may be instantiated or subclassed by clients.
IResource
Constructor and Description |
---|
ResourceTraversal(IResource[] resources,
int depth,
int flags)
Creates a new resource traversal.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(IResourceVisitor visitor)
Visits all existing resources defined by this traversal.
|
boolean |
contains(IResource resource)
Return whether the given resource is contained in or
covered by this traversal, regardless of whether the resource
currently exists.
|
IMarker[] |
findMarkers(String type,
boolean includeSubtypes)
Returns all markers of the specified type on existing resources in this traversal.
|
int |
getDepth()
Returns the depth to which the resources should be traversed.
|
int |
getFlags()
Return the flags for this traversal.
|
IResource[] |
getResources()
Returns the file system resource(s) for this traversal.
|
public ResourceTraversal(IResource[] resources, int depth, int flags)
resources
- The resources in the traversaldepth
- The traversal depthflags
- the flags for this traversal. The traversal flags match those
that are passed to the IResource#accept
method.public void accept(IResourceVisitor visitor) throws CoreException
visitor
- a resource visitorCoreException
- if this method fails. Reasons include:
public boolean contains(IResource resource)
resource
- the resource to be testedtrue
if the resource is in this traversal, and
false
otherwise.public IMarker[] findMarkers(String type, boolean includeSubtypes) throws CoreException
includeSubtypes
is false
, only markers
whose type exactly matches the given type are returned. Returns an empty
array if there are no matching markers.type
- the type of marker to consider, or null
to indicate all typesincludeSubtypes
- whether or not to consider sub-types of the given typeCoreException
- if this method fails.IResource.findMarkers(String, boolean, int)
public int getDepth()
public int getFlags()
IResource#accept(IResourceVisitor, int, int)
method.
Clients who traverse the resources manually (i.e. without calling accept
)
should respect the flags when determining which resources are included
in the traversal.public IResource[] getResources()
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.