001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018 package org.apache.commons.jci.compilers;
019
020
021
022 /**
023 * Most common denominator for JavaCompiler settings.
024 *
025 * If you need more specific settings you have to provide
026 * the native compiler configurations to the compilers.
027 * Writing of a custom factory is suggested.
028 *
029 * @author tcurdt
030 */
031 public class JavaCompilerSettings {
032
033 private String targetVersion = "1.4";
034 private String sourceVersion = "1.4";
035 private String sourceEncoding = "UTF-8";
036 private boolean warnings = false;
037 private boolean deprecations = false;
038 private boolean debug = false;
039
040 /** @deprecated */
041 @Deprecated
042 private boolean verbose = false;
043
044 public JavaCompilerSettings() {
045 }
046
047 public JavaCompilerSettings( final JavaCompilerSettings pSettings ) {
048 targetVersion = pSettings.targetVersion;
049 sourceVersion = pSettings.sourceVersion;
050 sourceEncoding = pSettings.sourceEncoding;
051 warnings = pSettings.warnings;
052 deprecations = pSettings.deprecations;
053 debug = pSettings.debug;
054 }
055
056 public void setTargetVersion( final String pTargetVersion ) {
057 targetVersion = pTargetVersion;
058 }
059
060 public String getTargetVersion() {
061 return targetVersion;
062 }
063
064
065 public void setSourceVersion( final String pSourceVersion ) {
066 sourceVersion = pSourceVersion;
067 }
068
069 public String getSourceVersion() {
070 return sourceVersion;
071 }
072
073
074 public void setSourceEncoding( final String pSourceEncoding ) {
075 sourceEncoding = pSourceEncoding;
076 }
077
078 public String getSourceEncoding() {
079 return sourceEncoding;
080 }
081
082
083 public void setWarnings( final boolean pWarnings ) {
084 warnings = pWarnings;
085 }
086
087 public boolean isWarnings() {
088 return warnings;
089 }
090
091
092 public void setDeprecations( final boolean pDeprecations ) {
093 deprecations = pDeprecations;
094 }
095
096 public boolean isDeprecations() {
097 return deprecations;
098 }
099
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 }