From 4e112eca7750a4f530c986be55c178c43c16d3ea Mon Sep 17 00:00:00 2001 From: Elliott Baron Date: Sat, 26 Jun 2010 22:27:34 -0400 Subject: Update codan plugins to CDT 7.0. * org.eclipse.cdt.codan.checkers.ui: Updated. * org.eclipse.cdt.codan.checkers: Updated. * org.eclipse.cdt.codan.core: Updated. * org.eclipse.cdt.codan.ui: Updated. * org.eclipse.cdt.codan.core.cxx: Added. * org.eclipse.cdt.codan.extension/META-INF/MANIFEST.MF: Import org.eclipse.cdt.codan.core.cxx.model. * org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/checkers/AbstractPropSimChecker.java: Superclass moved. --- .../cdt/codan/core/model/ICheckersRegistry.java | 114 ++++++++++++++++----- 1 file changed, 91 insertions(+), 23 deletions(-) (limited to 'org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICheckersRegistry.java') diff --git a/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICheckersRegistry.java b/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICheckersRegistry.java index 052d868..04189ae 100644 --- a/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICheckersRegistry.java +++ b/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICheckersRegistry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Alena Laskavaia + * Copyright (c) 2009, 2010 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 @@ -10,57 +10,125 @@ *******************************************************************************/ package org.eclipse.cdt.codan.core.model; +import java.util.Collection; import java.util.Iterator; import org.eclipse.core.resources.IResource; /** - * @author Alena + * This interface an API to add/remove checker and problems programmatically, + * get problem profiles and change problem default settings + * + * @noextend This interface is not intended to be extended by clients. + * @noimplement This interface is not intended to be implemented by clients. * */ -public interface ICheckersRegistry { - public abstract Iterator iterator(); +public interface ICheckersRegistry extends Iterable { + /** + * Iterator for registered checkers + * + * @return iterator for registered checkers + */ + public Iterator iterator(); + + /** + * Add a checker + * + * @param checker instance + */ + public void addChecker(IChecker checker); - public abstract void addChecker(IChecker checker); + /** + * Add problem p into a category defined by a category id into default + * profile, category must exists in default profile + * + * @param p + * - problem + * @param categoryId + * - category id + */ + public void addProblem(IProblem p, String categoryId); - public abstract void addProblem(IProblem p, String category); + /** + * Add subcategory category into parent category with the id of + * parentCategoryId, if parent does not exist in the default profile or it + * is a null - it will be added to the root + * + * @param category + * - new category + * @param parentCategoryId + * - parent category id + */ + public abstract void addCategory(IProblemCategory category, + String parentCategoryId); - public abstract void addCategory(IProblemCategory p, String category); + /** + * Add problem reference to a checker, i.e. claim that checker can produce + * this problem. If checker does not claim any problems it cannot be + * enabled. + * + * @param c + * - checker + * @param p + * - problem + */ + public void addRefProblem(IChecker c, IProblem p); - public abstract void addRefProblem(IChecker c, IProblem p); + /** + * Return collection of problem that this checker can produce + * + * @param checker + * @return collection of problems + */ + public Collection getRefProblems(IChecker checker); /** - * @return + * Default profile is kind of "Installation Default". + * Always the same, comes from defaults in checker extensions or APIs added + * + * @return default profile */ - public abstract IProblemProfile getDefaultProfile(); + public IProblemProfile getDefaultProfile(); /** - * @return + * Get workspace profile. User can change setting for workspace profile. + * + * @return workspace profile */ - public abstract IProblemProfile getWorkspaceProfile(); + public IProblemProfile getWorkspaceProfile(); /** + * Get resource profile. For example given project can have different + * profile than a workspace. + * * @param element - * @return + * - resource + * @return resource profile */ - public abstract IProblemProfile getResourceProfile(IResource element); + public IProblemProfile getResourceProfile(IResource element); /** + * Returns profile working copy for given resource element. (If profile is + * not specified for given element it will search for parent resource and so + * on). If you planning on editing it this method should be used instead of + * getResourceProfile. You have to save your changes after updating a + * working copy, using {@link #updateProfile(IResource, IProblemProfile)} + * method. + * + * @noreference This method is not intended to be referenced by clients. * @param element - * @return + * @return resource profile */ - public abstract IProblemProfile getResourceProfileWorkingCopy( - IResource element); + public IProblemProfile getResourceProfileWorkingCopy(IResource element); /** - * Set profile for resource. This method is called by UI, and should not be - * called by clients directly + * Set profile for resource. * + * @noreference This method is not intended to be referenced by clients. * @param resource - * - resource + * - resource * @param profile - * - problems profile + * - problems profile */ - public abstract void updateProfile(IResource resource, - IProblemProfile profile); + public void updateProfile(IResource resource, IProblemProfile profile); } \ No newline at end of file -- cgit