Skip to main content
summaryrefslogtreecommitdiffstats
blob: 9aeb2c885f5e6acbcbb3dd06a36b184eb1958e94 (plain) (blame)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*******************************************************************************
 * 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.cdt.codan.internal.core.CheckersRegistry;

/**
 * Problem Profile contains tree of categories and problems. For the user
 * the profile is quick way to switch between problem sets depending on the
 * task he is doing (i.e. find real bugs, vs doing code style report)
 * User can set different profiles for different projects.
 * Profiles can have different categories and different problem sets,
 * problems with the same id can have different severities/enablement in
 * different profiles.
 * Category tree can have few reference to a same problem, but only instance of
 * Problem
 * with the same id can exist in the same profile (i.e. two category can have
 * same problem listed in both,
 * but they both should point to the same problem instance).
 * 
 * To obtain read-only profile use method
 * {@link CheckersRegistry#getResourceProfile},
 * {@link CheckersRegistry#getDefaultProfile()} or
 * {@link CheckersRegistry#getWorkspaceProfile()}
 * 
 * @noextend This interface is not intended to be extended by clients.
 * @noimplement This interface is not intended to be implemented by clients.
 */
public interface IProblemProfile extends IProblemElement {
	/**
	 * @return root category in profile
	 */
	IProblemCategory getRoot();

	/**
	 * Find and return problem by id if it contained in this profile
	 * 
	 * @param id
	 *        - problem id
	 * @return problem instance
	 */
	IProblem findProblem(String id);

	/**
	 * Find and return category by id if it is contained in this profile
	 * 
	 * @param id
	 *        - category id
	 * @return category instance
	 */
	IProblemCategory findCategory(String id);

	/**
	 * Get all problems defined in this profile (if problem duplicated in a
	 * category tree, it returns only one instance of each)
	 * 
	 * @return array of problems defined in profile
	 */
	IProblem[] getProblems();
}

Back to the top