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

changeset 368
0989ad8c0860
parent 286
f50545b5e2f1
child 637
9c07ef4934dd
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, 2012, 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
23 * questions. 23 * questions.
24 */ 24 */
25 25
26 package com.sun.tools.internal.ws.wscompile; 26 package com.sun.tools.internal.ws.wscompile;
27 27
28 import com.sun.tools.internal.ws.resources.WscompileMessages;
29 import com.sun.tools.internal.ws.api.WsgenExtension; 28 import com.sun.tools.internal.ws.api.WsgenExtension;
30 import com.sun.tools.internal.ws.api.WsgenProtocol; 29 import com.sun.tools.internal.ws.api.WsgenProtocol;
30 import com.sun.tools.internal.ws.resources.WscompileMessages;
31 import com.sun.xml.internal.ws.api.BindingID; 31 import com.sun.xml.internal.ws.api.BindingID;
32 import com.sun.xml.internal.ws.binding.SOAPBindingImpl;
32 import com.sun.xml.internal.ws.util.ServiceFinder; 33 import com.sun.xml.internal.ws.util.ServiceFinder;
33 import com.sun.xml.internal.ws.binding.SOAPBindingImpl;
34 34
35 import javax.jws.WebService; 35 import javax.jws.WebService;
36 import javax.xml.namespace.QName; 36 import javax.xml.namespace.QName;
37 import java.io.File; 37 import java.io.File;
38 import java.util.*; 38 import java.util.ArrayList;
39 import java.util.LinkedHashMap;
40 import java.util.LinkedHashSet;
41 import java.util.List;
42 import java.util.Map;
43 import java.util.Set;
39 44
40 /** 45 /**
41 * @author Vivek Pandey 46 * @author Vivek Pandey
42 */ 47 */
43 public class WsgenOptions extends Options { 48 public class WsgenOptions extends Options {
87 92
88 /** 93 /**
89 * Tells if user specified a specific protocol 94 * Tells if user specified a specific protocol
90 */ 95 */
91 public boolean protocolSet = false; 96 public boolean protocolSet = false;
97
98 /**
99 * <code>-x file1 -x file2 ...<code/><br />
100 * Files to be parsed to get classes' metadata in addition/instead of using annotations and reflection API
101 */
102 public List<String> externalMetadataFiles = new ArrayList<String>();
92 103
93 private static final String SERVICENAME_OPTION = "-servicename"; 104 private static final String SERVICENAME_OPTION = "-servicename";
94 private static final String PORTNAME_OPTION = "-portname"; 105 private static final String PORTNAME_OPTION = "-portname";
95 private static final String HTTP = "http"; 106 private static final String HTTP = "http";
96 private static final String SOAP11 = "soap1.1"; 107 private static final String SOAP11 = "soap1.1";
161 doNotOverWrite = true; 172 doNotOverWrite = true;
162 return 1; 173 return 1;
163 } else if (args[i].equals("-inlineSchemas")) { 174 } else if (args[i].equals("-inlineSchemas")) {
164 inlineSchemas = true; 175 inlineSchemas = true;
165 return 1; 176 return 1;
177 } else if ("-x".equals(args[i])) {
178 externalMetadataFiles.add(requireArgument("-x", args, ++i));
179 return 1;
166 } 180 }
167 181
168 return j; 182 return j;
169 } 183 }
170 184
178 192
179 public Class endpoint; 193 public Class endpoint;
180 194
181 195
182 private boolean isImplClass; 196 private boolean isImplClass;
183 private boolean noWebServiceEndpoint;
184 197
185 public void validate() throws BadCommandLineException { 198 public void validate() throws BadCommandLineException {
186 if(nonclassDestDir == null) 199 if(nonclassDestDir == null)
187 nonclassDestDir = destDir; 200 nonclassDestDir = destDir;
188 201
230 if(clazz == null){ 243 if(clazz == null){
231 throw new BadCommandLineException(WscompileMessages.WSGEN_CLASS_NOT_FOUND(endpoints.get(0))); 244 throw new BadCommandLineException(WscompileMessages.WSGEN_CLASS_NOT_FOUND(endpoints.get(0)));
232 } 245 }
233 if(!isImplClass){ 246 if(!isImplClass){
234 throw new BadCommandLineException(WscompileMessages.WSGEN_CLASS_MUST_BE_IMPLEMENTATION_CLASS(clazz.getName())); 247 throw new BadCommandLineException(WscompileMessages.WSGEN_CLASS_MUST_BE_IMPLEMENTATION_CLASS(clazz.getName()));
235 }
236 if(noWebServiceEndpoint){
237 throw new BadCommandLineException(WscompileMessages.WSGEN_NO_WEBSERVICES_CLASS(clazz.getName()));
238 } 248 }
239 endpoint = clazz; 249 endpoint = clazz;
240 validateBinding(); 250 validateBinding();
241 } 251 }
242 252

mercurial