KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mountainminds > eclemma > core > IClassFiles


1 /*******************************************************************************
2  * Copyright (c) 2006 Mountainminds GmbH & Co. KG
3  * This software is provided under the terms of the Eclipse Public License v1.0
4  * See http://www.eclipse.org/legal/epl-v10.html.
5  *
6  * $Id: IClassFiles.java 79 2006-09-13 14:36:45Z mho $
7  ******************************************************************************/

8 package com.mountainminds.eclemma.core;
9
10 import org.eclipse.core.runtime.CoreException;
11 import org.eclipse.core.runtime.IPath;
12 import org.eclipse.core.runtime.IProgressMonitor;
13 import org.eclipse.jdt.core.IPackageFragmentRoot;
14 import org.eclipse.jdt.core.JavaModelException;
15
16 /**
17  * Instances of {@link IClassFiles} describe a folder or archive containing
18  * class files. Class files can be binary libraries or the compilation output of
19  * source folders. These class file may be instrumented for coverage analysis.
20  *
21  * @author Marc R. Hoffmann
22  * @version $Revision: 79 $
23  */

24 public interface IClassFiles {
25
26   /**
27    * This method returns <code>true</code> if the class files described by
28    * this instance belong to a binary archive.
29    *
30    * @return <code>true</code> if the class files are a binary archive
31    */

32   public boolean isBinary();
33
34   /**
35    * Returns the list of package fragment roots that belong to the class files.
36    * The list may have more than one entry, if several source folders share the
37    * same output location.
38    *
39    * @return list of package fragment
40    */

41   public IPackageFragmentRoot[] getPackageFragmentRoots();
42
43   /**
44    * Returns the workspace relative path to of the class files, either a
45    * directory or a JAR file.
46    *
47    * @return location of the class files
48    */

49   public IPath getLocation();
50
51   /**
52    * Determines the source locations that belong to the class files. If no
53    * source is known for this class files a empty list is returned.
54    *
55    * @return List of {@link ISourceLocation} objects
56    * @throws JavaModelException
57    * May be thrown while quering the Java model
58    */

59   public ISourceLocation[] getSourceLocations() throws JavaModelException;
60
61   /**
62    * Instruments the class files contained in the folder or archive returned by
63    * {@link #getLocation()}. If in-place mode is enabled, the original class
64    * files or archives will be replaced.
65    *
66    * @param inplace
67    * if <code>true</code> the original class files will be
68    * overwritten
69    * @param monitor
70    * optional progress monitor
71    * @return {@link IInstrumentation} object describing the instrumentation
72    * result
73    * @throws CoreException
74    * thrown if the instrumentation process fails
75    */

76   public IInstrumentation instrument(boolean inplace, IProgressMonitor monitor)
77       throws CoreException;
78
79 }
80
Popular Tags