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