001: package net.sourceforge.pmd;
002:
003: import java.util.List;
004: import java.util.Properties;
005:
006: /**
007: * Base class for Rule implementations which delegate to another Rule instance.
008: */
009: public class AbstractDelegateRule implements Rule {
010: private Rule rule;
011:
012: public AbstractDelegateRule() {
013: }
014:
015: public void setRule(Rule rule) {
016: this .rule = rule;
017: }
018:
019: public Rule getRule() {
020: return rule;
021: }
022:
023: public String getName() {
024: return rule.getName();
025: }
026:
027: public void setName(String name) {
028: rule.setName(name);
029: }
030:
031: public String getSince() {
032: return rule.getSince();
033: }
034:
035: public void setSince(String since) {
036: rule.setSince(since);
037: }
038:
039: public String getRuleClass() {
040: return rule.getRuleClass();
041: }
042:
043: public void setRuleClass(String ruleClass) {
044: rule.setRuleClass(ruleClass);
045: }
046:
047: public String getRuleSetName() {
048: return rule.getRuleSetName();
049: }
050:
051: public void setRuleSetName(String name) {
052: rule.setRuleSetName(name);
053: }
054:
055: public String getMessage() {
056: return rule.getMessage();
057: }
058:
059: public void setMessage(String message) {
060: rule.setMessage(message);
061: }
062:
063: public String getDescription() {
064: return rule.getDescription();
065: }
066:
067: public void setDescription(String description) {
068: rule.setDescription(description);
069: }
070:
071: public List<String> getExamples() {
072: return rule.getExamples();
073: }
074:
075: public String getExample() {
076: return rule.getExample();
077: }
078:
079: public void addExample(String example) {
080: rule.addExample(example);
081: }
082:
083: public String getExternalInfoUrl() {
084: return rule.getExternalInfoUrl();
085: }
086:
087: public void setExternalInfoUrl(String url) {
088: rule.setExternalInfoUrl(url);
089: }
090:
091: public int getPriority() {
092: return rule.getPriority();
093: }
094:
095: public void setPriority(int priority) {
096: rule.setPriority(priority);
097: }
098:
099: public String getPriorityName() {
100: return rule.getPriorityName();
101: }
102:
103: public boolean include() {
104: return rule.include();
105: }
106:
107: public void setInclude(boolean include) {
108: rule.setInclude(include);
109: }
110:
111: public Properties getProperties() {
112: return rule.getProperties();
113: }
114:
115: public void addProperty(String name, String property) {
116: rule.addProperty(name, property);
117: }
118:
119: public void addProperties(Properties properties) {
120: rule.addProperties(properties);
121: }
122:
123: public boolean hasProperty(String name) {
124: return rule.hasProperty(name);
125: }
126:
127: public boolean getBooleanProperty(String name) {
128: return rule.getBooleanProperty(name);
129: }
130:
131: public int getIntProperty(String name) {
132: return rule.getIntProperty(name);
133: }
134:
135: public double getDoubleProperty(String name) {
136: return rule.getDoubleProperty(name);
137: }
138:
139: public String getStringProperty(String name) {
140: return rule.getStringProperty(name);
141: }
142:
143: public PropertyDescriptor propertyDescriptorFor(String name) {
144: return rule.propertyDescriptorFor(name);
145: }
146:
147: public void setUsesDFA() {
148: rule.setUsesDFA();
149: }
150:
151: public boolean usesDFA() {
152: return rule.usesDFA();
153: }
154:
155: public void setUsesTypeResolution() {
156: rule.setUsesTypeResolution();
157: }
158:
159: public boolean usesTypeResolution() {
160: return rule.usesTypeResolution();
161: }
162:
163: public boolean usesRuleChain() {
164: return rule.usesRuleChain();
165: }
166:
167: public List<String> getRuleChainVisits() {
168: return rule.getRuleChainVisits();
169: }
170:
171: public void addRuleChainVisit(String astNodeName) {
172: rule.addRuleChainVisit(astNodeName);
173: }
174:
175: public void start(RuleContext ctx) {
176: rule.start(ctx);
177: }
178:
179: public void apply(List astCompilationUnits, RuleContext ctx) {
180: rule.apply(astCompilationUnits, ctx);
181: }
182:
183: public void end(RuleContext ctx) {
184: rule.end(ctx);
185: }
186: }
|