KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hammurapi > InspectorDescriptor


1 /*
2  * Hammurapi
3  * Automated Java code review system.
4  * Copyright (C) 2004 Hammurapi Group
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * URL: http://www.hammurapi.org
21  * e-Mail: support@hammurapi.biz
22  */

23 package org.hammurapi;
24
25 import java.util.Collection JavaDoc;
26
27 import com.pavelvlasov.config.ConfigurationException;
28
29 /**
30  * @author Pavel Vlasov
31  * @version $Revision: 1.3 $
32  */

33 public interface InspectorDescriptor {
34     String JavaDoc getCategory();
35     String JavaDoc getDescription();
36     Boolean JavaDoc isEnabled();
37     String JavaDoc getName();
38     Integer JavaDoc getSeverity();
39     Integer JavaDoc getOrder();
40     String JavaDoc getRationale();
41     String JavaDoc getViolationSample();
42     String JavaDoc getFixSample();
43     String JavaDoc getResources();
44     String JavaDoc getMessage();
45     String JavaDoc getMessage(String JavaDoc key);
46     
47     /**
48      * Instantiates rule
49      * @return rule instance
50      */

51     Inspector getInspector() throws ConfigurationException;
52     
53     /**
54      * Accumulated parameters. Parameters from lower levels come first;
55      * @return Collection of ParameterEntry instances
56      */

57     Collection JavaDoc getParameters();
58     
59     /**
60      * Some violations can be waived, for example empty catch block
61      * might be justifiable in some situations. But other violations
62      * can not. For example there is no reason to waive Upper L Rule.
63      * @return TRUE if violation can be waived.
64      */

65     Boolean JavaDoc isWaivable();
66
67     /**
68      * @return Collection of cases in which a violation can be waived.
69      */

70     Collection JavaDoc getWaiveCases();
71     
72     /**
73      * @param inspectorKey
74      * @return
75      */

76     String JavaDoc getWaivedInspectorName(String JavaDoc inspectorKey);
77     
78     Collection JavaDoc getWaivedInspectorNames();
79     
80     /**
81      * @param inspectorKey
82      * @return
83      */

84     String JavaDoc getWaiveReason(String JavaDoc inspectorKey);
85     
86     /**
87      * @param inspectorSet Inspector set to read descriptors from
88      * @param chain filtered inspector descriptors selected by previous descriptor in stack.
89      * @return Collection of inspector descriptors which this inspector
90      * descriptor declares as filtered.
91      */

92     Collection JavaDoc getFilteredInspectorDesriptors(InspectorSet inspectorSet, Collection JavaDoc chain);
93     
94     /**
95      *
96      * @return Collection of names of inspectors whose visit() methods shall be invoked after this
97      * inspector's visit() methods and whose leave() methods shall be invoked before this inspector
98      * leave() method.
99      */

100     Collection JavaDoc getAfterInspectorNames();
101 }
102
Popular Tags