summaryrefslogtreecommitdiffstats
path: root/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IChecker.java
blob: 60f7cb2b99e2e07d9e06b1ecbf21254d0a6a95f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*******************************************************************************
 * Copyright (c) 2009 Alena Laskavaia 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Alena Laskavaia  - initial API and implementation
 *******************************************************************************/
package org.eclipse.cdt.codan.core.model;

import org.eclipse.core.resources.IResource;

/**
 * Interface that checker must implement. CDT Checker must be able to process a resource.
 */
public interface IChecker {
	/**
	 * Main method that checker should implement that actually detects errors
	 * @param resource - resource to run on
	 * @return true if need to traverse children
	 */
	boolean processResource(IResource resource);

	/**
	 * Implement this method to trim down type of resource you are interested in,
	 * usually it will be c/c++ files only
	 * @param resource
	 * @return
	 */
	boolean enabledInContext(IResource resource);

	/**
	 * Checker must implement this method to determine if it can run in editor
	 * "as you type", checker must be really light weight to run in this mode
	 * 
	 * @return true if need to be run in editor as user types, and false
	 *         otherwise
	 */
	boolean runInEditor();
}