src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Options.java

changeset 368
0989ad8c0860
parent 286
f50545b5e2f1
child 408
b0610cd08440
equal deleted inserted replaced
366:8c0b6bccfe47 368:0989ad8c0860
1 /* 1 /*
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this 7 * published by the Free Software Foundation. Oracle designates this
34 import java.net.MalformedURLException; 34 import java.net.MalformedURLException;
35 import java.net.URL; 35 import java.net.URL;
36 import java.net.URLClassLoader; 36 import java.net.URLClassLoader;
37 import java.nio.charset.Charset; 37 import java.nio.charset.Charset;
38 import java.nio.charset.IllegalCharsetNameException; 38 import java.nio.charset.IllegalCharsetNameException;
39 import java.text.MessageFormat;
39 import java.util.ArrayList; 40 import java.util.ArrayList;
40 import java.util.List; 41 import java.util.List;
41 import java.util.StringTokenizer; 42 import java.util.StringTokenizer;
42 43
43 /** 44 /**
89 90
90 /** 91 /**
91 * -Xnocompile 92 * -Xnocompile
92 */ 93 */
93 public boolean nocompile; 94 public boolean nocompile;
95
96 /**
97 * Disable secure xml processing.
98 * -XdisableSecureXmlProcessing
99 */
100 public boolean disableSecureXmlProcessing = false;
94 101
95 public enum Target { 102 public enum Target {
96 V2_0, V2_1, V2_2; 103 V2_0, V2_1, V2_2;
97 104
98 /** 105 /**
178 185
179 public boolean isExtensionMode() { 186 public boolean isExtensionMode() {
180 return compatibilityMode == EXTENSION; 187 return compatibilityMode == EXTENSION;
181 } 188 }
182 189
183 /**
184 * Target direcoty when producing files.
185 */
186 public File targetDir = new File(".");
187
188
189
190 public boolean debug = false; 190 public boolean debug = false;
191 191
192 /** 192 /**
193 * -Xdebug - gives complete stack trace 193 * -Xdebug - gives complete stack trace
194 */ 194 */
211 * Remove generated files 211 * Remove generated files
212 */ 212 */
213 public void removeGeneratedFiles(){ 213 public void removeGeneratedFiles(){
214 for(File file : generatedFiles){ 214 for(File file : generatedFiles){
215 if (file.getName().endsWith(".java")) { 215 if (file.getName().endsWith(".java")) {
216 file.delete(); 216 boolean deleted = file.delete();
217 if (verbose && !deleted) {
218 System.out.println(MessageFormat.format("{0} could not be deleted.", file));
219 }
217 } 220 }
218 } 221 }
219 generatedFiles.clear(); 222 generatedFiles.clear();
220 } 223 }
221 224
233 */ 236 */
234 public void deleteGeneratedFiles() { 237 public void deleteGeneratedFiles() {
235 synchronized (generatedFiles) { 238 synchronized (generatedFiles) {
236 for (File file : generatedFiles) { 239 for (File file : generatedFiles) {
237 if (file.getName().endsWith(".java")) { 240 if (file.getName().endsWith(".java")) {
238 file.delete(); 241 boolean deleted = file.delete();
242 if (verbose && !deleted) {
243 System.out.println(MessageFormat.format("{0} could not be deleted.", file));
244 }
239 } 245 }
240 } 246 }
241 generatedFiles.clear(); 247 generatedFiles.clear();
242 } 248 }
243 } 249 }
346 } 352 }
347 } catch (IllegalCharsetNameException icne) { 353 } catch (IllegalCharsetNameException icne) {
348 throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); 354 throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding));
349 } 355 }
350 return 2; 356 return 2;
357 } else if (args[i].equals("-XdisableSecureXmlProcessing")) {
358 disableSecureXmlProcessing= true;
359 return 1;
351 } 360 }
352 return 0; 361 return 0;
353 } 362 }
354 363
355 /** 364 /**

mercurial