View Javadoc

1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd;
5   
6   /**
7    * Base configuration class for both PMD and CPD.
8    * 
9    * @author Brian Remedios
10   */
11  public abstract class AbstractConfiguration {
12  
13      private String sourceEncoding = System.getProperty("file.encoding");
14      private boolean debug;
15  
16      /**
17       * Create a new abstract configuration.
18       */
19      protected AbstractConfiguration() {
20          super();
21      }
22  
23      /**
24       * Get the character encoding of source files.
25       * 
26       * @return The character encoding.
27       */
28      public String getSourceEncoding() {
29          return sourceEncoding;
30      }
31  
32      /**
33       * Set the character encoding of source files.
34       * 
35       * @param sourceEncoding The character encoding.
36       */
37      public void setSourceEncoding(String sourceEncoding) {
38          this.sourceEncoding = sourceEncoding;
39      }
40  
41      /**
42       * Return the debug indicator. If this value is <code>true</code> then PMD
43       * will log debug information.
44       * 
45       * @return <code>true</code> if debug logging is enabled, <code>false</code>
46       *         otherwise.
47       */
48      public boolean isDebug() {
49          return debug;
50      }
51  
52      /**
53       * Set the debug indicator.
54       * 
55       * @param debug The debug indicator to set.
56       * @see #isDebug()
57       */
58      public void setDebug(boolean debug) {
59          this.debug = debug;
60      }
61  }