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      @Deprecated
42      private boolean verbose = false;
43  
44      public JavaCompilerSettings() {    	
45      }
46      
47      public JavaCompilerSettings( final JavaCompilerSettings pSettings ) {
48      	targetVersion = pSettings.targetVersion;
49      	sourceVersion = pSettings.sourceVersion;
50      	sourceEncoding = pSettings.sourceEncoding;
51      	warnings = pSettings.warnings;
52      	deprecations = pSettings.deprecations;
53      	debug = pSettings.debug;
54      }
55      
56      public void setTargetVersion( final String pTargetVersion ) {
57          targetVersion = pTargetVersion;
58      }
59  
60      public String getTargetVersion() {
61          return targetVersion;
62      }
63  
64  
65      public void setSourceVersion( final String pSourceVersion ) {
66          sourceVersion = pSourceVersion;
67      }
68  
69      public String getSourceVersion() {
70          return sourceVersion;
71      }
72  
73  
74      public void setSourceEncoding( final String pSourceEncoding ) {
75          sourceEncoding = pSourceEncoding;
76      }
77  
78      public String getSourceEncoding() {
79          return sourceEncoding;
80      }
81  
82  
83      public void setWarnings( final boolean pWarnings ) {
84          warnings = pWarnings;
85      }
86  
87      public boolean isWarnings() {
88          return warnings;
89      }
90  
91  
92      public void setDeprecations( final boolean pDeprecations )  {
93          deprecations = pDeprecations;
94      }
95  
96      public boolean isDeprecations() {
97          return deprecations;
98      }
99  
100     public void setDebug( final boolean pDebug )  {
101         debug = pDebug;
102     }
103 
104     public boolean isDebug() {
105         return debug;
106     }
107 
108     /** @deprecated */
109     @Deprecated
110     public void setVerbose( final boolean pVerbose ) {
111         verbose = pVerbose;
112     }
113 
114     /** @deprecated */
115     @Deprecated
116     public boolean isVerbose() {
117         return verbose;
118     }
119 
120 }