View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.commons.jci.compilers;
19  
20  
21  
22  /**
23   * Most common denominator for JavaCompiler settings.
24   * 
25   * If you need more specific settings you have to provide
26   * the native compiler configurations to the compilers.
27   * Writing of a custom factory is suggested. 
28   * 
29   * @author tcurdt
30   */
31  public class JavaCompilerSettings {
32  
33      private String targetVersion = "1.4";
34      private String sourceVersion = "1.4";
35      private String sourceEncoding = "UTF-8";
36      private boolean warnings = false;
37      private boolean deprecations = false;
38      private boolean debug = false;
39  
40      /** @deprecated */
41      private boolean verbose = false;
42  
43      public JavaCompilerSettings() {    	
44      }
45      
46      public JavaCompilerSettings( final JavaCompilerSettings pSettings ) {
47      	targetVersion = pSettings.targetVersion;
48      	sourceVersion = pSettings.sourceVersion;
49      	sourceEncoding = pSettings.sourceEncoding;
50      	warnings = pSettings.warnings;
51      	deprecations = pSettings.deprecations;
52      	debug = pSettings.debug;
53      }
54      
55      public void setTargetVersion( final String pTargetVersion ) {
56          targetVersion = pTargetVersion;
57      }
58  
59      public String getTargetVersion() {
60          return targetVersion;
61      }
62  
63  
64      public void setSourceVersion( final String pSourceVersion ) {
65          sourceVersion = pSourceVersion;
66      }
67  
68      public String getSourceVersion() {
69          return sourceVersion;
70      }
71  
72  
73      public void setSourceEncoding( final String pSourceEncoding ) {
74          sourceEncoding = pSourceEncoding;
75      }
76  
77      public String getSourceEncoding() {
78          return sourceEncoding;
79      }
80  
81  
82      public void setWarnings( final boolean pWarnings ) {
83          warnings = pWarnings;
84      }
85  
86      public boolean isWarnings() {
87          return warnings;
88      }
89  
90  
91      public void setDeprecations( final boolean pDeprecations )  {
92          deprecations = pDeprecations;
93      }
94  
95      public boolean isDeprecations() {
96          return deprecations;
97      }
98  
99      public void setDebug( final boolean pDebug )  {
100         debug = pDebug;
101     }
102 
103     public boolean isDebug() {
104         return debug;
105     }
106 
107     /** @deprecated */
108     public void setVerbose( final boolean pVerbose ) {
109         verbose = pVerbose;
110     }
111 
112     /** @deprecated */
113     public boolean isVerbose() {
114         return verbose;
115     }
116 
117 }