public class ArtifactMarkingVisitor extends Object
IResource
or an IResourceDelta
to set Artifact Markers on the files
and populate the data model used for the Artifact view(s).Modifier and Type | Field and Description |
---|---|
protected ArtifactManager |
artifactManager_ |
protected String |
markerID_ |
Constructor and Description |
---|
ArtifactMarkingVisitor(String markerID)
Constructor that uses the default behavior that WILL remove old markers
on the resource before creating new ones.
|
ArtifactMarkingVisitor(String markerId,
boolean removeMarkers)
Construction that allows specification of whether or not to removed old
markers on this resource before creating new ones
|
Modifier and Type | Method and Description |
---|---|
protected void |
createArtifactMarker(IResource resource,
Artifact artifact,
String fn)
create the marker for the artifact, and add it to
the repository (ArtifactManager)
|
protected Map<String,Object> |
createCommonMarkerAttrs(IResource resource,
Artifact artifact,
String fn)
Create marker attributes with common information shared by everyone
|
protected void |
createMarkers(IResource resource,
String fn,
Artifact[] artifacts)
Create markers for a file.
|
static Artifact[] |
getPIs(IResource r)
Get Artifacts for a given resource. e.g. could reads XML file that is presumed to be in same folder as
resource file.
|
static void |
showArtifact(Artifact artifact)
Show an artifact object - print for debugging/tracing purposes
|
boolean |
visit(IResource resource) |
boolean |
visit(IResourceDelta delta)
Implemented for IResourceDeltaVisitor Required implementation of the visit method.
|
boolean |
visitFile(IResource resource)
Generic visiting of a file, to presumably add markers.
|
boolean |
visitFile(IResource resource,
Artifact[] artifacts)
Generic version to put markers on a file, given the file(resource) and the list of artifacts
|
boolean |
visitFile(IResource resource,
List<Artifact> artifacts)
Put markers on a file where list of artifacts is a List
|
protected String markerID_
protected ArtifactManager artifactManager_
public ArtifactMarkingVisitor(String markerId, boolean removeMarkers)
markerId
- removeMarkers
- public ArtifactMarkingVisitor(String markerID)
markerID
- public boolean visitFile(IResource resource)
resource
- public boolean visitFile(IResource resource, Artifact[] artifacts)
resource
- artifacts
- list of artifact objectspublic boolean visitFile(IResource resource, List<Artifact> artifacts)
resource
- the resource, presumably a file, in which the artifacts (e.g. MPI calls) were foundartifacts
- found in the file, with type and location (line number etc.)protected void createMarkers(IResource resource, String fn, Artifact[] artifacts) throws CoreException
resource
- assumed to be a file, resource upon which to place the marker(s)fn
- - filenameartifacts
- - array of Artifact objects for which to create markers.CoreException
protected void createArtifactMarker(IResource resource, Artifact artifact, String fn) throws CoreException
resource
- artifact
- fn
- CoreException
protected Map<String,Object> createCommonMarkerAttrs(IResource resource, Artifact artifact, String fn)
resource
- File on which analysis was runartifact
- the artifact objectfn
- project relative path of the resourcepublic static Artifact[] getPIs(IResource r)
r
- The resource (file assumed) for which to look for artifactspublic boolean visit(IResourceDelta delta) throws CoreException
IResourceDelta
is
processed by providing it a visitor using the accept()
method and
using this method in the visitor to process any events of interest.
Processing continues as long as this method returns true or when the end of the IResourceDelta
has
been reached.CoreException
public boolean visit(IResource resource)
public static void showArtifact(Artifact artifact)
artifact
- the Artifact ObjectCopyright (c) 2011 IBM Corporation and others. All Rights Reserved.