• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*******************************************************************************
2  * Copyright (c) 2009, 2021 Mountainminds GmbH & Co. KG and Contributors
3  * This program and the accompanying materials are made available under
4  * the terms of the Eclipse Public License 2.0 which is available at
5  * http://www.eclipse.org/legal/epl-2.0
6  *
7  * SPDX-License-Identifier: EPL-2.0
8  *
9  * Contributors:
10  *    Marc R. Hoffmann - initial API and implementation
11  *
12  *******************************************************************************/
13 package org.jacoco.report;
14 
15 import java.io.IOException;
16 import java.io.Reader;
17 
18 /**
19  * Interface to look-up source files that will be included with the report.
20  */
21 public interface ISourceFileLocator {
22 
23 	/**
24 	 * Tries to locate the given source file and opens a reader with the
25 	 * appropriate encoding.
26 	 *
27 	 * @param packageName
28 	 *            VM name of the package
29 	 * @param fileName
30 	 *            name of the source file
31 	 * @return reader if the file could be located, <code>null</code> otherwise
32 	 * @throws IOException
33 	 *             in case of problems while opening the file
34 	 */
getSourceFile(String packageName, String fileName)35 	Reader getSourceFile(String packageName, String fileName)
36 			throws IOException;
37 
38 	/**
39 	 * Returns number of blank characters that represent a tab in source code.
40 	 *
41 	 * @return tab width as number of blanks
42 	 */
getTabWidth()43 	int getTabWidth();
44 
45 }
46