001: /*
002: * Hammurapi
003: * Automated Java code review system.
004: * Copyright (C) 2004 Hammurapi Group
005: *
006: * This program is free software; you can redistribute it and/or modify
007: * it under the terms of the GNU General Public License as published by
008: * the Free Software Foundation; either version 2 of the License, or
009: * (at your option) any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
019: *
020: * URL: http://www.hammurapi.org
021: * e-Mail: support@hammurapi.biz
022: */
023: package org.hammurapi;
024:
025: import java.util.Collection;
026:
027: import com.pavelvlasov.config.ConfigurationException;
028:
029: /**
030: * @author Pavel Vlasov
031: * @version $Revision: 1.3 $
032: */
033: public interface InspectorDescriptor {
034: String getCategory();
035:
036: String getDescription();
037:
038: Boolean isEnabled();
039:
040: String getName();
041:
042: Integer getSeverity();
043:
044: Integer getOrder();
045:
046: String getRationale();
047:
048: String getViolationSample();
049:
050: String getFixSample();
051:
052: String getResources();
053:
054: String getMessage();
055:
056: String getMessage(String key);
057:
058: /**
059: * Instantiates rule
060: * @return rule instance
061: */
062: Inspector getInspector() throws ConfigurationException;
063:
064: /**
065: * Accumulated parameters. Parameters from lower levels come first;
066: * @return Collection of ParameterEntry instances
067: */
068: Collection getParameters();
069:
070: /**
071: * Some violations can be waived, for example empty catch block
072: * might be justifiable in some situations. But other violations
073: * can not. For example there is no reason to waive Upper L Rule.
074: * @return TRUE if violation can be waived.
075: */
076: Boolean isWaivable();
077:
078: /**
079: * @return Collection of cases in which a violation can be waived.
080: */
081: Collection getWaiveCases();
082:
083: /**
084: * @param inspectorKey
085: * @return
086: */
087: String getWaivedInspectorName(String inspectorKey);
088:
089: Collection getWaivedInspectorNames();
090:
091: /**
092: * @param inspectorKey
093: * @return
094: */
095: String getWaiveReason(String inspectorKey);
096:
097: /**
098: * @param inspectorSet Inspector set to read descriptors from
099: * @param chain filtered inspector descriptors selected by previous descriptor in stack.
100: * @return Collection of inspector descriptors which this inspector
101: * descriptor declares as filtered.
102: */
103: Collection getFilteredInspectorDesriptors(
104: InspectorSet inspectorSet, Collection chain);
105:
106: /**
107: *
108: * @return Collection of names of inspectors whose visit() methods shall be invoked after this
109: * inspector's visit() methods and whose leave() methods shall be invoked before this inspector
110: * leave() method.
111: */
112: Collection getAfterInspectorNames();
113: }
|