VirtualBox

source: vbox/trunk/src/VBox/Main/webservice/glue-jaxws.xsl@ 16660

Last change on this file since 16660 was 16124, checked in by vboxsync, 16 years ago

fixed webservice copyright

  • Property svn:eol-style set to native
File size: 48.2 KB
Line 
1<?xml version="1.0"?>
2
3<!--
4 websrv-jax-ws.xsl:
5 XSLT stylesheet that generates virtualbox.java from
6 VirtualBox.xidl. This generated Java code contains
7 a Java wrapper that allows client code to use the
8 webservice in an object-oriented way.
9
10 Copyright (C) 2006-2008 Sun Microsystems, Inc.
11
12 This file is part of VirtualBox Open Source Edition (OSE), as
13 available from http://www.virtualbox.org. This file is free software;
14 you can redistribute it and/or modify it under the terms of the GNU
15 General Public License (GPL) as published by the Free Software
16 Foundation, in version 2 as it comes in the "COPYING" file of the
17 VirtualBox OSE distribution. VirtualBox OSE is distributed in the
18 hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
19
20 Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
21 Clara, CA 95054 USA or visit http://www.sun.com if you need
22 additional information or have any questions.
23-->
24
25<xsl:stylesheet
26 version="1.0"
27 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
28 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
29 xmlns:exsl="http://exslt.org/common"
30 extension-element-prefixes="exsl">
31
32 <xsl:output method="text"/>
33
34 <xsl:strip-space elements="*"/>
35
36<!-- - - - - - - - - - - - - - - - - - - - - - -
37 global XSLT variables
38 - - - - - - - - - - - - - - - - - - - - - - -->
39
40<xsl:variable name="G_xsltFilename" select="'glue-jaxws.xsl'" />
41
42<xsl:include href="websrv-shared.inc.xsl" />
43
44<!-- collect all interfaces with "wsmap='suppress'" in a global variable for
45 quick lookup -->
46<xsl:variable name="G_setSuppressedInterfaces"
47 select="//interface[@wsmap='suppress']" />
48
49<xsl:template name="fileheader">
50 <xsl:param name="name" />
51 <xsl:text>
52/**
53 * Copyright (C) 2006-2008 Sun Microsystems, Inc.
54 *
55 * This file is part of VirtualBox Open Source Edition (OSE), as
56 * available from http://www.virtualbox.org. This file is free software;
57 * you can redistribute it and/or modify it under the terms of the GNU
58 * General Public License (GPL) as published by the Free Software
59 * Foundation, in version 2 as it comes in the "COPYING" file of the
60 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
61 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
62 *
63 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
64 * Clara, CA 95054 USA or visit http://www.sun.com if you need
65 * additional information or have any questions.
66 *
67 * This file is autogenerated by glue-jaxws.xsl, DO NOT EDIT!
68 */
69
70</xsl:text>
71</xsl:template>
72
73<xsl:template name="fullClassName">
74 <xsl:param name="name" />
75 <xsl:param name="origname" />
76 <xsl:param name="collPrefix" />
77 <xsl:variable name="coll" select="//collection[@name=$name]" />
78 <xsl:choose>
79 <xsl:when test="//collection[@name=$name]">
80 <!-- for collections and safearrays we return element type -->
81 <xsl:call-template name="fullClassName">
82 <xsl:with-param name="name" select="concat($collPrefix,//collection[@name=$name]/@type)" />
83 <xsl:with-param name="origname" select="//collection[@name=$name]/@type" />
84 <xsl:with-param name="collPrefix" select="$collPrefix" />
85 </xsl:call-template>
86 <!-- <xsl:value-of select="concat('org.virtualbox.', concat($collPrefix,//collection[@name=$name]/@type))" /> -->
87 </xsl:when>
88 <xsl:when test="//enum[@name=$name] or //enum[@name=$origname]">
89 <xsl:value-of select="concat('org.virtualbox.', $name)" />
90 </xsl:when>
91 <xsl:when test="$collPrefix and //interface[@name=$origname]/@wsmap='managed'">
92 <xsl:value-of select="concat('org.virtualbox.', $name)" />
93 </xsl:when>
94 <xsl:when test="//interface[@name=$name]/@wsmap='struct' or //interface[@name=$origname]/@wsmap='struct'">
95 <xsl:value-of select="concat('org.virtualbox.', $name)" />
96 </xsl:when>
97 <xsl:otherwise>
98 <xsl:value-of select="concat('com.sun.xml.ws.commons.virtualbox.', $name)" />
99 </xsl:otherwise>
100 </xsl:choose>
101</xsl:template>
102
103<!--
104 typeIdl2Glue: converts $type into a type as used by the java glue code.
105 For example, for an XIDL IMachineCollection, this will return
106 "List<com.sun.xml.ws.commons.virtualbox.IMachine>".
107 -->
108<xsl:template name="typeIdl2Glue">
109 <xsl:param name="ifname" />
110 <xsl:param name="method" />
111 <xsl:param name="name" />
112 <xsl:param name="type" />
113 <xsl:param name="safearray" />
114 <xsl:param name="forceelem" />
115
116 <xsl:variable name="needarray" select="($safearray='yes' or //collection[@name=$type]) and not($forceelem='yes')" />
117
118 <xsl:if test="$needarray">
119 <xsl:value-of select="'List&lt;'" />
120 </xsl:if>
121
122 <xsl:choose>
123 <xsl:when test="$type='wstring'">String</xsl:when>
124 <xsl:when test="$type='boolean'">Boolean</xsl:when>
125<!-- <xsl:when test="$type='double'">double</xsl:when> -->
126<!-- <xsl:when test="$type='float'">float</xsl:when> -->
127 <!-- <xsl:when test="$type='octet'">byte</xsl:when> -->
128<!-- <xsl:when test="$type='short'">short</xsl:when> -->
129 <xsl:when test="$type='unsigned short'">Integer</xsl:when>
130 <xsl:when test="$type='long'">Integer</xsl:when>
131 <xsl:when test="$type='long long'">Long</xsl:when>
132 <xsl:when test="$type='unsigned long'">Long</xsl:when>
133 <xsl:when test="$type='unsigned long long'">BigInteger</xsl:when>
134 <xsl:when test="$type='result'">Long</xsl:when>
135 <xsl:when test="$type='uuid'">UUID</xsl:when>
136 <!-- not a standard type: then it better be one of the types defined in the XIDL -->
137 <xsl:when test="$type='$unknown'">IUnknown</xsl:when>
138 <xsl:otherwise>
139 <xsl:call-template name="fullClassName">
140 <xsl:with-param name="name" select="$type" />
141 <xsl:with-param name="collPrefix" select="''"/>
142 </xsl:call-template>
143 </xsl:otherwise>
144 <!-- <xsl:otherwise> -->
145<!-- <xsl:call-template name="fatalError"> -->
146<!-- <xsl:with-param name="msg" select="concat('typeIdl2Glue: Type &quot;', $type, '&quot; in arg &quot;', $name, '&quot; of method &quot;', $ifname, '::', $method, '&quot; is not supported.')" /> -->
147<!-- </xsl:call-template> -->
148<!-- </xsl:otherwise> -->
149 </xsl:choose>
150
151 <xsl:if test="$needarray">
152 <xsl:value-of select="'&gt;'" />
153 </xsl:if>
154</xsl:template>
155
156<!--
157 typeIdl2Java: converts $type into a type as used by the JAX-WS backend.
158 For example, for an XIDL IMachineCollection, this will return
159 "ArrayOfIMachine".
160 -->
161<xsl:template name="typeIdl2Java">
162 <xsl:param name="ifname" />
163 <xsl:param name="method" />
164 <xsl:param name="name" />
165 <xsl:param name="type" />
166 <xsl:param name="safearray" />
167
168 <xsl:if test="$safearray">
169 <xsl:value-of select="'List&lt;'" />
170 </xsl:if>
171
172 <xsl:choose>
173 <xsl:when test="$type='wstring'">String</xsl:when>
174 <xsl:when test="$type='boolean'">Boolean</xsl:when>
175 <!-- <xsl:when test="$type='double'">double</xsl:when> -->
176 <!-- <xsl:when test="$type='float'">float</xsl:when> -->
177 <!-- <xsl:when test="$type='octet'">byte</xsl:when> -->
178 <!-- <xsl:when test="$type='short'">short</xsl:when> -->
179 <xsl:when test="$type='unsigned short'">int</xsl:when>
180 <xsl:when test="$type='long'">Integer</xsl:when>
181 <xsl:when test="$type='long long'">Long</xsl:when>
182 <xsl:when test="$type='unsigned long'">Long</xsl:when>
183 <xsl:when test="$type='unsigned long long'">BigInteger</xsl:when>
184 <xsl:when test="$type='result'">Long</xsl:when>
185 <xsl:when test="$type='uuid'">String</xsl:when>
186 <xsl:when test="$type='$unknown'">String</xsl:when>
187 <xsl:when test="//interface[@name=$type]/@wsmap='managed'">String</xsl:when>
188 <xsl:otherwise>
189 <xsl:call-template name="fullClassName">
190 <xsl:with-param name="name" select="$type" />
191 <xsl:with-param name="collPrefix" select="'ArrayOf'"/>
192 </xsl:call-template>
193 </xsl:otherwise>
194 <!-- <xsl:otherwise> -->
195<!-- <xsl:call-template name="fatalError"> -->
196<!-- <xsl:with-param name="msg" select="concat('typeIdl2Java: Type &quot;', $type, '&quot; in arg &quot;', $name, '&quot; of method &quot;', $ifname, '::', $method, '&quot; is not supported.')" /> -->
197<!-- </xsl:call-template> -->
198<!-- </xsl:otherwise> -->
199 </xsl:choose>
200 <xsl:if test="$safearray">
201 <xsl:value-of select="'&gt;'" />
202 </xsl:if>
203</xsl:template>
204
205<xsl:template name="cookOutParam">
206 <xsl:param name="ifname"/>
207 <xsl:param name="methodname"/>
208 <xsl:param name="value"/>
209 <xsl:param name="idltype"/>
210 <xsl:param name="safearray"/>
211 <xsl:choose>
212 <xsl:when test="$idltype='uuid'">
213 <xsl:choose>
214 <xsl:when test="$safearray">
215 <xsl:value-of select="concat('Helper.uuidWrap(',$value,')')" />
216 </xsl:when>
217 <xsl:otherwise>
218 <xsl:value-of select="concat('UUID.fromString(',$value,')')" />
219 </xsl:otherwise>
220 </xsl:choose>
221 </xsl:when>
222 <xsl:when test="//collection[@name=$idltype]">
223 <xsl:variable name="elemtype">
224 <xsl:call-template name="typeIdl2Glue">
225 <xsl:with-param name="ifname" select="$ifname" />
226 <xsl:with-param name="method" select="$methodname" />
227 <xsl:with-param name="name" select="$value" />
228 <xsl:with-param name="type" select="$idltype" />
229 <xsl:with-param name="forceelem" select="'yes'" />
230 </xsl:call-template>
231 </xsl:variable>
232 <xsl:choose>
233 <xsl:when test="contains($elemtype, 'org.virtualbox')">
234 <xsl:value-of select="concat($value,'.getArray()')" />
235 </xsl:when>
236 <xsl:otherwise>
237 <xsl:value-of select="concat('Helper.wrap(', $elemtype, '.class, port, ((',
238 $value,' == null)? null : ',$value,'.getArray()))')" />
239 </xsl:otherwise>
240 </xsl:choose>
241 </xsl:when>
242 <xsl:when test="//interface[@name=$idltype] or $idltype='$unknown'">
243 <xsl:choose>
244 <xsl:when test="//interface[@name=$idltype]/@wsmap='struct' and $safearray='yes'">
245 <xsl:value-of select="concat('/* 2 */', $value)" />
246 </xsl:when>
247 <xsl:when test="//interface[@name=$idltype]/@wsmap='struct'">
248 <xsl:value-of select="$value" />
249 </xsl:when>
250 <xsl:when test="$safearray='yes'">
251 <xsl:variable name="elemtype">
252 <xsl:call-template name="typeIdl2Glue">
253 <xsl:with-param name="ifname" select="$ifname" />
254 <xsl:with-param name="method" select="$methodname" />
255 <xsl:with-param name="name" select="$value" />
256 <xsl:with-param name="type" select="$idltype" />
257 <xsl:with-param name="safearray" select="'no'" />
258 <xsl:with-param name="forceelem" select="'yes'" />
259 </xsl:call-template>
260 </xsl:variable>
261 <xsl:value-of select="concat('Helper.wrap(',$elemtype, '.class, port, ', $value,')')"/>
262 </xsl:when>
263 <xsl:otherwise>
264 <xsl:variable name="gluetype">
265 <xsl:call-template name="typeIdl2Glue">
266 <xsl:with-param name="ifname" select="$ifname" />
267 <xsl:with-param name="method" select="$methodname" />
268 <xsl:with-param name="name" select="$value" />
269 <xsl:with-param name="type" select="$idltype" />
270 <xsl:with-param name="safearray" select="$safearray" />
271 </xsl:call-template>
272 </xsl:variable>
273 <xsl:value-of select="concat('new ', $gluetype, '(', $value,', port)')" />
274 </xsl:otherwise>
275 </xsl:choose>
276 </xsl:when>
277 <xsl:otherwise>
278 <xsl:value-of select="$value"/>
279 </xsl:otherwise>
280 </xsl:choose>
281</xsl:template>
282
283<xsl:template name="emitArgInMethodImpl">
284 <xsl:param name="paramname" select="@name" />
285 <xsl:param name="paramtype" select="@type" />
286 <!-- per-argument special type handling -->
287 <xsl:choose>
288 <xsl:when test="//interface[@name=$paramtype] or $paramtype='$unknown'">
289 <xsl:choose>
290 <xsl:when test="@dir='out'">
291 <xsl:value-of select="concat('tmp', $paramname)" />
292 </xsl:when>
293 <xsl:otherwise>
294 <xsl:choose>
295 <xsl:when test="@safearray='yes'">
296 <xsl:value-of select="concat('Helper.unwrap(',$paramname,')')"/>
297 </xsl:when>
298 <xsl:otherwise>
299 <xsl:value-of select="concat('((', $paramname, ' == null)?null:', $paramname, '.getRef())')" />
300 </xsl:otherwise>
301 </xsl:choose>
302 </xsl:otherwise>
303 </xsl:choose>
304 </xsl:when>
305 <xsl:when test="$paramtype='uuid'">
306 <xsl:value-of select="concat($paramname, '.toString()')" />
307 </xsl:when>
308 <xsl:otherwise>
309 <xsl:value-of select="$paramname" />
310 </xsl:otherwise>
311 </xsl:choose>
312 <xsl:if test="not(position()=last())">
313 <xsl:text>, </xsl:text>
314 </xsl:if>
315</xsl:template>
316
317
318<!-- - - - - - - - - - - - - - - - - - - - - - -
319 root match
320 - - - - - - - - - - - - - - - - - - - - - - -->
321
322<xsl:template match="/idl">
323 <xsl:text><![CDATA[
324/* DO NOT EDIT! This is a generated file.
325 * Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's interface definitions in XML)
326 * Generator: src/VBox/Main/webservice/glue-jaxws.xsl
327 */
328
329// ##### BEGINFILE "IUnknown.java"
330package com.sun.xml.ws.commons.virtualbox;
331
332import org.virtualbox.service.VboxPortType;
333import org.virtualbox.service.InvalidObjectFaultMsg;
334import org.virtualbox.service.RuntimeFaultMsg;
335import javax.xml.ws.WebServiceException;
336
337public class IUnknown
338{
339 protected String _this; /* almost final, could only be set in finalizer */
340 protected final VboxPortType port;
341
342 public IUnknown(String _this, VboxPortType port)
343 {
344 this._this = _this;
345 this.port = port;
346 }
347
348 public final String getRef()
349 {
350 return _this;
351 }
352
353 public final VboxPortType getRemoteWSPort()
354 {
355 return port;
356 }
357
358 public synchronized void releaseRemote() throws WebServiceException
359 {
360 if (_this == null) {
361 return;
362 }
363 try {
364 port.iManagedObjectRefRelease(_this);
365 _this = null;
366 } catch (InvalidObjectFaultMsg e) {
367 throw new WebServiceException(e);
368 } catch (RuntimeFaultMsg e) {
369 throw new WebServiceException(e);
370 }
371 }
372
373 /*
374 protected void finalize()
375 {
376 try {
377 releaseRemote();
378 } catch (WebServiceException e) {
379 }
380 } */
381
382 // may need to support some sort of QueryInterface, to make this class useable
383 // not only as common baseclass
384}
385
386// ##### ENDFILE "IUnknown.java"
387
388// ##### BEGINFILE "Helper.java"
389
390package com.sun.xml.ws.commons.virtualbox;
391
392import java.util.List;
393import java.util.ArrayList;
394import java.util.Collections;
395import java.util.UUID;
396import java.lang.reflect.Constructor;
397import java.lang.reflect.InvocationTargetException;
398import org.virtualbox.service.InvalidObjectFaultMsg;
399import org.virtualbox.service.RuntimeFaultMsg;
400import org.virtualbox.service.VboxService;
401import org.virtualbox.service.VboxPortType;
402
403class Helper {
404 public static <T> List<T> wrap(Class<T> wrapperClass, VboxPortType pt, List<String> thisPtrs) {
405 try {
406 if(thisPtrs==null) return Collections.emptyList();
407
408 Constructor<T> c = wrapperClass.getConstructor(String.class, VboxPortType.class);
409 List<T> ret = new ArrayList<T>(thisPtrs.size());
410 for (String thisPtr : thisPtrs) {
411 ret.add(c.newInstance(thisPtr,pt));
412 }
413 return ret;
414 } catch (NoSuchMethodException e) {
415 throw new AssertionError(e);
416 } catch (InstantiationException e) {
417 throw new AssertionError(e);
418 } catch (IllegalAccessException e) {
419 throw new AssertionError(e);
420 } catch (InvocationTargetException e) {
421 throw new AssertionError(e);
422 }
423 }
424
425 public static List<UUID> uuidWrap(List<String> uuidVals) {
426 List<UUID> ret = new ArrayList<UUID>(uuidVals.size());
427 for (String uuid : uuidVals) {
428 ret.add(UUID.fromString(uuid));
429 }
430 return ret;
431 }
432
433 public static <T extends IUnknown> List<String> unwrap(List<T> thisPtrs) {
434 if (thisPtrs==null) return Collections.emptyList();
435
436 List<String> ret = new ArrayList<String>();
437 for (T obj : thisPtrs) {
438 ret.add(obj.getRef());
439 }
440 return ret;
441 }
442}
443
444// ##### ENDFILE "Helper.java"
445
446// ##### BEGINFILE "IWebsessionManager.java"
447
448
449/**
450 * Copyright (C) 2006-2008 Sun Microsystems, Inc.
451 *
452 * This file is part of VirtualBox Open Source Edition (OSE), as
453 * available from http://www.virtualbox.org. This file is free software;
454 * you can redistribute it and/or modify it under the terms of the GNU
455 * General Public License (GPL) as published by the Free Software
456 * Foundation, in version 2 as it comes in the "COPYING" file of the
457 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
458 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
459 *
460 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
461 * Clara, CA 95054 USA or visit http://www.sun.com if you need
462 * additional information or have any questions.
463 *
464 * This file is autogenerated by glue-jaxws.xsl, DO NOT EDIT!
465 */
466
467package com.sun.xml.ws.commons.virtualbox;
468
469import java.net.URL;
470import java.math.BigInteger;
471import java.util.List;
472import java.util.Map;
473import java.util.HashMap;
474import java.util.UUID;
475import javax.xml.namespace.QName;
476import javax.xml.ws.BindingProvider;
477import javax.xml.ws.Holder;
478import javax.xml.ws.WebServiceException;
479import com.sun.xml.ws.commons.virtualbox.IUnknown;
480
481import org.virtualbox.service.InvalidObjectFaultMsg;
482import org.virtualbox.service.RuntimeFaultMsg;
483import org.virtualbox.service.VboxService;
484import org.virtualbox.service.VboxPortType;
485
486class PortPool
487{
488 private Map<VboxPortType, Integer> known;
489 private boolean initStarted;
490 private VboxService svc;
491
492 PortPool(boolean usePreinit)
493 {
494 known = new HashMap<VboxPortType, Integer>();
495
496 if (usePreinit)
497 {
498 new Thread(new Runnable()
499 {
500 public void run()
501 {
502 // need to sync on something else but 'this'
503 synchronized (known)
504 {
505 initStarted = true;
506 known.notify();
507 }
508
509 preinit();
510 }
511 }).start();
512
513 synchronized (known)
514 {
515 while (!initStarted)
516 {
517 try {
518 known.wait();
519 } catch (InterruptedException e) {
520 break;
521 }
522 }
523 }
524 }
525 }
526
527 private synchronized void preinit()
528 {
529 VboxPortType port = getPort();
530 releasePort(port);
531 }
532
533 synchronized VboxPortType getPort()
534 {
535 VboxPortType port = null;
536 for (VboxPortType cur: known.keySet())
537 {
538 if (known.get(cur) == 0)
539 {
540 port = cur;
541 break;
542 }
543 }
544
545 if (port == null)
546 {
547 if (svc == null) {
548 URL wsdl = PortPool.class.getClassLoader().getResource("vboxwebService.wsdl");
549 if (wsdl == null)
550 throw new LinkageError("vboxwebService.wsdl not found, but it should have been in the jar");
551 svc = new VboxService(wsdl,
552 new QName("http://www.virtualbox.org/Service",
553 "vboxService"));
554 }
555 port = svc.getVboxServicePort();
556 }
557 known.put(port, new Integer(1));
558 return port;
559 }
560
561 synchronized void releasePort(VboxPortType port)
562 {
563 Integer val = known.get(port);
564 if (val == null || val == 0)
565 {
566 // know you not
567 return;
568 }
569 known.put(port, val - 1);
570 }
571}
572
573public class IWebsessionManager {
574
575 private static PortPool pool = new PortPool(true);
576 protected VboxPortType port;
577
578 public IWebsessionManager(URL url) {
579 connect(url);
580 }
581
582 public IWebsessionManager(String url) {
583 connect(url);
584 }
585
586 public void connect(URL url)
587 {
588 connect(url.toExternalForm());
589 }
590
591 public void connect(String url)
592 {
593 this.port = pool.getPort();
594 ((BindingProvider)port).getRequestContext().
595 put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
596 }
597
598 public void disconnect(com.sun.xml.ws.commons.virtualbox.IVirtualBox refIVirtualBox)
599 {
600 logoff(refIVirtualBox);
601 pool.releasePort(port);
602 }
603
604 public void cleanupUnused()
605 {
606 System.gc();
607 Runtime.getRuntime().runFinalization();
608 }
609
610 /* method IWebsessionManager::logon(
611 [in] wstring username,
612 [in] wstring password,
613 [return] IVirtualBox return)
614 */
615 public com.sun.xml.ws.commons.virtualbox.IVirtualBox logon(String username, String password) {
616 try {
617 String retVal = port.iWebsessionManagerLogon(username, password);
618 return new com.sun.xml.ws.commons.virtualbox.IVirtualBox(retVal, port);
619 } catch (InvalidObjectFaultMsg e) {
620 throw new WebServiceException(e);
621 } catch (RuntimeFaultMsg e) {
622 throw new WebServiceException(e);
623 }
624 }
625
626 /* method IWebsessionManager::getSessionObject(
627 [in] IVirtualBox refIVirtualBox,
628 [return] ISession return)
629 */
630 public com.sun.xml.ws.commons.virtualbox.ISession getSessionObject(com.sun.xml.ws.commons.virtualbox.IVirtualBox refIVirtualBox) {
631 try {
632 String retVal = port.iWebsessionManagerGetSessionObject(((refIVirtualBox == null)?null:refIVirtualBox.getRef()));
633 return new com.sun.xml.ws.commons.virtualbox.ISession(retVal, port);
634 } catch (InvalidObjectFaultMsg e) {
635 throw new WebServiceException(e);
636 } catch (RuntimeFaultMsg e) {
637 throw new WebServiceException(e);
638 }
639 }
640
641 /* method IWebsessionManager::logoff(
642 [in] IVirtualBox refIVirtualBox)
643 */
644 public void logoff(com.sun.xml.ws.commons.virtualbox.IVirtualBox refIVirtualBox) {
645 try {
646 port.iWebsessionManagerLogoff(((refIVirtualBox == null)?null:refIVirtualBox.getRef()));
647 } catch (InvalidObjectFaultMsg e) {
648 throw new WebServiceException(e);
649 } catch (RuntimeFaultMsg e) {
650 throw new WebServiceException(e);
651 }
652 }
653}
654
655// ##### ENDFILE "IWebsessionManager.java"
656
657]]></xsl:text>
658
659 <xsl:text>// ######## COLLECTIONS&#10;&#10;</xsl:text>
660
661 <xsl:for-each select="//collection">
662 <xsl:variable name="type" select="@type" />
663 <xsl:variable name="arrayoftype" select="concat('ArrayOf', @type)" />
664 <xsl:variable name="filename" select="$arrayoftype" />
665
666 <xsl:value-of select="concat('&#10;// ##### BEGINFILE &quot;', $filename, '.java&quot;&#10;&#10;')" />
667
668 <xsl:call-template name="fileheader">
669 <xsl:with-param name="name" select="$filename" />
670 </xsl:call-template>
671
672 <xsl:text>package com.sun.xml.ws.commons.virtualbox;&#10;&#10;</xsl:text>
673
674 <xsl:text>import java.util.ArrayList;&#10;</xsl:text>
675 <xsl:text>import java.util.List;&#10;</xsl:text>
676 <xsl:text>import javax.xml.bind.annotation.XmlAccessType;&#10;</xsl:text>
677 <xsl:text>import javax.xml.bind.annotation.XmlAccessorType;&#10;</xsl:text>
678 <xsl:text>import javax.xml.bind.annotation.XmlType;&#10;&#10;</xsl:text>
679
680 <xsl:text>@XmlAccessorType(XmlAccessType.FIELD)&#10;</xsl:text>
681 <xsl:value-of select="concat('@XmlType(name = &quot;', $arrayoftype, '&quot;, propOrder = {&#10;')" />
682 <xsl:text> "array"&#10;</xsl:text>
683 <xsl:text>})&#10;&#10;</xsl:text>
684 <xsl:value-of select="concat('public class ', $arrayoftype, ' {&#10;&#10;')" />
685
686 <xsl:text> protected List&lt;String&gt; array;&#10;&#10;</xsl:text>
687
688 <xsl:text> public List&lt;String&gt; getArray() {&#10;</xsl:text>
689 <xsl:text> if (array == null) {&#10;</xsl:text>
690 <xsl:text> array = new ArrayList&lt;String&gt;();&#10;</xsl:text>
691 <xsl:text> }&#10;</xsl:text>
692 <xsl:text> return this.array;&#10;</xsl:text>
693 <xsl:text> }&#10;&#10;</xsl:text>
694 <xsl:text>}&#10;</xsl:text>
695
696 <xsl:value-of select="concat('&#10;// ##### ENDFILE &quot;', $filename, '.java&quot;&#10;&#10;')" />
697 </xsl:for-each>
698
699 <xsl:text>// ######## ENUMS&#10;&#10;</xsl:text>
700
701 <xsl:for-each select="//enum">
702 <xsl:variable name="enumname" select="@name" />
703 <xsl:variable name="filename" select="$enumname" />
704
705 <xsl:value-of select="concat('&#10;// ##### BEGINFILE &quot;', $filename, '.java&quot;&#10;&#10;')" />
706
707 <xsl:call-template name="fileheader">
708 <xsl:with-param name="name" select="$filename" />
709 </xsl:call-template>
710
711 <xsl:text>package com.sun.xml.ws.commons.virtualbox;&#10;&#10;</xsl:text>
712 <xsl:text>import javax.xml.bind.annotation.XmlEnum;&#10;</xsl:text>
713 <xsl:text>import javax.xml.bind.annotation.XmlEnumValue;&#10;</xsl:text>
714 <xsl:text>import javax.xml.bind.annotation.XmlType;&#10;&#10;</xsl:text>
715
716 <xsl:value-of select="concat('@XmlType(name = &quot;', $enumname, '&quot;)&#10;')" />
717 <xsl:text>@XmlEnum&#10;</xsl:text>
718 <xsl:value-of select="concat('public enum ', $enumname, ' {&#10;&#10;')" />
719 <xsl:for-each select="const">
720 <xsl:variable name="enumconst" select="@name" />
721 <xsl:value-of select="concat(' @XmlEnumValue(&quot;', $enumconst, '&quot;)&#10;')" />
722 <xsl:value-of select="concat(' ', $enumconst, '(&quot;', $enumconst, '&quot;)')" />
723 <xsl:choose>
724 <xsl:when test="not(position()=last())">
725 <xsl:text>,&#10;</xsl:text>
726 </xsl:when>
727 <xsl:otherwise>
728 <xsl:text>;&#10;</xsl:text>
729 </xsl:otherwise>
730 </xsl:choose>
731 </xsl:for-each>
732
733 <xsl:text>&#10;</xsl:text>
734 <xsl:text> private final String value;&#10;&#10;</xsl:text>
735
736 <xsl:value-of select="concat(' ', $enumname, '(String v) {&#10;')" />
737 <xsl:text> value = v;&#10;</xsl:text>
738 <xsl:text> }&#10;&#10;</xsl:text>
739
740 <xsl:text> public String value() {&#10;</xsl:text>
741 <xsl:text> return value;&#10;</xsl:text>
742 <xsl:text> }&#10;&#10;</xsl:text>
743
744 <xsl:value-of select="concat(' public static ', $enumname, ' fromValue(String v) {&#10;')" />
745 <xsl:value-of select="concat(' for (', $enumname, ' c: ', $enumname, '. values()) {&#10;')" />
746 <xsl:text> if (c.value.equals(v)) {&#10;</xsl:text>
747 <xsl:text> return c;&#10;</xsl:text>
748 <xsl:text> }&#10;</xsl:text>
749 <xsl:text> }&#10;</xsl:text>
750 <xsl:text> throw new IllegalArgumentException(v);&#10;</xsl:text>
751 <xsl:text> }&#10;&#10;</xsl:text>
752
753 <xsl:text>}&#10;&#10;</xsl:text>
754
755 <xsl:value-of select="concat('&#10;// ##### ENDFILE &quot;', $filename, '.java&quot;&#10;&#10;')" />
756
757 </xsl:for-each>
758
759 <xsl:text>// ######## INTERFACES &#10;&#10;</xsl:text>
760
761 <xsl:for-each select="//interface">
762 <xsl:variable name="ifname" select="@name" />
763 <xsl:variable name="filename" select="$ifname" />
764 <xsl:variable name="wsmap" select="@wsmap" />
765 <xsl:variable name="wscpp" select="@wscpp" />
766
767 <xsl:if test="not($wsmap='suppress') and not($wsmap='struct') and not ($wsmap='global')">
768 <xsl:value-of select="concat('&#10;// ##### BEGINFILE &quot;', $filename, '.java&quot;&#10;&#10;')" />
769
770 <xsl:call-template name="fileheader">
771 <xsl:with-param name="name" select="$filename" />
772 </xsl:call-template>
773
774 <xsl:text>package com.sun.xml.ws.commons.virtualbox;&#10;&#10;</xsl:text>
775
776 <xsl:text>import java.math.BigInteger;&#10;</xsl:text>
777 <xsl:text>import java.util.List;&#10;</xsl:text>
778 <xsl:text>import java.util.UUID;&#10;</xsl:text>
779 <xsl:text>import javax.xml.ws.Holder;&#10;</xsl:text>
780 <xsl:text>import javax.xml.ws.WebServiceException;&#10;</xsl:text>
781 <xsl:text>import com.sun.xml.ws.commons.virtualbox.IUnknown;&#10;&#10;</xsl:text>
782 <xsl:text>import org.virtualbox.service.InvalidObjectFaultMsg;&#10;</xsl:text>
783 <xsl:text>import org.virtualbox.service.RuntimeFaultMsg;&#10;</xsl:text>
784 <xsl:text>import org.virtualbox.service.VboxService;&#10;</xsl:text>
785 <xsl:text>import org.virtualbox.service.VboxPortType;&#10;&#10;</xsl:text>
786
787 <xsl:choose>
788 <xsl:when test="$wsmap='struct'">
789
790 <xsl:value-of select="concat('public class ', $ifname, ' {&#10;&#10;')" />
791
792 </xsl:when>
793
794 <xsl:otherwise>
795
796 <!-- interface (class) constructor -->
797 <xsl:value-of select="concat('public class ', $ifname, ' extends IUnknown {&#10;&#10;')" />
798 <xsl:value-of select="concat(' public static ', $ifname, ' cast(IUnknown other) {&#10;')" />
799 <xsl:value-of select="concat(' return new ', $ifname,
800 '(other.getRef(), other.getRemoteWSPort());&#10; }&#10;&#10;')"/>
801 <xsl:value-of select="concat(' public ', $ifname, '(String _this, VboxPortType port) {&#10;')" />
802 <xsl:text> super(_this,port);&#10;</xsl:text>
803 <xsl:text> }&#10;</xsl:text>
804
805 <!-- attributes -->
806 <xsl:for-each select="attribute">
807 <xsl:variable name="attrname"><xsl:value-of select="@name" /></xsl:variable>
808 <xsl:variable name="attrtype"><xsl:value-of select="@type" /></xsl:variable>
809 <xsl:variable name="attrreadonly"><xsl:value-of select="@readonly" /></xsl:variable>
810 <xsl:variable name="attrsafearray"><xsl:value-of select="@safearray" /></xsl:variable>
811
812 <xsl:choose>
813 <xsl:when test="( $attrtype=($G_setSuppressedInterfaces/@name) )">
814 <xsl:value-of select="concat('&#10; // Skipping attribute ', $attrtype, ' for it is of suppressed type ', $attrtype, '&#10;')" />
815 </xsl:when>
816 <xsl:otherwise>
817 <xsl:choose>
818 <xsl:when test="@readonly='yes'">
819 <xsl:value-of select="concat('&#10; // read-only attribute ', $ifname, '::', $attrname, ' of type ', $attrtype, '&#10;')" />
820 </xsl:when>
821 <xsl:otherwise>
822 <xsl:value-of select="concat('&#10; // read/write attribute ', $ifname, '::', $attrname, ' of type ', $attrtype, '&#10;')" />
823 </xsl:otherwise>
824 </xsl:choose>
825 <!-- emit getter method -->
826 <xsl:variable name="gettername"><xsl:call-template name="makeGetterName"><xsl:with-param name="attrname" select="$attrname" /></xsl:call-template></xsl:variable>
827 <xsl:variable name="jaxwsGetter"><xsl:call-template name="makeJaxwsMethod"><xsl:with-param name="ifname" select="$ifname" /><xsl:with-param name="methodname" select="$gettername" /></xsl:call-template></xsl:variable>
828 <xsl:variable name="gluegettertype">
829 <xsl:call-template name="typeIdl2Glue">
830 <xsl:with-param name="ifname" select="$ifname" />
831 <xsl:with-param name="method" select="$gettername" />
832 <xsl:with-param name="name" select="$attrname" />
833 <xsl:with-param name="type" select="$attrtype" />
834 <xsl:with-param name="safearray" select="@safearray" />
835 </xsl:call-template>
836 </xsl:variable>
837 <xsl:variable name="javagettertype">
838 <xsl:call-template name="typeIdl2Java">
839 <xsl:with-param name="ifname" select="$ifname" />
840 <xsl:with-param name="method" select="$gettername" />
841 <xsl:with-param name="name" select="$attrname" />
842 <xsl:with-param name="type" select="$attrtype" />
843 <xsl:with-param name="safearray" select="@safearray" />
844 </xsl:call-template>
845 </xsl:variable>
846 <xsl:value-of select="concat(' public ', $gluegettertype, ' ', $gettername, '() {&#10;')" />
847 <xsl:text> try {&#10;</xsl:text>
848 <xsl:value-of select="concat(' ', $javagettertype, ' retVal = port.', $jaxwsGetter, '(_this);&#10;')" />
849 <xsl:variable name="wrapped">
850 <xsl:call-template name="cookOutParam">
851 <xsl:with-param name="ifname" select="$ifname" />
852 <xsl:with-param name="method" select="$gettername" />
853 <xsl:with-param name="value" select="'retVal'" />
854 <xsl:with-param name="idltype" select="$attrtype" />
855 <xsl:with-param name="safearray" select="@safearray" />
856 </xsl:call-template>
857 </xsl:variable>
858 <xsl:value-of select="concat(' return ', $wrapped, ';&#10;')" />
859 <xsl:text> } catch (InvalidObjectFaultMsg e) {&#10;</xsl:text>
860 <xsl:text> throw new WebServiceException(e);&#10;</xsl:text>
861 <xsl:text> } catch (RuntimeFaultMsg e) {&#10;</xsl:text>
862 <xsl:text> throw new WebServiceException(e);&#10;</xsl:text>
863 <xsl:text> }&#10;</xsl:text>
864 <xsl:text> }&#10;</xsl:text>
865 <xsl:if test="not(@readonly='yes')">
866 <!-- emit setter -->
867 <xsl:variable name="settername"><xsl:call-template name="makeSetterName"><xsl:with-param name="attrname" select="$attrname" /></xsl:call-template></xsl:variable>
868 <xsl:variable name="jaxwsSetter"><xsl:call-template name="makeJaxwsMethod"><xsl:with-param name="ifname" select="$ifname" /><xsl:with-param name="methodname" select="$settername" /></xsl:call-template></xsl:variable>
869 <xsl:variable name="javasettertype">
870 <xsl:call-template name="typeIdl2Java">
871 <xsl:with-param name="ifname" select="$ifname" />
872 <xsl:with-param name="method" select="$settername" />
873 <xsl:with-param name="name" select="$attrname" />
874 <xsl:with-param name="type" select="$attrtype" />
875 </xsl:call-template>
876 </xsl:variable>
877 <xsl:value-of select="concat(' public void ', $settername, '(', $javasettertype, ' value) {&#10;')" />
878 <xsl:text> try {&#10;</xsl:text>
879 <xsl:value-of select="concat(' port.', $jaxwsSetter, '(_this, value);&#10;')" />
880 <xsl:text> } catch (InvalidObjectFaultMsg e) {&#10;</xsl:text>
881 <xsl:text> throw new WebServiceException(e);&#10;</xsl:text>
882 <xsl:text> } catch (RuntimeFaultMsg e) {&#10;</xsl:text>
883 <xsl:text> throw new WebServiceException(e);&#10;</xsl:text>
884 <xsl:text> }&#10;</xsl:text>
885 <xsl:text> }&#10;</xsl:text>
886 </xsl:if>
887 </xsl:otherwise>
888 </xsl:choose>
889 </xsl:for-each> <!-- attribute -->
890
891 <!-- emit real methods -->
892 <xsl:for-each select="method">
893 <xsl:variable name="methodname"><xsl:value-of select="@name" /></xsl:variable>
894 <xsl:variable name="portArg">
895 <xsl:if test="not($wsmap='global')">
896 <xsl:value-of select="'_this'"/>
897 </xsl:if>
898 </xsl:variable>
899
900 <!-- method header: return value "int", method name, soap arguments -->
901 <!-- skip this method if it has parameters of a type that has wsmap="suppress" -->
902 <xsl:choose>
903 <xsl:when test="param[@type=($G_setSuppressedInterfaces/@name)]">
904 <xsl:comment><xsl:value-of select="concat('Skipping method ', $methodname, ' for it has parameters with suppressed types')" /></xsl:comment>
905 </xsl:when>
906 <xsl:otherwise>
907 <xsl:variable name="fHasReturnParms" select="param[@dir='return']" />
908 <xsl:variable name="fHasOutParms" select="param[@dir='out']" />
909
910 <xsl:value-of select="concat('&#10; /* method ', $ifname, '::', $methodname, '(')" />
911 <xsl:for-each select="param">
912 <xsl:value-of select="concat('&#10; [', @dir, '] ', @type, ' ', @name)" />
913 <xsl:if test="@safearray='yes'">
914 <xsl:text>[]</xsl:text>
915 </xsl:if>
916 <xsl:if test="not(position()=last())">
917 <xsl:text>,</xsl:text>
918 </xsl:if>
919 </xsl:for-each>
920 <xsl:text>)&#10; */&#10;</xsl:text>
921 <!-- method implementation -->
922 <xsl:variable name="returnidltype" select="param[@dir='return']/@type" />
923 <xsl:variable name="returnidlsafearray" select="param[@dir='return']/@safearray" />
924 <xsl:variable name="returngluetype">
925 <xsl:choose>
926 <xsl:when test="$returnidltype">
927 <xsl:call-template name="typeIdl2Glue">
928 <xsl:with-param name="ifname" select="$ifname" />
929 <xsl:with-param name="method" select="$methodname" />
930 <xsl:with-param name="name" select="@name" />
931 <xsl:with-param name="type" select="$returnidltype" />
932 <xsl:with-param name="safearray" select="param[@dir='return']/@safearray" />
933 </xsl:call-template>
934 </xsl:when>
935 <xsl:otherwise>
936 <xsl:text>void</xsl:text>
937 </xsl:otherwise>
938 </xsl:choose>
939 </xsl:variable>
940 <xsl:value-of select="concat(' public ', $returngluetype, ' ', $methodname, '(')" />
941 <!-- make a set of all parameters with in and out direction -->
942 <xsl:variable name="paramsinout" select="param[@dir='in' or @dir='out']" />
943 <xsl:for-each select="exsl:node-set($paramsinout)">
944 <xsl:variable name="paramgluetype">
945 <xsl:call-template name="typeIdl2Glue">
946 <xsl:with-param name="ifname" select="$ifname" />
947 <xsl:with-param name="method" select="$methodname" />
948 <xsl:with-param name="name" select="@name" />
949 <xsl:with-param name="type" select="@type" />
950 <xsl:with-param name="safearray" select="@safearray" />
951 </xsl:call-template>
952 </xsl:variable>
953 <xsl:choose>
954 <xsl:when test="@dir='out'">
955 <xsl:value-of select="concat('Holder&lt;', $paramgluetype, '&gt; ', @name)" />
956 </xsl:when>
957 <xsl:otherwise>
958 <xsl:value-of select="concat($paramgluetype, ' ', @name)" />
959 </xsl:otherwise>
960 </xsl:choose>
961 <xsl:if test="not(position()=last())">
962 <xsl:text>, </xsl:text>
963 </xsl:if>
964 </xsl:for-each>
965 <xsl:text>) {&#10;</xsl:text>
966 <xsl:text> try {&#10;</xsl:text>
967 <xsl:if test="param[@dir='out']">
968 <xsl:for-each select="param[@dir='out']">
969 <xsl:variable name="paramtype" select="@type" />
970 <xsl:if test="//interface[@name=$paramtype] or $paramtype='$unknown'">
971 <xsl:choose>
972 <xsl:when test="@safearray='yes'">
973 <xsl:value-of select="concat(' Holder&lt;List&lt;String&gt;&gt; tmp', @name, ' = new Holder&lt;List&lt;String&gt;&gt;(); &#10;')" />
974 </xsl:when>
975 <xsl:otherwise>
976 <xsl:value-of select="concat(' Holder&lt;String&gt; tmp', @name, ' = new Holder&lt;String&gt;(); &#10;')" />
977 </xsl:otherwise>
978 </xsl:choose>
979 </xsl:if>
980 </xsl:for-each>
981 </xsl:if>
982
983 <xsl:text> </xsl:text>
984
985 <!-- make the function call: first have a stack variable for the return value, if any -->
986 <!-- XSLT doesn't allow variable override in inner blocks -->
987 <xsl:variable name="retValValue">
988 <xsl:choose>
989 <xsl:when test="param[@dir='out']">
990 <xsl:value-of select="'retVal.value'"/>
991 </xsl:when>
992 <xsl:otherwise>
993 <xsl:value-of select="'retVal'"/>
994 </xsl:otherwise>
995 </xsl:choose>
996 </xsl:variable>
997
998 <xsl:if test="$returnidltype">
999 <xsl:variable name="javarettype">
1000 <xsl:call-template name="typeIdl2Java">
1001 <xsl:with-param name="ifname" select="$ifname" />
1002 <xsl:with-param name="method" select="$methodname" />
1003 <xsl:with-param name="name" select="@name" />
1004 <xsl:with-param name="type" select="$returnidltype" />
1005 <xsl:with-param name="safearray" select="$returnidlsafearray" />
1006 </xsl:call-template>
1007 </xsl:variable>
1008 <xsl:choose>
1009 <xsl:when test="param[@dir='out']">
1010 <!-- create a new object for return value -->
1011 <xsl:value-of select="
1012 concat('Holder&lt;', $javarettype, '&gt;',
1013 ' ', 'retVal = new Holder&lt;', $javarettype,
1014 '&gt;();&#xa; ')"/>
1015 </xsl:when>
1016 <xsl:otherwise>
1017 <xsl:value-of select="$javarettype"/>
1018 <xsl:text> retVal = </xsl:text>
1019 </xsl:otherwise>
1020 </xsl:choose>
1021 </xsl:if>
1022 <!-- function name and arguments -->
1023 <xsl:variable name="jaxwsmethod"><xsl:call-template name="makeJaxwsMethod"><xsl:with-param name="ifname" select="$ifname" /><xsl:with-param name="methodname" select="$methodname" /></xsl:call-template></xsl:variable>
1024 <xsl:value-of select="concat('port.', $jaxwsmethod, '(', $portArg)" />
1025 <xsl:if test="$paramsinout and not($portArg='')">
1026 <xsl:text>, </xsl:text>
1027 </xsl:if>
1028 <!-- jax-ws has an oddity: if both out params and a return value exist, then the return value is moved to the function's argument list... -->
1029 <xsl:choose>
1030 <xsl:when test="param[@dir='out'] and param[@dir='return']">
1031 <xsl:for-each select="param">
1032 <xsl:choose>
1033 <xsl:when test="@dir='return'">
1034 <xsl:text>retVal</xsl:text>
1035 </xsl:when>
1036 <xsl:otherwise>
1037 <xsl:call-template name="emitArgInMethodImpl">
1038 <xsl:with-param name="paramname" select="@name" />
1039 <xsl:with-param name="paramtype" select="@type" />
1040 </xsl:call-template>
1041 </xsl:otherwise>
1042 </xsl:choose>
1043 </xsl:for-each>
1044 </xsl:when>
1045 <xsl:otherwise>
1046 <xsl:for-each select="$paramsinout">
1047 <xsl:call-template name="emitArgInMethodImpl">
1048 <xsl:with-param name="paramname" select="@name" />
1049 <xsl:with-param name="paramtype" select="@type" />
1050 </xsl:call-template>
1051 </xsl:for-each>
1052 </xsl:otherwise>
1053 </xsl:choose>
1054 <xsl:text>);&#10;</xsl:text>
1055 <!-- now copy temp out parameters to their actual destination -->
1056 <xsl:for-each select="param[@dir='out']">
1057 <xsl:variable name="paramtype" select="@type" />
1058 <xsl:if test="//interface[@name=$paramtype] or $paramtype='$unknown'">
1059 <xsl:variable name="paramname" select="@name" />
1060 <xsl:variable name="wrapped">
1061 <xsl:call-template name="cookOutParam">
1062 <xsl:with-param name="ifname" select="$ifname" />
1063 <xsl:with-param name="method" select="$methodname" />
1064 <xsl:with-param name="value" select="concat('tmp',@name,'.value')" />
1065 <xsl:with-param name="idltype" select="@type" />
1066 <xsl:with-param name="safearray" select="@safearray" />
1067 </xsl:call-template>
1068 </xsl:variable>
1069 <xsl:value-of select="concat(' ',$paramname,'.value = ',
1070 $wrapped,';&#10;')"/>
1071 </xsl:if>
1072 </xsl:for-each>
1073 <!-- next line with return + glue type -->
1074 <xsl:if test="$returnidltype">
1075 <xsl:variable name="retval">
1076 <xsl:call-template name="cookOutParam">
1077 <xsl:with-param name="ifname" select="$ifname" />
1078 <xsl:with-param name="method" select="$methodname" />
1079 <xsl:with-param name="value" select="$retValValue" />
1080 <xsl:with-param name="idltype" select="$returnidltype" />
1081 <xsl:with-param name="safearray" select="$returnidlsafearray" />
1082 </xsl:call-template>
1083 </xsl:variable>
1084 <xsl:value-of select="concat(' return ', $retval, ';&#10;')"/>
1085 </xsl:if>
1086 <xsl:text> } catch (InvalidObjectFaultMsg e) {&#10;</xsl:text>
1087 <xsl:text> throw new WebServiceException(e);&#10;</xsl:text>
1088 <xsl:text> } catch (RuntimeFaultMsg e) {&#10;</xsl:text>
1089 <xsl:text> throw new WebServiceException(e);&#10;</xsl:text>
1090 <xsl:text> }&#10;</xsl:text>
1091 <xsl:text> }&#10;</xsl:text>
1092 </xsl:otherwise>
1093 </xsl:choose>
1094 </xsl:for-each>
1095
1096 </xsl:otherwise>
1097 </xsl:choose>
1098 <!-- end of class -->
1099 <xsl:text>}&#10;</xsl:text>
1100 <xsl:value-of select="concat('&#10;// ##### ENDFILE &quot;', $filename, '.java&quot;&#10;&#10;')" />
1101 </xsl:if>
1102 </xsl:for-each>
1103
1104<!-- <xsl:apply-templates /> -->
1105</xsl:template>
1106
1107<!-- - - - - - - - - - - - - - - - - - - - - - -
1108 if
1109 - - - - - - - - - - - - - - - - - - - - - - -->
1110
1111<!--
1112 * ignore all |if|s except those for WSDL target
1113-->
1114<xsl:template match="if">
1115 <xsl:if test="@target='wsdl'">
1116 <xsl:apply-templates/>
1117 </xsl:if>
1118</xsl:template>
1119
1120<!-- - - - - - - - - - - - - - - - - - - - - - -
1121 cpp
1122 - - - - - - - - - - - - - - - - - - - - - - -->
1123
1124<xsl:template match="cpp">
1125<!-- ignore this -->
1126</xsl:template>
1127
1128<!-- - - - - - - - - - - - - - - - - - - - - - -
1129 library
1130 - - - - - - - - - - - - - - - - - - - - - - -->
1131
1132<xsl:template match="library">
1133 <xsl:apply-templates />
1134</xsl:template>
1135
1136<!-- - - - - - - - - - - - - - - - - - - - - - -
1137 class
1138 - - - - - - - - - - - - - - - - - - - - - - -->
1139
1140<xsl:template match="module/class">
1141<!-- TODO swallow for now -->
1142</xsl:template>
1143
1144<!-- - - - - - - - - - - - - - - - - - - - - - -
1145 enum
1146 - - - - - - - - - - - - - - - - - - - - - - -->
1147
1148<xsl:template match="enum">
1149</xsl:template>
1150
1151<!-- - - - - - - - - - - - - - - - - - - - - - -
1152 const
1153 - - - - - - - - - - - - - - - - - - - - - - -->
1154
1155<!--
1156<xsl:template match="const">
1157 <xsl:apply-templates />
1158</xsl:template>
1159-->
1160
1161<!-- - - - - - - - - - - - - - - - - - - - - - -
1162 desc
1163 - - - - - - - - - - - - - - - - - - - - - - -->
1164
1165<xsl:template match="desc">
1166<!-- TODO swallow for now -->
1167</xsl:template>
1168
1169<!-- - - - - - - - - - - - - - - - - - - - - - -
1170 note
1171 - - - - - - - - - - - - - - - - - - - - - - -->
1172
1173<xsl:template match="note">
1174<!-- TODO -->
1175 <xsl:apply-templates />
1176</xsl:template>
1177
1178<!-- - - - - - - - - - - - - - - - - - - - - - -
1179 interface
1180 - - - - - - - - - - - - - - - - - - - - - - -->
1181
1182<xsl:template match="interface">
1183
1184</xsl:template>
1185
1186
1187</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette