glue-java.xsl revision 2efa9ced069adcf8c5b16613f04a1f4eb474e1de
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:stylesheet version = '1.0'
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync xmlns:vbox="http://www.virtualbox.org/"
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync xmlns:exsl="http://exslt.org/common"
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync extension-element-prefixes="exsl">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<!--
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync glue-java.xsl:
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync XSLT stylesheet that generates Java glue code for XPCOM, MSCOM and JAX-WS from
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync VirtualBox.xidl.
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
681bb0bf6e9ab5a590d8afcdf37634e2fc29f595vboxsync Copyright (C) 2010-2014 Oracle Corporation
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
a74782eac5771b0de57834e8c8c0247c55e8dd57vboxsync This file is part of VirtualBox Open Source Edition (OSE), as
a74782eac5771b0de57834e8c8c0247c55e8dd57vboxsync available from http://www.virtualbox.org. This file is free software;
a74782eac5771b0de57834e8c8c0247c55e8dd57vboxsync you can redistribute it and/or modify it under the terms of the GNU
a74782eac5771b0de57834e8c8c0247c55e8dd57vboxsync General Public License (GPL) as published by the Free Software
a74782eac5771b0de57834e8c8c0247c55e8dd57vboxsync Foundation, in version 2 as it comes in the "COPYING" file of the
a74782eac5771b0de57834e8c8c0247c55e8dd57vboxsync VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a74782eac5771b0de57834e8c8c0247c55e8dd57vboxsync hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync-->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:output
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync method="text"
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync version="1.0"
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync encoding="utf-8"
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync indent="no"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<!-- - - - - - - - - - - - - - - - - - - - - - -
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync global XSLT variables
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync - - - - - - - - - - - - - - - - - - - - - - -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:variable name="G_xsltFilename" select="'glue-java.xsl'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync<xsl:variable name="G_virtualBoxPackage" select="concat('org.virtualbox', $G_vboxApiSuffix)" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync<xsl:variable name="G_virtualBoxPackageCom" select="concat('org.virtualbox', $G_vboxApiSuffix, '.', $G_vboxGlueStyle)" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync<xsl:variable name="G_virtualBoxWsdl" select="concat('&quot;vboxwebService', $G_vboxApiSuffix, '.wsdl&quot;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync<!-- collect all interfaces with "wsmap='suppress'" in a global variable for quick lookup -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:variable name="G_setSuppressedInterfaces"
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync select="//interface[@wsmap='suppress']" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
9019681d4e9b8399b951793a9dd92b63c195e0eevboxsync<xsl:include href="../idl/typemap-shared.inc.xsl" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:strip-space elements="*"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="fileheader">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="name" />
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>/*
681bb0bf6e9ab5a590d8afcdf37634e2fc29f595vboxsync * Copyright (C) 2010-2014 Oracle Corporation
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync *
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * This file is part of the VirtualBox SDK, as available from
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * http://www.virtualbox.org. This library is free software; you can
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * redistribute it and/or modify it under the terms of the GNU Lesser General
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * Public License as published by the Free Software Foundation, in version 2.1
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * as it comes in the "COPYING.LIB" file of the VirtualBox SDK distribution.
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * This library is distributed in the hope that it will be useful, but WITHOUT
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * License for more details.
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync *
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' * ', $name)"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync *
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync * DO NOT EDIT! This is a generated file.
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync * Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's interface definitions in XML)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync * Generator: src/VBox/Main/glue/glue-java.xsl
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync */
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="startFile">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="file" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="package" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('&#10;// ##### BEGINFILE &quot;', $G_vboxDirPrefix, $file, '&quot;&#10;&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="fileheader">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="name" select="$file" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('package ', $package, ';&#10;&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('import ', $G_virtualBoxPackageCom, '.*;&#10;')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$G_vboxGlueStyle='xpcom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>import org.mozilla.interfaces.*;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$G_vboxGlueStyle='mscom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>import com.jacob.com.*;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>import com.jacob.activeX.ActiveXComponent;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$G_vboxGlueStyle='jaxws'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>import javax.xml.ws.*;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="fatalError">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="msg" select="'no header rule (startFile)'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('&#9;', $G_vboxDirPrefix, $file, ' \&#10;')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="endFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:param name="file" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('&#10;// ##### ENDFILE &quot;', $file, '&quot;&#10;&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template name="string-replace">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:param name="haystack"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:param name="needle"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:param name="replacement"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:param name="onlyfirst" select="false"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="contains($haystack, $needle)">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="substring-before($haystack, $needle)"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:value-of select="$replacement"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$onlyfirst = 'true'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="substring-after($haystack, $needle)"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="string-replace">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="haystack" select="substring-after($haystack, $needle)"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="needle" select="$needle"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="replacement" select="$replacement"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:choose>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:when>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:otherwise>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:value-of select="$haystack"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:otherwise>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:choose>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync<xsl:template name="string-trim">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:param name="text"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:variable name="begin" select="substring($text, 1, 1)"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$begin = ' ' or $begin = '&#10;' or $begin = '&#13;'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="string-trim">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="text" select="substring($text, 2)"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
2efa9ced069adcf8c5b16613f04a1f4eb474e1devboxsync <xsl:variable name="end" select="substring($text, string-length($text), 1)"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$end = ' ' or $end = '&#10;' or $end = '&#13;'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="string-trim">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="text" select="substring($text, 1, string-length($text) - 1)"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="contains($text, '&#10; ')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:variable name="tmptext">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="string-replace">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="haystack" select="$text"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="needle" select="'&#10; '"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="replacement" select="'&#10;'"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="string-trim">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="text" select="$tmptext"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="$text"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync</xsl:template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!-- descriptions -->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="*/text()">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <!-- TODO: strip out @c/@a for now. long term solution is changing that to a
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync tag in the xidl file, and translate it when generating doxygen etc. -->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:variable name="rep1">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:call-template name="string-replace">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="haystack" select="."/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="needle" select="'@c'"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="replacement" select="''"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:call-template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:variable>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:variable name="rep2">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:call-template name="string-replace">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="haystack" select="$rep1"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="needle" select="'@a'"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="replacement" select="''"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:call-template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:variable>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:variable name="rep3">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:call-template name="string-replace">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="haystack" select="$rep2"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="needle" select="'@todo'"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="replacement" select="'TODO'"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:call-template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:variable>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <!-- &amp;, &lt; and &gt; must remain as they are or javadoc 8 throws a fit. -->
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:variable name="rep4">
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:call-template name="string-replace">
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:with-param name="haystack" select="$rep3"/>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:with-param name="needle" select="'&amp;'"/>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:with-param name="replacement" select="'&amp;amp;'"/>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync </xsl:call-template>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync </xsl:variable>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:variable name="rep5">
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:call-template name="string-replace">
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:with-param name="haystack" select="$rep4"/>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:with-param name="needle" select="'&lt;'"/>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:with-param name="replacement" select="'&amp;lt;'"/>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync </xsl:call-template>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync </xsl:variable>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:variable name="rep6">
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:call-template name="string-replace">
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:with-param name="haystack" select="$rep5"/>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:with-param name="needle" select="'&gt;'"/>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:with-param name="replacement" select="'&amp;gt;'"/>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync </xsl:call-template>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync </xsl:variable>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:variable name="rep7">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="string-trim">
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:with-param name="text" select="$rep6"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:value-of select="$rep7"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!--
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * all sub-elements that are not explicitly matched are considered to be
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * html tags and copied w/o modifications
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync-->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="desc//*">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:variable name="tagname" select="local-name()"/>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:value-of select="concat('&lt;', $tagname)"/>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:if test="$tagname = 'table'"> <!-- javadoc 8 fudge -->
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:text> summary=""</xsl:text>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync </xsl:if>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:text>&gt;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('&lt;/', $tagname, '&gt;')"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template name="emit_refsig">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:param name="context"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:param name="identifier"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:choose>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:when test="//enum[@name=$context]/const[@name=$identifier]">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:value-of select="$identifier"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:when>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:when test="//interface[@name=$context]/method[@name=$identifier]">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:value-of select="$identifier"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>(</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:for-each select="//interface[@name=$context]/method[@name=$identifier]/param">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:if test="@dir!='return'">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:if test="position() > 1">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>,</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:if>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:choose>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:when test="@dir='out'">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>Holder</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:when>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:otherwise>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:call-template name="typeIdl2Glue">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="type" select="@type"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="safearray" select="@safearray"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="skiplisttype" select="'yes'"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:call-template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:otherwise>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:choose>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:if>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:for-each>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>)</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:when>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:when test="//interface[@name=$context]/attribute[@name=$identifier]">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:call-template name="makeGetterName">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="attrname" select="$identifier" />
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:call-template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>()</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:when>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:otherwise>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:call-template name="fatalError">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="msg" select="concat('unknown reference destination in @see/@link: context=', $context, ' identifier=', $identifier)" />
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:call-template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:otherwise>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:choose>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!--
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * link
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync-->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="desc//link">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>{@link </xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="." mode="middle"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>}</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="link" mode="middle">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:variable name="linktext">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="string-replace">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="haystack" select="@to"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="needle" select="'_'"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="replacement" select="'#'"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="onlyfirst" select="'true'"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:variable>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="substring($linktext, 1, 1)='#'">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:variable name="context">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:choose>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:when test="local-name(../..)='interface' or local-name(../..)='enum'">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:value-of select="../../@name"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:when>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:when test="local-name(../../..)='interface' or local-name(../../..)='enum'">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:value-of select="../../../@name"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:when>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:when test="local-name(../../../..)='interface' or local-name(../../../..)='enum'">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:value-of select="../../../../@name"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:when>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:when test="local-name(../../../../..)='interface' or local-name(../../../../..)='enum'">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:value-of select="../../../../../@name"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:when>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:when test="local-name(../../../../../..)='interface' or local-name(../../../../../..)='enum'">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:value-of select="../../../../../../@name"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:when>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:otherwise>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:call-template name="fatalError">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="msg" select="concat('cannot determine context for identifier ', $linktext)" />
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:call-template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:otherwise>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:choose>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:variable>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:variable name="linkname">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="substring($linktext, 2)"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:variable>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>#</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:call-template name="emit_refsig">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="context" select="$context"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="identifier" select="$linkname"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:call-template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="contains($linktext, '::')">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:variable name="context">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="substring-before($linktext, '::')"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:variable>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:variable name="linkname">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="substring-after($linktext, '::')"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($G_virtualBoxPackage, '.', $context, '#')"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:call-template name="emit_refsig">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="context" select="$context"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="identifier" select="$linkname"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:call-template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:when>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($G_virtualBoxPackage, '.', $linktext)"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:otherwise>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:choose>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!--
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * note
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync-->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="desc/note">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:if test="not(@internal='yes')">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&#10;NOTE: </xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&#10;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:if>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!--
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * see
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync-->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="desc/see">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <!-- TODO: quirk in our xidl file: only one <see> tag with <link> nested
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync into it, translate this to multiple @see lines and strip the rest.
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync Should be replaced in the xidl by multiple <see> without nested tag -->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&#10;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates match="link"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="desc/see/text()"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="desc/see/link">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>@see </xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="." mode="middle"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&#10;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!--
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * common comment prologue (handles group IDs)
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync-->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="desc" mode="begin">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:param name="id" select="@group | preceding::descGroup[1]/@id"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>&#10;/**&#10;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:if test="$id">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' @ingroup ', $id, '&#10;')"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:if>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!--
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * common middle part of the comment block
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync-->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="desc" mode="middle">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="note"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="see"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!--
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * result part of the comment block
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync-->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="desc" mode="results">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:if test="result">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&#10;Expected result codes:&#10;</xsl:text>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:text>&lt;table summary=""&gt;&#10;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:for-each select="result">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&lt;tr&gt;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:choose>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:when test="ancestor::library/result[@name=current()/@name]">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('&lt;td&gt;@link ::', @name, ' ', @name, '&lt;/td&gt;')"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:when>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('&lt;td&gt;', @name, '&lt;/td&gt;')"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:otherwise>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:choose>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&lt;td&gt;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="text() | *[not(self::note or self::see or
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync self::result)]"/>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:text>&lt;/td&gt;&lt;/tr&gt;&#10;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:for-each>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&lt;/table&gt;&#10;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:if>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!--
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * translates the string to uppercase
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync-->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template name="uppercase">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:param name="str" select="."/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="translate($str, $G_lowerCase, $G_upperCase)"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!--
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * comment for interfaces
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync-->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="desc" mode="interface">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="." mode="begin"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="." mode="middle"/>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:text>&#10;&#10;Interface ID: &lt;tt&gt;{</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:call-template name="uppercase">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="str" select="../@uuid"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:call-template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>}&lt;/tt&gt;&#10;*/&#10;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!--
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * comment for attribute getters
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync-->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="desc" mode="attribute_get">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="." mode="begin"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="text() | *[not(self::note or self::see or self::result)]"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="." mode="results"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="note"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&#10;@return </xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:call-template name="typeIdl2Glue">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="type" select="../@type"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="safearray" select="../@safearray"/>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:with-param name="doubleescape">yes</xsl:with-param>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:call-template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&#10;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="see"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>*/&#10;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!--
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * comment for attribute setters
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync-->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="desc" mode="attribute_set">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="." mode="begin"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="text() | *[not(self::note or self::see or self::result)]"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="." mode="results"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="note"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&#10;@param value </xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:call-template name="typeIdl2Glue">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="type" select="../@type"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="safearray" select="../@safearray"/>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:with-param name="doubleescape">yes</xsl:with-param>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:call-template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&#10;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="see"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&#10;*/&#10;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!--
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * comment for methods
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync-->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="desc" mode="method">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="." mode="begin"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="text() | *[not(self::note or self::see or self::result)]"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:for-each select="../param">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="desc"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:for-each>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="." mode="results"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="note"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="../param/desc/note"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="see"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&#10;*/&#10;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!--
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * comment for method parameters
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync-->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="method/param/desc">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:if test="text() | *[not(self::note or self::see)]">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:choose>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:when test="../@dir='return'">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&#10;@return </xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:when>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:otherwise>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&#10;@param </xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:value-of select="../@name"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text> </xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:otherwise>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:choose>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&#10;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:if>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!--
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * comment for enums
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync-->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="desc" mode="enum">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="." mode="begin"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="." mode="middle"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&#10;Interface ID: &lt;tt&gt;{</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:call-template name="uppercase">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="str" select="../@uuid"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:call-template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>}&lt;/tt&gt;&#10;*/&#10;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!--
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * comment for enum values
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync-->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="desc" mode="enum_const">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="." mode="begin"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="." mode="middle"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:text>&#10;*/&#10;</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync</xsl:template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!--
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync * ignore descGroups by default (processed in /idl)
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync-->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<xsl:template match="descGroup"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync<!-- actual code generation -->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="genEnum">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="enumname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="filename" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="startFile">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="file" select="$filename" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="package" select="$G_virtualBoxPackage" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:apply-templates select="desc" mode="enum"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('public enum ', $enumname, '&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>{&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:for-each select="const">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:apply-templates select="desc" mode="enum_const"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:variable name="enumconst" select="@name" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' ', $enumconst, '(', @value, ')')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="not(position()=last())">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>,&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:for-each>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> private final int value;&#10;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' ', $enumname, '(int v)&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> value = v;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> public int value()&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> return value;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' public static ', $enumname, ' fromValue(long v)&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' for (', $enumname, ' c: ', $enumname, '.values())&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> if (c.value == (int)v)&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> return c;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> throw new IllegalArgumentException(Long.toString(v));&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' public static ', $enumname, ' fromValue(String v)&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' return valueOf(', $enumname, '.class, v);&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>}&#10;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="endFile">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="file" select="$filename" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="startExcWrapper">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> try&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="endExcWrapper">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='xpcom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> catch (org.mozilla.xpcom.XPCOMException e)&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> throw new VBoxException(e.getMessage(), e);&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='mscom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> catch (com.jacob.com.ComException e)&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> throw new VBoxException(e.getMessage(), e);&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='jaxws'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> catch (InvalidObjectFaultMsg e)&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> throw new VBoxException(e.getMessage(), e, this.port);&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> catch (RuntimeFaultMsg e)&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> throw new VBoxException(e.getMessage(), e, this.port);&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fatalError">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="msg" select="'no header rule (startFile)'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="wrappedName">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="ifname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='xpcom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('org.mozilla.interfaces.', $ifname)" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='mscom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>com.jacob.com.Dispatch</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='jaxws'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>String</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fatalError">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="msg" select="'no wrapper naming rule defined (wrappedName)'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="fullClassName">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="name" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="origname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="collPrefix" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="//enum[@name=$name] or //enum[@name=$origname]">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($G_virtualBoxPackage, concat('.', $name))" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="//interface[@name=$name]">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($G_virtualBoxPackage, concat('.', $name))" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fatalError">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="msg" select="concat('fullClassName: Type &quot;', $name, '&quot; is not supported.')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="type" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="forceelem" />
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:param name="skiplisttype" />
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:param name="doubleescape" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="needarray" select="($safearray='yes') and not($forceelem='yes')" />
b55da80ce7c51536e111dfe8a7b6e62b6291fee9vboxsync <xsl:variable name="needlist" select="($needarray) and not($type='octet')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
b55da80ce7c51536e111dfe8a7b6e62b6291fee9vboxsync <xsl:if test="($needlist)">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>List</xsl:text>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:if test="not($skiplisttype='yes')">
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:choose>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:when test="$doubleescape='yes'">
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:text>&amp;lt;</xsl:text>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync </xsl:when>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:otherwise>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:text>&lt;</xsl:text>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync </xsl:otherwise>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync </xsl:choose>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:if test="not($needlist) or not($skiplisttype='yes')">
9019681d4e9b8399b951793a9dd92b63c195e0eevboxsync <!-- look up Java type from IDL type from table array in typemap-shared.inc.xsl -->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:variable name="javatypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@javaname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:choose>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:when test="string-length($javatypefield)">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:value-of select="$javatypefield" />
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:when>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <!-- not a standard type: then it better be one of the types defined in the XIDL -->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:when test="$type='$unknown'">IUnknown</xsl:when>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:otherwise>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:call-template name="fullClassName">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="name" select="$type" />
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="collPrefix" select="''"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:call-template>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:otherwise>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:choose>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
b55da80ce7c51536e111dfe8a7b6e62b6291fee9vboxsync <xsl:choose>
b55da80ce7c51536e111dfe8a7b6e62b6291fee9vboxsync <xsl:when test="($needlist)">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:if test="not($skiplisttype='yes')">
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:choose>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:when test="$doubleescape='yes'">
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:text>&amp;gt;</xsl:text>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync </xsl:when>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:otherwise>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync <xsl:text>&gt;</xsl:text>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync </xsl:otherwise>
4f5e73894b93589ddb2ed7298616c55d657d7f01vboxsync </xsl:choose>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:if>
b55da80ce7c51536e111dfe8a7b6e62b6291fee9vboxsync </xsl:when>
b55da80ce7c51536e111dfe8a7b6e62b6291fee9vboxsync <xsl:when test="($needarray)">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>[]</xsl:text>
b55da80ce7c51536e111dfe8a7b6e62b6291fee9vboxsync </xsl:when>
b55da80ce7c51536e111dfe8a7b6e62b6291fee9vboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<!--
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync typeIdl2Back: converts $type into a type as used by the backend.
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="typeIdl2Back">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="type" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="safearray" />
f69f2d3ce5811c47ea4d33bccaba5bd77ce685b6vboxsync <xsl:param name="forceelem" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
f69f2d3ce5811c47ea4d33bccaba5bd77ce685b6vboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($G_vboxGlueStyle='xpcom')">
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync <xsl:variable name="needarray" select="($safearray='yes') and not($forceelem='yes')" />
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='long long'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>long</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='unsigned long'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>long</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='long'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>int</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='unsigned short'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>int</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='short'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>short</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='octet'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>byte</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='boolean'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>boolean</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='$unknown'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>nsISupports</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='wstring'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>String</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='uuid'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>String</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//interface[@name=$type]/@wsmap='struct'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="wrappedName">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="ifname" select="$type" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//interface[@name=$type]">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="wrappedName">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="ifname" select="$type" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//enum[@name=$type]">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>long</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fullClassName">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="name" select="$type" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="$needarray">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>[]</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($G_vboxGlueStyle='mscom')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>Variant</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($G_vboxGlueStyle='jaxws')">
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync <xsl:variable name="needarray" select="($safearray='yes' and not($type='octet')) and not($forceelem='yes')" />
f69f2d3ce5811c47ea4d33bccaba5bd77ce685b6vboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="$needarray">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>List&lt;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='$unknown'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>String</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//interface[@name=$type]/@wsmap='managed'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>String</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//interface[@name=$type]/@wsmap='struct'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat($G_virtualBoxPackageCom, '.', $type)" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//enum[@name=$type]">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat($G_virtualBoxPackageCom, '.', $type)" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync <!-- we encode byte arrays as Base64 strings. -->
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync <xsl:when test="$type='octet'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>/*base64*/String</xsl:text>
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync </xsl:when>
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='long long'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>Long</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='unsigned long'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>Long</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='long'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>Integer</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='unsigned short'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>Integer</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='short'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>Short</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='boolean'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>Boolean</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='wstring'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>String</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$type='uuid'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>String</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fatalError">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="msg" select="concat('Unhandled type ', $type, ' (typeIdl2Back)')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="$needarray">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>&gt;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fatalError">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="msg" select="'Write typeIdl2Back for this style (typeIdl2Back)'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="cookOutParamXpcom">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="idltype"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="safearray"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="isstruct"
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync select="//interface[@name=$idltype]/@wsmap='struct'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="gluetype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="elemgluetype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="$safearray='yes'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="'no'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="forceelem" select="'yes'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//interface[@name=$idltype] or $idltype='$unknown'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$safearray='yes'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="elembacktype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Back">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="forceelem" select="'yes'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.wrap2(', $elemgluetype, '.class, ', $elembacktype, '.class, ', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('(', $value, ' != null) ? new ', $gluetype, '(', $value, ') : null')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//enum[@name=$idltype]">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$safearray='yes'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="elembacktype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Back">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="forceelem" select="'yes'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.wrapEnum(', $elemgluetype, '.class, ', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($gluetype, '.fromValue(', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
b55da80ce7c51536e111dfe8a7b6e62b6291fee9vboxsync <xsl:when test="($safearray='yes') and ($idltype='octet')">
b55da80ce7c51536e111dfe8a7b6e62b6291fee9vboxsync <xsl:value-of select="$value"/>
b55da80ce7c51536e111dfe8a7b6e62b6291fee9vboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$safearray='yes'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.wrap(', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="$value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="cookOutParamMscom">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="idltype"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="safearray"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="gluetype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$safearray='yes'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="elemgluetype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="'no'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="forceelem" select="'yes'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync <xsl:choose>
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync <xsl:when test="($idltype='octet')">
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync <xsl:value-of select="concat('Helper.wrapBytes(', $value, '.toSafeArray())')"/>
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync </xsl:when>
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.wrap(', $elemgluetype, '.class, ', $value, '.toSafeArray())')"/>
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync </xsl:otherwise>
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//interface[@name=$idltype] or $idltype='$unknown'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.wrapDispatch(', $gluetype, '.class, ', $value, '.getDispatch())')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//enum[@name=$idltype]">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($gluetype, '.fromValue(', $value, '.getInt())')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$idltype='wstring'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($value, '.getString()')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$idltype='uuid'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($value, '.getString()')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$idltype='boolean'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($value, '.toBoolean()')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$idltype='unsigned short'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('(int)', $value, '.getShort()')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$idltype='short'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($value, '.getShort()')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$idltype='long'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($value, '.getInt()')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$idltype='unsigned long'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('(long)', $value, '.getInt()')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$idltype='long'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($value, '.getInt()')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$idltype='long long'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($value, '.getLong()')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fatalError">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="msg" select="concat('Unhandled type' , $idltype, ' (cookOutParamMscom)')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="cookOutParamJaxws">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="idltype"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="safearray"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="isstruct"
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync select="//interface[@name=$idltype]/@wsmap='struct'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="gluetype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$safearray='yes'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="elemgluetype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="''" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="forceelem" select="'yes'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="elembacktype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Back">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="''" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="forceelem" select="'yes'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$isstruct">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.wrap2(', $elemgluetype, '.class, ', $elembacktype, '.class, port, ', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//enum[@name=$idltype]">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.convertEnums(', $elembacktype, '.class, ', $elemgluetype, '.class, ', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//interface[@name=$idltype] or $idltype='$unknown'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.wrap(', $elemgluetype, '.class, port, ', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
b55da80ce7c51536e111dfe8a7b6e62b6291fee9vboxsync <xsl:when test="$idltype='octet'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.decodeBase64(', $value, ')')"/>
b55da80ce7c51536e111dfe8a7b6e62b6291fee9vboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="$value" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//enum[@name=$idltype]">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($gluetype, '.fromValue(', $value, '.value())')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$idltype='boolean'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="$value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$idltype='long long'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="$value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$idltype='unsigned long long'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="$value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$idltype='long'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="$value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$idltype='unsigned long'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="$value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$idltype='short'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="$value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$idltype='unsigned short'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="$value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$idltype='wstring'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="$value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$idltype='uuid'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="$value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$isstruct">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('(', $value, ' != null) ? new ', $gluetype, '(', $value, ', port) : null')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//interface[@name=$idltype] or $idltype='$unknown'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- if the MOR string is empty, that means NULL, so return NULL instead of an object then -->
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('(', $value, '.length() > 0) ? new ', $gluetype, '(', $value, ', port) : null')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fatalError">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="msg" select="concat('Unhandled type ', $idltype, ' (cookOutParamJaxws)')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="cookOutParam">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="idltype"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="safearray"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($G_vboxGlueStyle='xpcom')">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="cookOutParamXpcom">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="value" select="$value" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="idltype" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($G_vboxGlueStyle='mscom')">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="cookOutParamMscom">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="value" select="$value" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="idltype" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($G_vboxGlueStyle='jaxws')">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="cookOutParamJaxws">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="value" select="$value" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="idltype" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fatalError">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="msg" select="'Unhandled style(cookOutParam)'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="cookInParamXpcom">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="idltype"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="safearray"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="isstruct"
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync select="//interface[@name=$idltype]/@wsmap='struct'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="gluetype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="backtype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Back">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="elemgluetype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="$safearray='yes'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="'no'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="forceelem" select="'yes'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//interface[@name=$idltype]">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$safearray='yes'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="elembacktype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Back">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="forceelem" select="'yes'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.unwrap2(', $elemgluetype, '.class, ', $elembacktype, '.class, ', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('(', $value, ' != null) ? ', $value, '.getTypedWrapped() : null')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$idltype='$unknown'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$safearray='yes'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.unwrap2(', $elemgluetype, '.class, nsISupports.class, ', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('(', $value, ' != null) ? (nsISupports)', $value, '.getWrapped() : null')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//enum[@name=$idltype]">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$safearray='yes'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.unwrapEnum(', $elemgluetype, '.class, ', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($value, '.value()')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
fd168522254205059178a7e247606c9159ed2ae3vboxsync <xsl:when test="($idltype='octet') and ($safearray='yes')">
fd168522254205059178a7e247606c9159ed2ae3vboxsync <xsl:value-of select="$value"/>
fd168522254205059178a7e247606c9159ed2ae3vboxsync </xsl:when>
fd168522254205059178a7e247606c9159ed2ae3vboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$safearray='yes'">
3eb20a0f8ee657eb760b265e48ef3daeaee0bcb1vboxsync <xsl:choose>
3eb20a0f8ee657eb760b265e48ef3daeaee0bcb1vboxsync <xsl:when test="$idltype='boolean'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.unwrapBoolean(', $value, ')')"/>
3eb20a0f8ee657eb760b265e48ef3daeaee0bcb1vboxsync </xsl:when>
3eb20a0f8ee657eb760b265e48ef3daeaee0bcb1vboxsync <xsl:when test="($idltype='long') or ($idltype='unsigned long') or ($idltype='integer')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.unwrapInteger(', $value, ')')"/>
3eb20a0f8ee657eb760b265e48ef3daeaee0bcb1vboxsync </xsl:when>
3eb20a0f8ee657eb760b265e48ef3daeaee0bcb1vboxsync <xsl:when test="($idltype='short') or ($idltype='unsigned short')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.unwrapUShort(', $value, ')')"/>
3eb20a0f8ee657eb760b265e48ef3daeaee0bcb1vboxsync </xsl:when>
3eb20a0f8ee657eb760b265e48ef3daeaee0bcb1vboxsync <xsl:when test="($idltype='unsigned long long') or ($idltype='long long')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.unwrapULong(', $value, ')')"/>
3eb20a0f8ee657eb760b265e48ef3daeaee0bcb1vboxsync </xsl:when>
3eb20a0f8ee657eb760b265e48ef3daeaee0bcb1vboxsync <xsl:when test="($idltype='wstring') or ($idltype='uuid')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.unwrapStr(', $value, ')')"/>
3eb20a0f8ee657eb760b265e48ef3daeaee0bcb1vboxsync </xsl:when>
3eb20a0f8ee657eb760b265e48ef3daeaee0bcb1vboxsync <xsl:otherwise>
3eb20a0f8ee657eb760b265e48ef3daeaee0bcb1vboxsync <xsl:value-of select="$value"/>
3eb20a0f8ee657eb760b265e48ef3daeaee0bcb1vboxsync </xsl:otherwise>
3eb20a0f8ee657eb760b265e48ef3daeaee0bcb1vboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="$value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="cookInParamMscom">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="idltype"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="safearray"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="gluetype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="backtype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Back">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="elemgluetype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="$safearray='yes'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="'no'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="forceelem" select="'yes'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//interface[@name=$idltype]">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$safearray='yes'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="elembacktype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Back">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="forceelem" select="'yes'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
0ff08c5f2e716269417677134744967781d0f633vboxsync <!-- Sometimes javac needs a boost of self-confidence regarding
0ff08c5f2e716269417677134744967781d0f633vboxsync varargs calls, and this (Object) cast makes sure that it calls
0ff08c5f2e716269417677134744967781d0f633vboxsync the varargs method - as if there is any other. -->
0ff08c5f2e716269417677134744967781d0f633vboxsync <xsl:value-of select="concat('(Object)Helper.unwrap2(', $elemgluetype, '.class, ', $elembacktype, '.class, ', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('(', $value, ' != null) ? ', $value, '.getTypedWrapped() : null')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$idltype='$unknown'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$safearray='yes'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.unwrap2(', $elemgluetype, '.class, Dispatch.class, ', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('(', $value, ' != null) ? (Dispatch)', $value, '.getWrapped() : null')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="//enum[@name=$idltype]">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$safearray='yes'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.unwrapEnum(', $elemgluetype, '.class, ', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($value, '.value()')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$idltype='boolean'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$safearray='yes'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.unwrapBool(', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('new Variant(', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($idltype='short') or ($idltype='unsigned short')">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$safearray='yes'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.unwrapShort(', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('new Variant(', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($idltype='long') or ($idltype='unsigned long')">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$safearray='yes'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.unwrapInt(', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('new Variant(', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($idltype='wstring') or ($idltype='uuid')">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$safearray='yes'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.unwrapString(', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('new Variant(', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($idltype='unsigned long long') or ($idltype='long long')">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$safearray='yes'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.unwrapLong(', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('new Variant(', $value, '.longValue())')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
43e9610f19620d465c6e0cb5636379466a1f2111vboxsync <xsl:when test="($idltype='octet') and ($safearray='yes')">
0ff08c5f2e716269417677134744967781d0f633vboxsync <xsl:value-of select="$value"/>
43e9610f19620d465c6e0cb5636379466a1f2111vboxsync </xsl:when>
43e9610f19620d465c6e0cb5636379466a1f2111vboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fatalError">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="msg" select="concat('Unhandled type: ', $idltype)" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="cookInParamJaxws">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="idltype"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="safearray"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="isstruct"
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync select="//interface[@name=$idltype]/@wsmap='struct'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="gluetype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="elemgluetype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="$safearray='yes'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="'no'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="forceelem" select="'yes'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="//interface[@name=$idltype] or $idltype='$unknown'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="@safearray='yes'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.unwrap(', $value, ')')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat('((', $value, ' == null) ? null :', $value, '.getWrapped())')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="//enum[@name=$idltype]">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$safearray='yes'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:variable name="elembacktype">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="typeIdl2Back">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="type" select="$idltype" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="safearray" select="'no'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="forceelem" select="'yes'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.convertEnums(', $elemgluetype, '.class, ', $elembacktype, '.class, ', $value, ')')"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:variable name="backtype">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="typeIdl2Back">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="type" select="$idltype" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="safearray" select="'no'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="forceelem" select="'yes'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($backtype, '.fromValue(', $value, '.name())')"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="($idltype='octet') and ($safearray='yes')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.encodeBase64(', $value, ')')"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="$value"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="cookInParam">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="idltype"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="safearray"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($G_vboxGlueStyle='xpcom')">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="cookInParamXpcom">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="value" select="$value" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="idltype" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($G_vboxGlueStyle='mscom')">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="cookInParamMscom">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="value" select="$value" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="idltype" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($G_vboxGlueStyle='jaxws')">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="cookInParamJaxws">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="value" select="$value" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="idltype" select="$idltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fatalError">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="msg" select="'Unhandled style (cookInParam)'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<!-- Invoke backend method, including parameter conversion -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="genBackMethodCall">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="ifname"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="methodname"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="retval"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($G_vboxGlueStyle='xpcom')">
0ff08c5f2e716269417677134744967781d0f633vboxsync <xsl:text> </xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="param[@dir='return']">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat($retval, ' = ')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('getTypedWrapped().', $methodname, '(')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="param">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="@dir='return'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="@safearray='yes'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>null</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="@dir='out'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="@safearray='yes'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>null, </xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('tmp_', @name)" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="@dir='in'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="(@safearray='yes') and not(@type = 'octet')">
a0024ef85137b894c93ac51e2f26b227a393cd4fvboxsync <xsl:value-of select="concat(@name, ' != null ? ', @name, '.size() : 0, ')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:variable name="unwrapped">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="cookInParam">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="value" select="@name" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="idltype" select="@type" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="safearray" select="@safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="$unwrapped"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="fatalError">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="msg" select="concat('Unsupported param dir: ', @dir, '&quot;.')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="not(position()=last()) and not(following-sibling::param[1]/@dir='return' and not(following-sibling::param[1]/@safearray='yes'))">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>, </xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>);&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($G_vboxGlueStyle='mscom')">
0ff08c5f2e716269417677134744967781d0f633vboxsync <xsl:text> </xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="param[@dir='return']">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat($retval, ' = ')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('Helper.invoke(getTypedWrapped(), &quot;', $methodname, '&quot; ')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="param[not(@dir='return')]">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>, </xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="@dir='out'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('tmp_', @name)" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="@dir='in'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:variable name="unwrapped">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="cookInParam">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="value" select="@name" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="idltype" select="@type" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="safearray" select="@safearray" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="$unwrapped"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>);&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="($G_vboxGlueStyle='jaxws')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:variable name="jaxwsmethod">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="makeJaxwsMethod">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="ifname" select="$ifname" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="methodname" select="$methodname" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:variable name="portArg">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="not(//interface[@name=$ifname]/@wsmap='global')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>obj</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:variable name="paramsinout" select="param[@dir='in' or @dir='out']" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> </xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="param[@dir='return'] and not(param[@dir='out'])">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($retval, ' = ')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('port.', $jaxwsmethod, '(', $portArg)" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$paramsinout and not($portArg='')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>, </xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <!-- jax-ws has an oddity: if both out params and a return value exist,
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync then the return value is moved to the function's argument list... -->
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="param[@dir='out'] and param[@dir='return']">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:for-each select="param">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="@dir='return'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="$retval"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="@dir='out'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('tmp_', @name)" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="cookInParam">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="value" select="@name" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="idltype" select="@type" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="safearray" select="@safearray" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="not(position()=last())">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>, </xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:for-each>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:for-each select="$paramsinout">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="@dir='return'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="$retval"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="@dir='out'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('tmp_', @name)" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="cookInParam">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="value" select="@name" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="idltype" select="@type" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="safearray" select="@safearray" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="not(position()=last())">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>, </xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:for-each>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>);&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fatalError">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="msg" select="'Style unknown (genBackMethodCall)'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="genGetterCall">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="ifname"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="gettername"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="backtype"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="retval"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$G_vboxGlueStyle='xpcom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' ', $backtype, ' ', $retval, ' = getTypedWrapped().', $gettername, '(')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="@safearray">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>null</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>);&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$G_vboxGlueStyle='mscom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' ', $backtype, ' ', $retval, ' = Dispatch.get(getTypedWrapped(), &quot;', @name, '&quot;);&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$G_vboxGlueStyle='jaxws'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:variable name="jaxwsGetter">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="makeJaxwsMethod">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="ifname" select="$ifname" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="methodname" select="$gettername" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' ', $backtype, ' ', $retval, ' = port.', $jaxwsGetter, '(obj);&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="fatalError">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="msg" select="'Style unknown (genGetterCall)'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="genSetterCall">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="ifname"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="settername"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="value"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$G_vboxGlueStyle='xpcom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' getTypedWrapped().', $settername, '(', $value, ');&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$G_vboxGlueStyle='mscom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' Dispatch.put(getTypedWrapped(), &quot;', @name, '&quot;, ', $value, ');&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="$G_vboxGlueStyle='jaxws'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="jaxwsSetter">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="makeJaxwsMethod">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="ifname" select="$ifname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="methodname" select="$settername" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' port.', $jaxwsSetter, '(obj, ', $value, ');&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="fatalError">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="msg" select="'Style unknown (genSetterCall)'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="genStructWrapperJaxws">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="ifname"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' private ', $G_virtualBoxPackageCom, '.', $ifname, ' real;&#10;')"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> private VboxPortType port;&#10;&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' public ', $ifname, '(', $G_virtualBoxPackageCom, '.', $ifname, ' real, VboxPortType port)&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> this.real = real;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> this.port = port;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="attribute">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="attrname"><xsl:value-of select="@name" /></xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="attrtype"><xsl:value-of select="@type" /></xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="attrsafearray"><xsl:value-of select="@safearray" /></xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="not(@wsmap = 'suppress')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="not(@readonly = 'yes')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="fatalError">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="msg" select="concat('Non read-only struct (genStructWrapperJaxws) in interface ', $ifname, ', attribute ', $attrname)" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <!-- Emit getter -->
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:variable name="backgettername">
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:choose>
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <!-- Stupid, but backend boolean getters called isFoo(), not getFoo() -->
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:when test="$attrtype = 'boolean'">
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:variable name="capsname">
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:call-template name="capitalize">
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:with-param name="str" select="$attrname" />
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync </xsl:call-template>
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync </xsl:variable>
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:value-of select="concat('is', $capsname)" />
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync </xsl:when>
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:otherwise>
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:call-template name="makeGetterName">
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:with-param name="attrname" select="$attrname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync </xsl:otherwise>
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync </xsl:choose>
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:variable name="gluegettername">
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:call-template name="makeGetterName">
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:with-param name="attrname" select="$attrname" />
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync </xsl:call-template>
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:variable name="gluegettertype">
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:call-template name="typeIdl2Glue">
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:with-param name="type" select="$attrtype" />
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:with-param name="safearray" select="@safearray" />
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync </xsl:call-template>
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:variable name="backgettertype">
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:call-template name="typeIdl2Back">
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:with-param name="type" select="$attrtype" />
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:with-param name="safearray" select="@safearray" />
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync </xsl:call-template>
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:apply-templates select="desc" mode="attribute_get"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' public ', $gluegettertype, ' ', $gluegettername, '()&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' ', $backgettertype, ' retVal = real.', $backgettername, '();&#10;')" />
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:variable name="wrapped">
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:call-template name="cookOutParam">
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:with-param name="value" select="'retVal'" />
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:with-param name="idltype" select="$attrtype" />
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:with-param name="safearray" select="@safearray" />
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync </xsl:call-template>
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' return ', $wrapped, ';&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<!-- Interface method wrapper -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="genMethod">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="ifname"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="methodname"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="(param[@mod='ptr']) or (($G_vboxGlueStyle='jaxws') and (param[@type=($G_setSuppressedInterfaces/@name)]))" >
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:value-of select="concat(' // Skipping method ', $methodname, ' for it has parameters with suppressed types&#10;')" />
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync </xsl:when>
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:when test="($G_vboxGlueStyle='jaxws') and (@wsmap = 'suppress')" >
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:value-of select="concat(' // Skipping method ', $methodname, ' for it is suppressed&#10;')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="hasReturnParms" select="param[@dir='return']" />
5826655a9caff7a94b15ba0f4099a57fd55478f6vboxsync <xsl:variable name="hasOutParms" select="count(param[@dir='out']) > 0" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="returnidltype" select="param[@dir='return']/@type" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="returnidlsafearray" select="param[@dir='return']/@safearray" />
5826655a9caff7a94b15ba0f4099a57fd55478f6vboxsync <xsl:if test="$hasOutParms and not($hasReturnParms) and (string-length(@wsmap) = 0) and (count(param[@dir='out']) = 1)">
4ca6acae59694da4371f55ebc27cb63537b122b2vboxsync <xsl:call-template name="fatalError">
5826655a9caff7a94b15ba0f4099a57fd55478f6vboxsync <xsl:with-param name="msg" select="concat('genMethod: ', $ifname, $hasOutParms, not($hasReturnParms), 'a', string-length(@wsmap) = 0, 'b', @wsmap, (count(param[@dir='out']) = 1), '::', $methodname, ' has exactly one out parameter and no return parameter, this causes trouble with JAX-WS and the out parameter needs to be converted to return')" />
4ca6acae59694da4371f55ebc27cb63537b122b2vboxsync </xsl:call-template>
4ca6acae59694da4371f55ebc27cb63537b122b2vboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="returngluetype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$returnidltype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$returnidltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$returnidlsafearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:text>void</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="retValValue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="(param[@dir='out']) and ($G_vboxGlueStyle='jaxws')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>retVal.value</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>retVal</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="desc" mode="method"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat(' public ', $returngluetype, ' ', $methodname, '(')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="paramsinout" select="param[@dir='in' or @dir='out']" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="exsl:node-set($paramsinout)">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="paramgluetype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="@type" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="@safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="@dir='out'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat('Holder&lt;', $paramgluetype, '&gt; ', @name)" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat($paramgluetype, ' ', @name)" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="not(position()=last())">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>, </xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>)&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="startExcWrapper"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- declare temp out params -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="param[@dir='out']">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="backouttype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Back">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="@type" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="@safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='xpcom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' ', $backouttype, '[] tmp_', @name, ' = (', $backouttype, '[])java.lang.reflect.Array.newInstance(', $backouttype, '.class, 1);&#10;')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='mscom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' Variant tmp_', @name, ' = new Variant();&#10;')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='jaxws'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' javax.xml.ws.Holder&lt;', $backouttype, '&gt; tmp_', @name, ' = new javax.xml.ws.Holder&lt;', $backouttype, '&gt;();&#10;')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fatalError">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="msg" select="'Handle out param (genMethod)'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- declare return param, if any -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="$hasReturnParms">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="backrettype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Back">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$returnidltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$returnidlsafearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="(param[@dir='out']) and ($G_vboxGlueStyle='jaxws')">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat(' javax.xml.ws.Holder&lt;', $backrettype, '&gt;',
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync ' retVal = new javax.xml.ws.Holder&lt;', $backrettype,
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync '&gt;();&#10;')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
0ff08c5f2e716269417677134744967781d0f633vboxsync <xsl:value-of select="concat(' ', $backrettype, ' retVal;&#10;')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- Method call -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="genBackMethodCall">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="ifname" select="$ifname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="methodname" select="$methodname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="retval" select="'retVal'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <!-- return out params -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="param[@dir='out']">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="varval">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='xpcom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('tmp_', @name, '[0]')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='mscom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('tmp_', @name)" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='jaxws'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('tmp_', @name, '.value')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fatalError">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="msg" select="'Style unknown (genMethod, outparam)'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="wrapped">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="cookOutParam">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="value" select="$varval" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="idltype" select="@type" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="@safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' ', @name, '.value = ', $wrapped, ';&#10;')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="$hasReturnParms">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- actual 'return' statement -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="wrapped">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="cookOutParam">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="value" select="$retValValue" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="idltype" select="$returnidltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$returnidlsafearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
0ff08c5f2e716269417677134744967781d0f633vboxsync <xsl:value-of select="concat(' return ', $wrapped, ';&#10;')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="endExcWrapper"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<!-- Callback interface method -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="genCbMethodDecl">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="ifname"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="methodname"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="(param[@mod='ptr'])" >
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:value-of select="concat(' // Skipping method ', $methodname, ' for it has parameters with suppressed types&#10;')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="returnidltype" select="param[@dir='return']/@type" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="returnidlsafearray" select="param[@dir='return']/@safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="returngluetype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$returnidltype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$returnidltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$returnidlsafearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:text>void</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat(' public ', $returngluetype, ' ', $methodname, '(')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="paramsinout" select="param[@dir='in' or @dir='out']" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="exsl:node-set($paramsinout)">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="paramgluetype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="@type" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="@safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="@dir='out'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat('Holder&lt;', $paramgluetype, '&gt; ', @name)" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat($paramgluetype, ' ', @name)" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="not(position()=last())">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:text>, </xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>);&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<!-- queryInterface wrapper -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="genQI">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="ifname"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="uuid" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' public static ', $ifname, ' queryInterface(IUnknown obj)&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='xpcom'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="backtype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Back">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$ifname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
0ff08c5f2e716269417677134744967781d0f633vboxsync <xsl:text> nsISupports nsobj = obj != null ? (nsISupports)obj.getWrapped() : null;&#10;</xsl:text>
0ff08c5f2e716269417677134744967781d0f633vboxsync <xsl:text> if (nsobj == null) return null;&#10;</xsl:text>
0ff08c5f2e716269417677134744967781d0f633vboxsync <xsl:value-of select="concat(' ', $backtype, ' qiobj = Helper.queryInterface(nsobj, &quot;{', $uuid, '}&quot;, ', $backtype, '.class);&#10;')" />
0ff08c5f2e716269417677134744967781d0f633vboxsync <xsl:value-of select="concat(' return qiobj == null ? null : new ', $ifname, '(qiobj);&#10;')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='mscom'">
0ff08c5f2e716269417677134744967781d0f633vboxsync <xsl:value-of select="concat(' return', ' obj == null ? null : new ', $ifname, '((com.jacob.com.Dispatch)obj.getWrapped());&#10;')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='jaxws'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- bad, need to check that we really can be casted to this type -->
0ff08c5f2e716269417677134744967781d0f633vboxsync <xsl:value-of select="concat(' return obj == null ? null : new ', $ifname, '(obj.getWrapped(), obj.getRemoteWSPort());&#10;')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fatalError">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="msg" select="'Style unknown (genQI)'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="genCbMethodImpl">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="ifname"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="methodname"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="(param[@mod='ptr'])" >
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:value-of select="concat(' // Skipping method ', $methodname, ' for it has parameters with suppressed types&#10;')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="hasReturnParms" select="param[@dir='return']" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="returnidltype" select="param[@dir='return']/@type" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="returnidlsafearray" select="param[@dir='return']/@safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="returnbacktype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$returnidltype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Back">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$returnidltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$returnidlsafearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:text>void</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="paramsinout" select="param[@dir='in' or @dir='out']" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='xpcom'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat(' public ', $returnbacktype, ' ', $methodname, '(')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="exsl:node-set($paramsinout)">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="parambacktype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Back">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="@type" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="@safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="@dir='out'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat($parambacktype, '[] ', @name)" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="@safearray">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('long len_', @name, ', ')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat($parambacktype, ' ', @name)" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="not(position()=last())">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:text>, </xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>)&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='mscom'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="capsname">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="capitalize">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="str" select="$methodname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat(' public ', $returnbacktype, ' ', $capsname, '(')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>Variant _args[])&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="exsl:node-set($paramsinout)">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="parambacktype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Back">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="@type" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="@safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' ', $parambacktype, ' ', @name, '=_args[', count(preceding-sibling::param), '];&#10;')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="fatalError">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="msg" select="'Style unknown (genSetterCall)'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- declare temp out params -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="param[@dir='out']">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="glueouttype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="@type" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="@safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat(' Holder&lt;', $glueouttype, '&gt; tmp_', @name, ' = new Holder&lt;', $glueouttype, '&gt;();&#10;')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- declare return param, if any -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="$hasReturnParms">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="gluerettype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$returnidltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$returnidlsafearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat(' ', $gluerettype, ' retVal = &#10;')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- Method call -->
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' sink.', $methodname, '(')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="param[not(@dir='return')]">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="@dir='out'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('tmp_', @name)" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="@dir='in'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:variable name="wrapped">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="cookOutParam">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="value" select="@name" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="idltype" select="@type" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="safearray" select="@safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="$wrapped"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="fatalError">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="msg" select="concat('Unsupported param dir: ', @dir, '&quot;.')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="not(position()=last())">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>, </xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>);&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <!-- return out params -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="param[@dir='out']">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="unwrapped">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="cookInParam">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="value" select="concat('tmp_', @name, '.value')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="idltype" select="@type" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="@safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='xpcom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' ', @name, '[0] = ', $unwrapped, ';&#10;')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='mscom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' _args[', count(preceding-sibling::param), '] = ', $unwrapped, ';&#10;')"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="$hasReturnParms">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- actual 'return' statement -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="unwrapped">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="cookInParam">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="value" select="'retVal'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="idltype" select="$returnidltype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="$returnidlsafearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat(' return ', $unwrapped, ';&#10;')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<!-- Interface method -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="genIfaceWrapper">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="ifname"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="wrappedType">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="wrappedName">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="ifname" select="$ifname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- Constructor -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($G_vboxGlueStyle='jaxws')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' public ', $ifname, '(String wrapped, VboxPortType port)&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
0ff08c5f2e716269417677134744967781d0f633vboxsync <xsl:text> super(wrapped, port);&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($G_vboxGlueStyle='xpcom') or ($G_vboxGlueStyle='mscom')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' public ', $ifname, '(', $wrappedType, ' wrapped)&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
0ff08c5f2e716269417677134744967781d0f633vboxsync <xsl:text> super(wrapped);&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- Typed wrapped object accessor -->
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' public ', $wrappedType, ' getTypedWrapped()&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' return (', $wrappedType, ') getWrapped();&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fatalError">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="msg" select="'Style unknown (root, ctr)'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- Attributes -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="attribute[not(@mod='ptr')]">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="attrname"><xsl:value-of select="@name" /></xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="attrtype"><xsl:value-of select="@type" /></xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="attrsafearray"><xsl:value-of select="@safearray" /></xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="($G_vboxGlueStyle='jaxws') and ($attrtype=($G_setSuppressedInterfaces/@name))">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' // Skipping attribute ', $attrname, ' of suppressed type ', $attrtype, '&#10;&#10;')" />
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync </xsl:when>
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:when test="($G_vboxGlueStyle='jaxws') and (@wsmap = 'suppress')" >
5edfb2f211851bccd7c85602118a64d7b593c628vboxsync <xsl:value-of select="concat(' // Skipping attribute ', $attrname, ' for it is suppressed&#10;')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- emit getter method -->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="desc" mode="attribute_get"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="gettername">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="makeGetterName">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="attrname" select="$attrname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="gluetype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Glue">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$attrtype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="@safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="backtype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Back">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$attrtype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="@safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="wrapped">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="cookOutParam">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="value" select="'retVal'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="idltype" select="$attrtype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="@safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' public ', $gluetype, ' ', $gettername, '()&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="startExcWrapper"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- Actual getter implementation -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="genGetterCall">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="ifname" select="$ifname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="gettername" select="$gettername" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="backtype" select="$backtype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="retval" select="'retVal'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' return ', $wrapped, ';&#10;')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="endExcWrapper"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="not(@readonly = 'yes')">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- emit setter method -->
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:apply-templates select="desc" mode="attribute_set"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="settername"><xsl:call-template name="makeSetterName"><xsl:with-param name="attrname" select="$attrname" /></xsl:call-template></xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="unwrapped">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="cookInParam">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="ifname" select="$ifname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="value" select="'value'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="idltype" select="$attrtype" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="safearray" select="@safearray" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' public void ', $settername, '(', $gluetype, ' value)&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="startExcWrapper"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- Actual setter implementation -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="genSetterCall">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="ifname" select="$ifname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="settername" select="$settername" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="value" select="$unwrapped" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="endExcWrapper"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- emit queryInterface() *to* this class -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="genQI">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="ifname" select="$ifname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="uuid" select="@uuid" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- emit methods -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="method">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="genMethod">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="ifname" select="$ifname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="methodname" select="@name" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="genIface">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="ifname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="filename" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="wsmap" select="@wsmap" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="startFile">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="file" select="$filename" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="package" select="$G_virtualBoxPackage" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>import java.util.List;&#10;&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:apply-templates select="desc" mode="interface"/>
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="($wsmap='struct') and ($G_vboxGlueStyle='jaxws')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('public class ', $ifname, '&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>{&#10;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="genStructWrapperJaxws">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="ifname" select="$ifname" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:variable name="extends" select="//interface[@name=$ifname]/@extends" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:choose>
681bb0bf6e9ab5a590d8afcdf37634e2fc29f595vboxsync <xsl:when test="($extends = '$unknown') or ($extends = '$errorinfo')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('public class ', $ifname, ' extends IUnknown&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>{&#10;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:when test="//interface[@name=$extends]">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('public class ', $ifname, ' extends ', $extends, '&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>{&#10;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:when>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="fatalError">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="msg" select="concat('Interface generation: interface &quot;', $ifname, '&quot; has invalid &quot;extends&quot; value ', $extends, '.')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="genIfaceWrapper">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="ifname" select="$ifname" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:otherwise>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:choose>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <!-- end of class -->
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>}&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:call-template name="endFile">
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync <xsl:with-param name="file" select="$filename" />
1cc3bd5463294790ba54c78fde5313264185e50cvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="genCb">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="ifname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="filename" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:param name="filenameimpl" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="startFile">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="file" select="$filename" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="package" select="$G_virtualBoxPackage" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:text>import java.util.List;&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('public interface ', $ifname, '&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>{&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- emit methods declarations-->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="method">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="genCbMethodDecl">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="ifname" select="$ifname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="methodname" select="@name" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>}&#10;&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="endFile">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="file" select="$filename" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="startFile">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="file" select="$filenameimpl" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="package" select="$G_virtualBoxPackage" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:text>import java.util.List;&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="backtype">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="typeIdl2Back">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="type" select="$ifname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:variable>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- emit glue methods body -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='xpcom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('class ', $ifname, 'Impl extends nsISupportsBase implements ', $backtype, '&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>{&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='mscom'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat('public class ', $ifname, 'Impl&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>{&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:value-of select="concat(' ', $ifname, ' sink;&#10;')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat(' ', $ifname, 'Impl(', $ifname, ' sink)&#10;')" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> {&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> this.sink = sink;&#10;</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text> }&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- emit methods implementations -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="method">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="genCbMethodImpl">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="ifname" select="$ifname" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="methodname" select="@name" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>}&#10;&#10;</xsl:text>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="endFile">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="file" select="$filenameimpl" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="emitHandwritten">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="startFile">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="file" select="'Holder.java'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="package" select="$G_virtualBoxPackage" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text><![CDATA[
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncpublic class Holder<T>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync{
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public T value;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public Holder()
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public Holder(T value)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync this.value = value;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync}
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync]]></xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="endFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'Holder.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="emitHandwrittenXpcom">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="startFile">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="file" select="'IUnknown.java'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="package" select="$G_virtualBoxPackageCom" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text><![CDATA[
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncpublic class IUnknown
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync{
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync private Object obj;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public IUnknown(Object obj)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync this.obj = obj;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public Object getWrapped()
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return this.obj;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public void setWrapped(Object obj)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync this.obj = obj;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync}
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync]]></xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="endFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'IUnknown.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="startFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'Helper.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="package" select="$G_virtualBoxPackageCom" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text><![CDATA[
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.util.List;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.util.ArrayList;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.util.Collections;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.lang.reflect.Array;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.lang.reflect.Constructor;
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsyncimport java.lang.reflect.Method;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.lang.reflect.InvocationTargetException;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsyncpublic class Helper
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync{
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static List<Short> wrap(byte[] values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
d331c1c91fc1c4b9f019b9824e7dd9c2cdf804c0vboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync List<Short> ret = new ArrayList<Short>(values.length);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (short v : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret.add(v);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
dded22569e8673215f1ec87d9efa3aae4333e9e1vboxsync }
dded22569e8673215f1ec87d9efa3aae4333e9e1vboxsync
dded22569e8673215f1ec87d9efa3aae4333e9e1vboxsync public static List<Short> wrap(short[] values)
dded22569e8673215f1ec87d9efa3aae4333e9e1vboxsync {
dded22569e8673215f1ec87d9efa3aae4333e9e1vboxsync if (values == null)
dded22569e8673215f1ec87d9efa3aae4333e9e1vboxsync return null;
dded22569e8673215f1ec87d9efa3aae4333e9e1vboxsync
dded22569e8673215f1ec87d9efa3aae4333e9e1vboxsync List<Short> ret = new ArrayList<Short>(values.length);
dded22569e8673215f1ec87d9efa3aae4333e9e1vboxsync for (short v : values)
dded22569e8673215f1ec87d9efa3aae4333e9e1vboxsync {
dded22569e8673215f1ec87d9efa3aae4333e9e1vboxsync ret.add(v);
dded22569e8673215f1ec87d9efa3aae4333e9e1vboxsync }
dded22569e8673215f1ec87d9efa3aae4333e9e1vboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static List<Integer> wrap(int[] values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync List<Integer> ret = new ArrayList<Integer>(values.length);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (int v : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret.add(v);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static List<Long> wrap(long[] values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync List<Long> ret = new ArrayList<Long>(values.length);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (long v : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync ret.add(v);
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync }
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync return ret;
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync }
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static List<Boolean> wrap(boolean[] values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync return null;
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync List<Boolean> ret = new ArrayList<Boolean>(values.length);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (boolean v: values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret.add(v);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static List<String> wrap(String[] values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
d331c1c91fc1c4b9f019b9824e7dd9c2cdf804c0vboxsync return null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync List<String> ret = new ArrayList<String>(values.length);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (String v : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
d331c1c91fc1c4b9f019b9824e7dd9c2cdf804c0vboxsync ret.add(v);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static <T> List<T> wrap(Class<T> wrapperClass, T[] values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync List<T> ret = new ArrayList<T>(values.length);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (T v : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret.add(v);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync @SuppressWarnings( "unchecked")
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static <T> List<T> wrapEnum(Class<T> wrapperClass, long values[])
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync //// This code is questionable, as it invokes a private constructor
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync //// (all enums only have default constructors), and we don't really
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync //// know what to pass as the name, and the ordinal may or may not
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync //// be sensible, especially if the long was abused as a bitset.
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync //Constructor<T> c = wrapperClass.getDeclaredConstructor(String.class, int.class, int.class);
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync //c.setAccessible(true); // make it callable
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync //List<T> ret = new ArrayList<T>(values.length);
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync //for (long v : values)
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync //{
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync // T convEnum = c.newInstance("unknown", (int)v, (int)v);
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync // ret.add(convEnum);
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync //}
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync // Alternative implementation: use the fromValue method, which is
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync // what the code handling single enums will do. I see no reason to
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync // use the above very ugly hack if there are better alternatives,
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync // which as a bonus complain about unknown values. This variant is
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync // slower, but also orders of magnitude safer.
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync java.lang.reflect.Method fromValue = wrapperClass.getMethod("fromValue", long.class);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync List<T> ret = new ArrayList<T>(values.length);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (long v : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync T convEnum = (T)fromValue.invoke(null, v);
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync ret.add(convEnum);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (NoSuchMethodException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync //catch (InstantiationException e)
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync //{
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync // throw new AssertionError(e);
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync //}
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (IllegalAccessException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InvocationTargetException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static short[] unwrapUShort(List<Short> values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync short[] ret = new short[values.size()];
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync int i = 0;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (short l : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret[i++] = l;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static int[] unwrapInteger(List<Integer> values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync int[] ret = new int[values.size()];
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync int i = 0;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (int l : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret[i++] = l;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static long[] unwrapULong(List<Long> values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync long[] ret = new long[values.size()];
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync int i = 0;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (long l : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret[i++] = l;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static boolean[] unwrapBoolean(List<Boolean> values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync boolean[] ret = new boolean[values.size()];
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync int i = 0;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (boolean l : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret[i++] = l;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static String[] unwrapStr(List<String> values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
d331c1c91fc1c4b9f019b9824e7dd9c2cdf804c0vboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync String[] ret = new String[values.size()];
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync int i = 0;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (String l : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret[i++] = l;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static <T extends Enum <T>> long[] unwrapEnum(Class<T> enumClass, List<T> values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync long result[] = new long[values.size()];
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync java.lang.reflect.Method valueM = enumClass.getMethod("value");
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync int i = 0;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (T v : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync result[i++] = (Integer)valueM.invoke(v);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return result;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (NoSuchMethodException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch(SecurityException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (IllegalAccessException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (IllegalArgumentException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InvocationTargetException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new AssertionError(e);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static <T1, T2> List<T1> wrap2(Class<T1> wrapperClass1, Class<T2> wrapperClass2, T2[] values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
d331c1c91fc1c4b9f019b9824e7dd9c2cdf804c0vboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync Constructor<T1> c = wrapperClass1.getConstructor(wrapperClass2);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync List<T1> ret = new ArrayList<T1>(values.length);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (T2 v : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret.add(c.newInstance(v));
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (NoSuchMethodException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InstantiationException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (IllegalAccessException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InvocationTargetException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1a80aca7d77d410d99549c5c85420d02ba269bdfvboxsync @SuppressWarnings( "unchecked")
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static <T> T[] unwrap(Class<T> wrapperClass, List<T> values)
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values.size() == 0)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return (T[])values.toArray((T[])Array.newInstance(wrapperClass, values.size()));
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1a80aca7d77d410d99549c5c85420d02ba269bdfvboxsync @SuppressWarnings( "unchecked" )
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public static <T> T queryInterface(Object obj, String uuid, Class<T> iface)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return (T)queryInterface(obj, uuid);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public static Object queryInterface(Object obj, String uuid)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync /* Kind of ugly, but does the job of casting */
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync org.mozilla.xpcom.Mozilla moz = org.mozilla.xpcom.Mozilla.getInstance();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync long xpobj = moz.wrapJavaObject(obj, uuid);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return moz.wrapXPCOMObject(xpobj, uuid);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (Exception e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync return null;
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1a80aca7d77d410d99549c5c85420d02ba269bdfvboxsync @SuppressWarnings("unchecked")
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static <T1 extends IUnknown, T2> T2[] unwrap2(Class<T1> wrapperClass1, Class<T2> wrapperClass2, List<T1> values)
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync T2 ret[] = (T2[])Array.newInstance(wrapperClass2, values.size());
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync int i = 0;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (T1 obj : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret[i++] = (T2)obj.getWrapped();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync}
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync]]></xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="endFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'Helper.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="startFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'VBoxException.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="package" select="$G_virtualBoxPackage" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsyncimport org.mozilla.xpcom.*;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsyncpublic class VBoxException extends RuntimeException
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync{
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync private int resultCode;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync private IVirtualBoxErrorInfo errorInfo;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public VBoxException(String message)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync super(message);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync resultCode = -1;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync errorInfo = null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public VBoxException(String message, Throwable cause)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync super(message, cause);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (cause instanceof org.mozilla.xpcom.XPCOMException)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync resultCode = (int)((org.mozilla.xpcom.XPCOMException)cause).errorcode;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync Mozilla mozilla = Mozilla.getInstance();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync nsIServiceManager sm = mozilla.getServiceManager();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync nsIExceptionService es = (nsIExceptionService)sm.getServiceByContractID("@mozilla.org/exceptionservice;1", nsIExceptionService.NS_IEXCEPTIONSERVICE_IID);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync nsIExceptionManager em = es.getCurrentExceptionManager();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync nsIException ex = em.getCurrentException();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync errorInfo = new IVirtualBoxErrorInfo((org.mozilla.interfaces.IVirtualBoxErrorInfo)ex.queryInterface(org.mozilla.interfaces.IVirtualBoxErrorInfo.IVIRTUALBOXERRORINFO_IID));
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (NullPointerException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync e.printStackTrace();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync // nothing we can do
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync errorInfo = null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync else
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync resultCode = -1;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public int getResultCode()
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return resultCode;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public IVirtualBoxErrorInfo getVirtualBoxErrorInfo()
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return errorInfo;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync}
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="endFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'VBoxException.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="startFile">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="file" select="'VirtualBoxManager.java'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="package" select="$G_virtualBoxPackage" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text><![CDATA[
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.io.File;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport org.mozilla.xpcom.*;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport org.mozilla.interfaces.*;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncpublic class VirtualBoxManager
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync{
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync private Mozilla mozilla;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync private IVirtualBox vbox;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync private nsIComponentManager componentManager;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
6f59b7a0773b396658bcd9244a47dfc22a37d679vboxsync private VirtualBoxManager(Mozilla mozilla)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync this.mozilla = mozilla;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync this.componentManager = mozilla.getComponentManager();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync this.vbox = new IVirtualBox((org.mozilla.interfaces.IVirtualBox) this.componentManager
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync .createInstanceByContractID("@virtualbox.org/VirtualBox;1",
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync null,
16b01b3a15e2125e9ffd3ce78c00f8ccb78d81c5vboxsync org.mozilla.interfaces.IVirtualBox.IVIRTUALBOX_IID));
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public void connect(String url, String username, String passwd)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new VBoxException("Connect doesn't make sense for local bindings");
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public void disconnect()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new VBoxException("Disconnect doesn't make sense for local bindings");
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public static void initPerThread()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public static void deinitPerThread()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public IVirtualBox getVBox()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return this.vbox;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public ISession getSessionObject()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return new ISession((org.mozilla.interfaces.ISession) componentManager
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync .createInstanceByContractID("@virtualbox.org/Session;1", null,
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync org.mozilla.interfaces.ISession.ISESSION_IID));
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public ISession openMachineSession(IMachine m) throws Exception
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
194a8ad893b721dfc22ac5f955671f09db015a3fvboxsync ISession s = getSessionObject();
f409459bdd4c15cdb8d7fb6c6d54338cce9ac814vboxsync m.lockMachine(s, LockType.Shared);
194a8ad893b721dfc22ac5f955671f09db015a3fvboxsync return s;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public void closeMachineSession(ISession s)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync if (s != null)
825c2485cf84eec495985ffd605a1c9cddee8c32vboxsync s.unlockMachine();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
3365a35e0dba2c12a9f6d46869d3e6db1668bf24vboxsync private static boolean hasInstance = false;
6f59b7a0773b396658bcd9244a47dfc22a37d679vboxsync private static boolean isMozillaInited = false;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
3365a35e0dba2c12a9f6d46869d3e6db1668bf24vboxsync public static synchronized VirtualBoxManager createInstance(String home)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
3365a35e0dba2c12a9f6d46869d3e6db1668bf24vboxsync if (hasInstance)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new VBoxException("only one instance of VirtualBoxManager at a time allowed");
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (home == null || home.equals(""))
6f59b7a0773b396658bcd9244a47dfc22a37d679vboxsync home = System.getProperty("vbox.home");
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync if (home == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new VBoxException("vbox.home Java property must be defined to use XPCOM bridge");
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync File grePath = new File(home);
6f59b7a0773b396658bcd9244a47dfc22a37d679vboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync Mozilla mozilla = Mozilla.getInstance();
6f59b7a0773b396658bcd9244a47dfc22a37d679vboxsync if (!isMozillaInited)
6f59b7a0773b396658bcd9244a47dfc22a37d679vboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync mozilla.initialize(grePath);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync mozilla.initXPCOM(grePath, null);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync isMozillaInited = true;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (Exception e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync e.printStackTrace();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
3365a35e0dba2c12a9f6d46869d3e6db1668bf24vboxsync hasInstance = true;
3365a35e0dba2c12a9f6d46869d3e6db1668bf24vboxsync
6f59b7a0773b396658bcd9244a47dfc22a37d679vboxsync return new VirtualBoxManager(mozilla);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public IEventListener createListener(Object sink)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return new IEventListener(new EventListenerImpl(sink));
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public void cleanup()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync deinitPerThread();
6f59b7a0773b396658bcd9244a47dfc22a37d679vboxsync // cleanup, we don't do that, as XPCOM bridge doesn't cleanly
6f59b7a0773b396658bcd9244a47dfc22a37d679vboxsync // shuts down, so we prefer to avoid native shutdown
6f59b7a0773b396658bcd9244a47dfc22a37d679vboxsync // mozilla.shutdownXPCOM(null);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync mozilla = null;
3365a35e0dba2c12a9f6d46869d3e6db1668bf24vboxsync hasInstance = false;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public void waitForEvents(long tmo)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync mozilla.waitForEvents(tmo);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync}
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync]]></xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="endFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'VirtualBoxManager.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="startFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'EventListenerImpl.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="package" select="$G_virtualBoxPackage" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text><![CDATA[
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsyncimport org.mozilla.interfaces.*;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsyncpublic class EventListenerImpl extends nsISupportsBase implements org.mozilla.interfaces.IEventListener
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync{
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync private Object obj;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync private java.lang.reflect.Method handleEvent;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync EventListenerImpl(Object obj)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync this.obj = obj;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync this.handleEvent = obj.getClass().getMethod("handleEvent", IEvent.class);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (Exception e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync e.printStackTrace();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public void handleEvent(org.mozilla.interfaces.IEvent ev)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (obj != null && handleEvent != null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync handleEvent.invoke(obj, ev != null ? new IEvent(ev) : null);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (Exception e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync e.printStackTrace();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync}]]></xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="endFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'EventListenerImpl.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="startFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'VBoxObjectBase.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="package" select="$G_virtualBoxPackage" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text><![CDATA[
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncabstract class nsISupportsBase implements org.mozilla.interfaces.nsISupports
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync{
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public org.mozilla.interfaces.nsISupports queryInterface(String iid)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return org.mozilla.xpcom.Mozilla.queryInterface(this, iid);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync}
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync]]></xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="endFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'VBoxObjectBase.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="emitHandwrittenMscom">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="startFile">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="file" select="'IUnknown.java'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="package" select="$G_virtualBoxPackageCom" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text><![CDATA[
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncpublic class IUnknown
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync{
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync private Object obj;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public IUnknown(Object obj)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync this.obj = obj;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public Object getWrapped()
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return this.obj;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public void setWrapped(Object obj)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync this.obj = obj;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync}
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync]]></xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="endFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'IUnknown.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="startFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'Helper.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="package" select="$G_virtualBoxPackageCom" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text><![CDATA[
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.util.List;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.util.ArrayList;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.util.Collections;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.lang.reflect.Array;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.lang.reflect.Constructor;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.lang.reflect.InvocationTargetException;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport com.jacob.com.*;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsyncpublic class Helper
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync{
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static List<Short> wrap(short[] values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync List<Short> ret = new ArrayList<Short>(values.length);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (short v : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret.add(v);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static List<Integer> wrap(int[] values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync List<Integer> ret = new ArrayList<Integer>(values.length);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (int v : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret.add(v);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static List<Long> wrap(long[] values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync List<Long> ret = new ArrayList<Long>(values.length);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (long v : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret.add(v);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static List<String> wrap(String[] values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync List<String> ret = new ArrayList<String>(values.length);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (String v : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret.add(v);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public static <T> T wrapDispatch(Class<T> wrapperClass, Dispatch d)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (d == null || d.m_pDispatch == 0)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync Constructor<T> c = wrapperClass.getConstructor(Dispatch.class);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return (T)c.newInstance(d);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (NoSuchMethodException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InstantiationException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (IllegalAccessException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InvocationTargetException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
a9e87d4a06328e3e87e95e198feaf4c2c8b500d1vboxsync @SuppressWarnings("unchecked")
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public static <T> Object wrapVariant(Class<T> wrapperClass, Variant v)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (v == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync short vt = v.getvt();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync switch (vt)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync case Variant.VariantNull:
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync case Variant.VariantBoolean:
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return v.getBoolean();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync case Variant.VariantByte:
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return v.getByte();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync case Variant.VariantShort:
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return v.getShort();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync case Variant.VariantInt:
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return v.getInt();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync case Variant.VariantLongInt:
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return v.getLong();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync case Variant.VariantString:
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return v.getString();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync case Variant.VariantDispatch:
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return wrapDispatch(wrapperClass, v.getDispatch());
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync default:
0ff08c5f2e716269417677134744967781d0f633vboxsync throw new IllegalArgumentException("unhandled variant type " + vt);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static byte[] wrapBytes(SafeArray sa)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (sa == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync int saLen = sa.getUBound() - sa.getLBound() + 1;
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync byte[] ret = new byte[saLen];
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync int j = 0;
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync for (int i = sa.getLBound(); i <= sa.getUBound(); i++)
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync Variant v = sa.getVariant(i);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync // come up with more effective approach!!!
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret[j++] = v.getByte();
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync }
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync return ret;
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync }
beaf315a706f908c69cdc7e276dd92ee2c6f99acvboxsync
a9e87d4a06328e3e87e95e198feaf4c2c8b500d1vboxsync @SuppressWarnings("unchecked")
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static <T> List<T> wrap(Class<T> wrapperClass, SafeArray sa)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (sa == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync int saLen = sa.getUBound() - sa.getLBound() + 1;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (saLen == 0)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return Collections.emptyList();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync List<T> ret = new ArrayList<T>(saLen);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync for (int i = sa.getLBound(); i <= sa.getUBound(); i++)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync Variant v = sa.getVariant(i);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret.add((T)wrapVariant(wrapperClass, v));
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static <T> List<T> wrapEnum(Class<T> wrapperClass, SafeArray sa)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (sa == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync int saLen = sa.getUBound() - sa.getLBound() + 1;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (saLen == 0)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return Collections.emptyList();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync List<T> ret = new ArrayList<T>(saLen);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync Constructor<T> c = wrapperClass.getConstructor(int.class);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (int i = sa.getLBound(); i <= sa.getUBound(); i++)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync Variant v = sa.getVariant(i);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret.add(c.newInstance(v.getInt()));
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return ret;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (NoSuchMethodException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InstantiationException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (IllegalAccessException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InvocationTargetException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static SafeArray unwrapInt(List<Integer> values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync SafeArray ret = new SafeArray(Variant.VariantInt, values.size());
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync int i = 0;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (int l : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret.setInt(i++, l);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static SafeArray unwrapLong(List<Long> values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync SafeArray ret = new SafeArray(Variant.VariantLongInt, values.size());
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync int i = 0;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (long l : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret.setLong(i++, l);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static SafeArray unwrapBool(List<Boolean> values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync SafeArray result = new SafeArray(Variant.VariantBoolean, values.size());
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync int i = 0;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (boolean l : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync result.setBoolean(i++, l);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return result;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
43e9610f19620d465c6e0cb5636379466a1f2111vboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static SafeArray unwrapBytes(byte[] values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
43e9610f19620d465c6e0cb5636379466a1f2111vboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync SafeArray result = new SafeArray(Variant.VariantByte, values.length);
43e9610f19620d465c6e0cb5636379466a1f2111vboxsync int i = 0;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (byte l : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync result.setByte(i++, l);
43e9610f19620d465c6e0cb5636379466a1f2111vboxsync }
43e9610f19620d465c6e0cb5636379466a1f2111vboxsync return result;
43e9610f19620d465c6e0cb5636379466a1f2111vboxsync }
43e9610f19620d465c6e0cb5636379466a1f2111vboxsync
43e9610f19620d465c6e0cb5636379466a1f2111vboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static <T extends Enum <T>> SafeArray unwrapEnum(Class<T> enumClass, List<T> values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync SafeArray result = new SafeArray(Variant.VariantInt, values.size());
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync java.lang.reflect.Method valueM = enumClass.getMethod("value");
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync int i = 0;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (T v : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync result.setInt(i++, (Integer)valueM.invoke(v));
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return result;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (NoSuchMethodException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch(SecurityException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (IllegalAccessException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (IllegalArgumentException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InvocationTargetException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new AssertionError(e);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static SafeArray unwrapString(List<String> values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync SafeArray result = new SafeArray(Variant.VariantString, values.size());
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync int i = 0;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (String l : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync result.setString(i++, l);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return result;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static <T1, T2> List<T1> wrap2(Class<T1> wrapperClass1, Class<T2> wrapperClass2, T2[] values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values.length == 0)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return Collections.emptyList();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync Constructor<T1> c = wrapperClass1.getConstructor(wrapperClass2);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync List<T1> ret = new ArrayList<T1>(values.length);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (T2 v : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret.add(c.newInstance(v));
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (NoSuchMethodException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InstantiationException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (IllegalAccessException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InvocationTargetException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
a9e87d4a06328e3e87e95e198feaf4c2c8b500d1vboxsync @SuppressWarnings("unchecked")
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static <T> T[] unwrap(Class<T> wrapperClass, List<T> values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return (T[])values.toArray((T[])Array.newInstance(wrapperClass, values.size()));
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
a9e87d4a06328e3e87e95e198feaf4c2c8b500d1vboxsync @SuppressWarnings("unchecked")
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static <T1 extends IUnknown, T2> T2[] unwrap2(Class<T1> wrapperClass1, Class<T2> wrapperClass2, List<T1> values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync T2 ret[] = (T2[])Array.newInstance(wrapperClass2, values.size());
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync int i = 0;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (T1 obj : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret[i++] = (T2)obj.getWrapped();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
fd168522254205059178a7e247606c9159ed2ae3vboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync /* We have very long invoke lists sometimes */
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public static Variant invoke(Dispatch d, String method, Object ... args)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return Dispatch.callN(d, method, args);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync}
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync]]></xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="endFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'Helper.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="startFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'VBoxException.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="package" select="$G_virtualBoxPackage" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsyncpublic class VBoxException extends RuntimeException
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync{
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync private int resultCode;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync private IVirtualBoxErrorInfo errorInfo;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public VBoxException(String message)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync super(message);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync resultCode = -1;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync errorInfo = null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public VBoxException(String message, Throwable cause)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync super(message, cause);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (cause instanceof com.jacob.com.ComException)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync resultCode = ((com.jacob.com.ComException)cause).getHResult();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync // JACOB doesn't support calling GetErrorInfo, which
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync // means there is no way of getting an IErrorInfo reference,
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync // and that means no way of getting to IVirtualBoxErrorInfo.
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync errorInfo = null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync else
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync resultCode = -1;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public int getResultCode()
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return resultCode;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public IVirtualBoxErrorInfo getVirtualBoxErrorInfo()
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return errorInfo;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync}
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="endFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'VBoxException.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="startFile">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="file" select="'VirtualBoxManager.java'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="package" select="$G_virtualBoxPackage" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text><![CDATA[
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport com.jacob.activeX.ActiveXComponent;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport com.jacob.com.ComThread;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport com.jacob.com.Dispatch;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport com.jacob.com.Variant;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport com.jacob.com.SafeArray;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport com.jacob.com.DispatchEvents;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncpublic class VirtualBoxManager
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync{
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync private IVirtualBox vbox;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync private VirtualBoxManager()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync initPerThread();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync vbox = new IVirtualBox(new ActiveXComponent("VirtualBox.VirtualBox"));
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public static void initPerThread()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ComThread.InitMTA();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public static void deinitPerThread()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ComThread.Release();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public void connect(String url, String username, String passwd)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new VBoxException("Connect doesn't make sense for local bindings");
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public void disconnect()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new VBoxException("Disconnect doesn't make sense for local bindings");
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public IVirtualBox getVBox()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return this.vbox;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public ISession getSessionObject()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return new ISession(new ActiveXComponent("VirtualBox.Session"));
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
a9e87d4a06328e3e87e95e198feaf4c2c8b500d1vboxsync public ISession openMachineSession(IMachine m)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync ISession s = getSessionObject();
a9e87d4a06328e3e87e95e198feaf4c2c8b500d1vboxsync m.lockMachine(s, LockType.Shared);
3365a35e0dba2c12a9f6d46869d3e6db1668bf24vboxsync return s;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
3365a35e0dba2c12a9f6d46869d3e6db1668bf24vboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public void closeMachineSession(ISession s)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync if (s != null)
825c2485cf84eec495985ffd605a1c9cddee8c32vboxsync s.unlockMachine();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
3365a35e0dba2c12a9f6d46869d3e6db1668bf24vboxsync private static boolean hasInstance = false;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
3365a35e0dba2c12a9f6d46869d3e6db1668bf24vboxsync public static synchronized VirtualBoxManager createInstance(String home)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
3365a35e0dba2c12a9f6d46869d3e6db1668bf24vboxsync if (hasInstance)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new VBoxException("only one instance of VirtualBoxManager at a time allowed");
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
3365a35e0dba2c12a9f6d46869d3e6db1668bf24vboxsync hasInstance = true;
3365a35e0dba2c12a9f6d46869d3e6db1668bf24vboxsync return new VirtualBoxManager();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public void cleanup()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync deinitPerThread();
3365a35e0dba2c12a9f6d46869d3e6db1668bf24vboxsync hasInstance = false;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public void waitForEvents(long tmo)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync // what to do here?
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync Thread.sleep(tmo);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InterruptedException ie)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync}
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync]]></xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="endFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'VirtualBoxManager.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template name="emitHandwrittenJaxws">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="startFile">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="file" select="'IUnknown.java'" />
8d466f9285d86e81f927c2bf053a2eb7ec325746vboxsync <xsl:with-param name="package" select="$G_virtualBoxPackage" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text><![CDATA[
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncpublic class IUnknown
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync{
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync protected String obj;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync protected final VboxPortType port;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public IUnknown(String obj, VboxPortType port)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync this.obj = obj;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync this.port = port;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public final String getWrapped()
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return this.obj;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public final VboxPortType getRemoteWSPort()
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return this.port;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public synchronized void releaseRemote() throws WebServiceException
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (obj == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync this.port.iManagedObjectRefRelease(obj);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync this.obj = null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InvalidObjectFaultMsg e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new WebServiceException(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (RuntimeFaultMsg e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new WebServiceException(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync}
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync]]></xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="endFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'IUnknown.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="startFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'Helper.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="package" select="$G_virtualBoxPackage" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text><![CDATA[
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.util.List;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.util.ArrayList;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.util.Collections;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.lang.reflect.Array;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.lang.reflect.Constructor;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.lang.reflect.InvocationTargetException;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.math.BigInteger;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsyncpublic class Helper
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync{
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static <T> List<T> wrap(Class<T> wrapperClass, VboxPortType pt, List<String> values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync Constructor<T> c = wrapperClass.getConstructor(String.class, VboxPortType.class);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync List<T> ret = new ArrayList<T>(values.size());
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (String v : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret.add(c.newInstance(v, pt));
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (NoSuchMethodException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InstantiationException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (IllegalAccessException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InvocationTargetException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static <T1, T2> List<T1> wrap2(Class<T1> wrapperClass1, Class<T2> wrapperClass2, VboxPortType pt, List<T2> values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync Constructor<T1> c = wrapperClass1.getConstructor(wrapperClass2, VboxPortType.class);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync List<T1> ret = new ArrayList<T1>(values.size());
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (T2 v : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync ret.add(c.newInstance(v, pt));
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (NoSuchMethodException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InstantiationException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (IllegalAccessException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InvocationTargetException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public static <T extends IUnknown> List<String> unwrap(List<T> values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync List<String> ret = new ArrayList<String>(values.size());
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (T obj : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync ret.add(obj.getWrapped());
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1a80aca7d77d410d99549c5c85420d02ba269bdfvboxsync @SuppressWarnings("unchecked" )
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public static <T1 extends Enum <T1>, T2 extends Enum <T2>> List<T2> convertEnums(Class<T1> fromClass,
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync Class<T2> toClass,
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync List<T1> values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (values == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync List<T2> ret = new ArrayList<T2>(values.size());
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (T1 v : values)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync // Ordinal based enum conversion, as JAX-WS "invents" its own
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync // enum names and has string values with the expected content.
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync int enumOrdinal = v.ordinal();
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync T2 convEnum = toClass.getEnumConstants()[enumOrdinal];
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync ret.add(convEnum);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return ret;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
23a37a06230daf0b33d07268d6ec653e0256eb82vboxsync catch (ArrayIndexOutOfBoundsException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync throw new AssertionError(e);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
f69f2d3ce5811c47ea4d33bccaba5bd77ce685b6vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync /* Pretty naive Base64 encoder/decoder. */
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync private static final char[] valToChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray();
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync private static final int[] charToVal = new int[256];
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
f69f2d3ce5811c47ea4d33bccaba5bd77ce685b6vboxsync /* Initialize recoding alphabet. */
f69f2d3ce5811c47ea4d33bccaba5bd77ce685b6vboxsync static
b55da80ce7c51536e111dfe8a7b6e62b6291fee9vboxsync {
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync for (int i = 0; i < charToVal.length; i++)
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync charToVal[i] = -1;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync for (int i = 0; i < valToChar.length; i++)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync charToVal[valToChar[i]] = i;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
16b01b3a15e2125e9ffd3ce78c00f8ccb78d81c5vboxsync charToVal['='] = 0;
b55da80ce7c51536e111dfe8a7b6e62b6291fee9vboxsync }
fd168522254205059178a7e247606c9159ed2ae3vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync public static String encodeBase64(byte[] data)
fd168522254205059178a7e247606c9159ed2ae3vboxsync {
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync if (data == null)
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync return null;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync if (data.length == 0)
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync return "";
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int fullTriplets = data.length / 3;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int resultLen = ((data.length - 1) / 3 + 1) * 4;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync char[] result = new char[resultLen];
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int dataIndex = 0, stringIndex = 0;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync for (int i = 0; i < fullTriplets; i++)
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync {
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int ch1 = data[dataIndex++] & 0xff;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync result[stringIndex++] = valToChar[ch1 >> 2];
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int ch2 = data[dataIndex++] & 0xff;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync result[stringIndex++] = valToChar[((ch1 << 4) & 0x3f) | (ch2 >> 4)];
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int ch3 = data[dataIndex++] & 0xff;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync result[stringIndex++] = valToChar[((ch2 << 2) & 0x3f) | (ch3 >> 6)];
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync result[stringIndex++] = valToChar[ch3 & 0x3f];
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync }
f69f2d3ce5811c47ea4d33bccaba5bd77ce685b6vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync switch (data.length - dataIndex)
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync {
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync case 0:
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync // do nothing
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync break;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync case 1:
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync {
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int ch1 = data[dataIndex++] & 0xff;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync result[stringIndex++] = valToChar[ch1 >> 2];
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync result[stringIndex++] = valToChar[(ch1 << 4) & 0x3f];
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync result[stringIndex++] = '=';
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync result[stringIndex++] = '=';
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync break;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync }
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync case 2:
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync {
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int ch1 = data[dataIndex++] & 0xff;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync result[stringIndex++] = valToChar[ch1 >> 2];
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int ch2 = data[dataIndex++] & 0xff;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync result[stringIndex++] = valToChar[((ch1 << 4) & 0x3f) | (ch2 >> 4)];
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync result[stringIndex++] = valToChar[(ch2 << 2) & 0x3f];
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync result[stringIndex++] = '=';
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync break;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync }
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync default:
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new VBoxException("bug!");
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync }
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync return new String(result);
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync }
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync private static int skipInvalid(String str, int stringIndex)
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync {
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync while (charToVal[str.charAt(stringIndex)] < 0)
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync stringIndex++;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync return stringIndex;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync }
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync public static byte[] decodeBase64(String str)
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync {
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync if (str == null)
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync return null;
f69f2d3ce5811c47ea4d33bccaba5bd77ce685b6vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int stringLength = str.length();
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync if (stringLength == 0)
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync return new byte[0];
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int validChars = 0, padChars = 0;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync for (int i = 0; i < str.length(); i++)
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync {
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync char ch = str.charAt(i);
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync if (charToVal[ch] >= 0)
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync validChars++;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync if (ch == '=')
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync padChars++;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync }
f69f2d3ce5811c47ea4d33bccaba5bd77ce685b6vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync if ((validChars * 3 % 4) != 0)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new VBoxException("invalid base64 encoded string " + str);
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int resultLength = validChars * 3 / 4 - padChars;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync byte[] result = new byte[resultLength];
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int dataIndex = 0, stringIndex = 0;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int quadraplets = validChars / 4;
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync for (int i = 0; i < quadraplets; i++)
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync {
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync stringIndex = skipInvalid(str, stringIndex);
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int ch1 = str.charAt(stringIndex++);
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync stringIndex = skipInvalid(str, stringIndex);
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int ch2 = str.charAt(stringIndex++);
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync stringIndex = skipInvalid(str, stringIndex);
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int ch3 = str.charAt(stringIndex++);
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync stringIndex = skipInvalid(str, stringIndex);
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync int ch4 = str.charAt(stringIndex++);
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync result[dataIndex++] = (byte)(((charToVal[ch1] << 2) | charToVal[ch2] >> 4) & 0xff);
f69f2d3ce5811c47ea4d33bccaba5bd77ce685b6vboxsync /* we check this to ensure that we don't override data with '=' padding. */
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync if (dataIndex < result.length)
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync result[dataIndex++] = (byte)(((charToVal[ch2] << 4) | charToVal[ch3] >> 2) & 0xff);
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync if (dataIndex < result.length)
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync result[dataIndex++] = (byte)(((charToVal[ch3] << 6) | charToVal[ch4]) & 0xff);
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync }
f69f2d3ce5811c47ea4d33bccaba5bd77ce685b6vboxsync
01cfd051d439d6d1d5f7e5aa3f64d34014254065vboxsync return result;
fd168522254205059178a7e247606c9159ed2ae3vboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync}
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync]]></xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="endFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'Helper.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="startFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'VBoxException.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="package" select="$G_virtualBoxPackage" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsyncpublic class VBoxException extends RuntimeException
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync{
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync private int resultCode;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync private IVirtualBoxErrorInfo errorInfo;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public VBoxException(String message)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync super(message);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync resultCode = -1;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync errorInfo = null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public VBoxException(String message, Throwable cause)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync super(message, cause);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync resultCode = -1;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync errorInfo = null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public VBoxException(String message, Throwable cause, VboxPortType port)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync super(message, cause);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (cause instanceof RuntimeFaultMsg)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync RuntimeFaultMsg m = (RuntimeFaultMsg)cause;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync RuntimeFault f = m.getFaultInfo();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync resultCode = f.getResultCode();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync String retVal = f.getReturnval();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync errorInfo = (retVal.length() > 0) ? new IVirtualBoxErrorInfo(retVal, port) : null;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync else
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync resultCode = -1;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public int getResultCode()
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return resultCode;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public IVirtualBoxErrorInfo getVirtualBoxErrorInfo()
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return errorInfo;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync}
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync</xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="endFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'VBoxException.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="startFile">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="file" select="'VirtualBoxManager.java'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="package" select="$G_virtualBoxPackage" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="$filelistonly=''">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text>import java.net.URL;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.math.BigInteger;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.util.List;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.util.Map;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport java.util.HashMap;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsyncimport java.util.ArrayList;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport javax.xml.namespace.QName;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport javax.xml.ws.BindingProvider;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport javax.xml.ws.Holder;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncimport javax.xml.ws.WebServiceException;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsyncimport java.io.IOException;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsyncimport java.net.UnknownHostException;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsyncimport java.net.Socket;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsyncimport java.net.InetAddress;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsyncimport javax.net.SocketFactory;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsyncimport javax.net.ssl.SSLContext;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsyncimport javax.net.ssl.SSLSocketFactory;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsyncimport javax.net.ssl.SSLSocket;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncclass PortPool
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync{
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync private final static String wsdlFile = </xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="$G_virtualBoxWsdl" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:text><![CDATA[;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync private Map<VboxPortType, Integer> known;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync private boolean initStarted;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync private VboxService svc;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync PortPool(boolean usePreinit)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync known = new HashMap<VboxPortType, Integer>();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync if (usePreinit)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync new Thread(new Runnable()
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync public void run()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync // need to sync on something else but 'this'
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync synchronized (known)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync initStarted = true;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync known.notify();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync preinit();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }).start();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync synchronized (known)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync while (!initStarted)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync known.wait();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InterruptedException e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync break;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync private synchronized void preinit()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync VboxPortType port = getPort();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync releasePort(port);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync synchronized VboxPortType getPort()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync VboxPortType port = null;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync int ttl = 0;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync for (VboxPortType cur: known.keySet())
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync int value = known.get(cur);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync if ((value & 0x10000) == 0)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync port = cur;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync ttl = value & 0xffff;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync break;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync if (port == null)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (svc == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync URL wsdl = PortPool.class.getClassLoader().getResource(wsdlFile);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync if (wsdl == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new LinkageError(wsdlFile + " not found, but it should have been in the jar");
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync svc = new VboxService(wsdl,
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync new QName("http://www.virtualbox.org/Service",
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync "vboxService"));
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync port = svc.getVboxServicePort();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync // reuse this object 0x10 times
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync ttl = 0x10;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync // mark as used
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync known.put(port, new Integer(0x10000 | ttl));
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return port;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync synchronized void releasePort(VboxPortType port)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync Integer val = known.get(port);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync if (val == null || val == 0)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync // know you not
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync int v = val;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync int ttl = v & 0xffff;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync // decrement TTL, and throw away port if used too much times
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync if (--ttl <= 0)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync known.remove(port);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync else
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync v = ttl; // set new TTL and clear busy bit
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync known.put(port, v);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync}
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsyncclass VBoxTLSSocketFactory extends SSLSocketFactory
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync{
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync private final SSLSocketFactory sf;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync private void setupSocket(SSLSocket s)
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync {
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync String[] oldproto = s.getEnabledProtocols();
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync List<String> protolist = new ArrayList<String>();
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync for (int i = 0; i < oldproto.length; i++)
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync if (oldproto[i].toUpperCase().startsWith("TLS"))
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync protolist.add(oldproto[i]);
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync String[] newproto = protolist.toArray(new String[protolist.size()]);
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync s.setEnabledProtocols(newproto);
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync }
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync public VBoxTLSSocketFactory()
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync {
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync SSLSocketFactory tmp = null;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync try
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync {
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync SSLContext sc = SSLContext.getInstance("TLS");
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync sc.init(null, null, null);
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync tmp = sc.getSocketFactory();
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync }
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync catch (Exception e)
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync {
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync e.printStackTrace();
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync }
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync sf = tmp;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync }
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync public static SocketFactory getDefault()
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync {
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync return new VBoxTLSSocketFactory();
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync }
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync public Socket createSocket(Socket socket, String host, int port,
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync boolean autoClose) throws IOException, UnknownHostException
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync {
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync SSLSocket s = (SSLSocket)sf.createSocket(socket, host, port, autoClose);
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync setupSocket(s);
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync return s;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync }
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync public Socket createSocket() throws IOException
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync {
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync SSLSocket s = (SSLSocket)sf.createSocket();
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync setupSocket(s);
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync return s;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync }
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync public Socket createSocket(InetAddress host, int port) throws IOException
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync {
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync SSLSocket s = (SSLSocket)sf.createSocket(host, port);
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync setupSocket(s);
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync return s;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync }
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync public Socket createSocket(InetAddress address, int port,
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync InetAddress localAddress, int localPort) throws IOException
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync {
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync SSLSocket s = (SSLSocket)sf.createSocket(address, port, localAddress, localPort);
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync setupSocket(s);
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync return s;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync }
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync public Socket createSocket(String host, int port) throws IOException, UnknownHostException
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync {
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync SSLSocket s = (SSLSocket)sf.createSocket(host, port);
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync setupSocket(s);
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync return s;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync }
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync public Socket createSocket(String host, int port,
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync InetAddress localHost, int localPort) throws IOException, UnknownHostException
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync {
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync SSLSocket s = (SSLSocket)sf.createSocket(host, port, localHost, localPort);
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync setupSocket(s);
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync return s;
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync }
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync public String[] getDefaultCipherSuites()
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync {
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync return sf.getSupportedCipherSuites();
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync }
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync public String[] getSupportedCipherSuites()
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync {
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync return sf.getSupportedCipherSuites();
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync }
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync}
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsyncpublic class VirtualBoxManager
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync{
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync private static PortPool pool = new PortPool(true);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync protected VboxPortType port;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync private IVirtualBox vbox;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync private VirtualBoxManager()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public static void initPerThread()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public static void deinitPerThread()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public void connect(String url, String username, String passwd)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync this.port = pool.getPort();
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync ((BindingProvider)port).getRequestContext().
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
037ee45764d6c317f2a7dfa2694051100af8005cvboxsync
037ee45764d6c317f2a7dfa2694051100af8005cvboxsync // Unfortunately there is no official way to make JAX-WS use
037ee45764d6c317f2a7dfa2694051100af8005cvboxsync // TLS only, which means that a rather tedious approach is
037ee45764d6c317f2a7dfa2694051100af8005cvboxsync // unavoidable (implementing a TLS only SSLSocketFactory,
037ee45764d6c317f2a7dfa2694051100af8005cvboxsync // because the default one associated with a TLS SSLContext
037ee45764d6c317f2a7dfa2694051100af8005cvboxsync // happily uses SSLv2/3 handshakes, which make TLS servers
037ee45764d6c317f2a7dfa2694051100af8005cvboxsync // drop the connection), and additionally a not standardized,
037ee45764d6c317f2a7dfa2694051100af8005cvboxsync // shotgun approach is needed to make the relevant JAX-WS
037ee45764d6c317f2a7dfa2694051100af8005cvboxsync // implementations use this factory.
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync VBoxTLSSocketFactory sf = new VBoxTLSSocketFactory();
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync ((BindingProvider)port).getRequestContext().
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync put("com.sun.xml.internal.ws.transport.https.client.SSLSocketFactory", sf);
037ee45764d6c317f2a7dfa2694051100af8005cvboxsync ((BindingProvider)port).getRequestContext().
037ee45764d6c317f2a7dfa2694051100af8005cvboxsync put("com.sun.xml.ws.transport.https.client.SSLSocketFactory", sf);
46f6161b99d1818cbcbdda77942fdd3cc5e9f1f8vboxsync
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync String handle = port.iWebsessionManagerLogon(username, passwd);
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync this.vbox = new IVirtualBox(handle, port);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (Throwable t)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (this.port != null && pool != null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync pool.releasePort(this.port);
16b01b3a15e2125e9ffd3ce78c00f8ccb78d81c5vboxsync this.port = null;
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync }
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync // we have to throw smth derived from RuntimeException
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new VBoxException(t.getMessage(), t, this.port);
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public void connect(String url, String username, String passwd,
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync Map<String, Object> requestContext, Map<String, Object> responseContext)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync this.port = pool.getPort();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync ((BindingProvider)port).getRequestContext();
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync if (requestContext != null)
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync ((BindingProvider)port).getRequestContext().putAll(requestContext);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync if (responseContext != null)
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync ((BindingProvider)port).getResponseContext().putAll(responseContext);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync ((BindingProvider)port).getRequestContext().
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync String handle = port.iWebsessionManagerLogon(username, passwd);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync this.vbox = new IVirtualBox(handle, port);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (Throwable t)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (this.port != null && pool != null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync pool.releasePort(this.port);
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync this.port = null;
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync }
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync // we have to throw smth derived from RuntimeException
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new VBoxException(t.getMessage(), t, this.port);
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public void disconnect()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (this.port == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return;
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (this.vbox != null && port != null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync port.iWebsessionManagerLogoff(this.vbox.getWrapped());
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InvalidObjectFaultMsg e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new VBoxException(e.getMessage(), e, this.port);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (RuntimeFaultMsg e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new VBoxException(e.getMessage(), e, this.port);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync finally
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync if (this.port != null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync pool.releasePort(this.port);
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync this.port = null;
c1714e60e5c387bdc336e9dc7881330ba83b1c51vboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public IVirtualBox getVBox()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync return this.vbox;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public ISession getSessionObject()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync if (this.vbox == null)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new VBoxException("connect first");
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync String handle = port.iWebsessionManagerGetSessionObject(this.vbox.getWrapped());
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync return new ISession(handle, port);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (InvalidObjectFaultMsg e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new VBoxException(e.getMessage(), e, this.port);
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch (RuntimeFaultMsg e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new VBoxException(e.getMessage(), e, this.port);
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public ISession openMachineSession(IMachine m) throws Exception
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
194a8ad893b721dfc22ac5f955671f09db015a3fvboxsync ISession s = getSessionObject();
f409459bdd4c15cdb8d7fb6c6d54338cce9ac814vboxsync m.lockMachine(s, LockType.Shared);
194a8ad893b721dfc22ac5f955671f09db015a3fvboxsync return s;
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public void closeMachineSession(ISession s)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync if (s != null)
825c2485cf84eec495985ffd605a1c9cddee8c32vboxsync s.unlockMachine();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
3365a35e0dba2c12a9f6d46869d3e6db1668bf24vboxsync public static synchronized VirtualBoxManager createInstance(String home)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
3365a35e0dba2c12a9f6d46869d3e6db1668bf24vboxsync return new VirtualBoxManager();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public IEventListener createListener(Object sink)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync throw new VBoxException("no active listeners here");
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public void cleanup()
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f42e4f5e90ce3bfaef991ff9e4766781d3be606vboxsync disconnect();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync deinitPerThread();
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync public void waitForEvents(long tmo)
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync {
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync protected void finalize() throws Throwable
1f42e4f5e90ce3bfaef991ff9e4766781d3be606vboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync try
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f42e4f5e90ce3bfaef991ff9e4766781d3be606vboxsync cleanup();
1f42e4f5e90ce3bfaef991ff9e4766781d3be606vboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync catch(Exception e)
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync }
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync finally
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync {
1f42e4f5e90ce3bfaef991ff9e4766781d3be606vboxsync super.finalize();
1f42e4f5e90ce3bfaef991ff9e4766781d3be606vboxsync }
1f42e4f5e90ce3bfaef991ff9e4766781d3be606vboxsync }
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync}
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync]]></xsl:text>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:call-template name="endFile">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:with-param name="file" select="'VirtualBoxManager.java'" />
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync<xsl:template match="/">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:if test="not($G_vboxApiSuffix)">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fatalError">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="msg" select="'G_vboxApiSuffix must be given'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="not($filelistonly='')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="concat($filelistonly, ' := \&#10;')"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- Handwritten files -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="emitHandwritten"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='xpcom'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="emitHandwrittenXpcom"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='mscom'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="emitHandwrittenMscom"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='jaxws'">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="emitHandwrittenJaxws"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="fatalError">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="msg" select="'Style unknown (root)'" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- Enums -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="//enum">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="genEnum">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="enumname" select="@name" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="filename" select="concat(@name, '.java')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- Interfaces -->
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:for-each select="//interface">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="self_target" select="current()/ancestor::if/@target"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:variable name="module" select="current()/ancestor::module/@name"/>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:when test="$G_vboxGlueStyle='jaxws'">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="not($module) and not(@wsmap='suppress')">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="genIface">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="ifname" select="@name" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="filename" select="concat(@name, '.java')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:when>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <!-- We don't need WSDL-specific interfaces here -->
5826655a9caff7a94b15ba0f4099a57fd55478f6vboxsync <xsl:if test="not(@internal='yes') and not($self_target='wsdl') and not($module)">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:call-template name="genIface">
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="ifname" select="@name" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync <xsl:with-param name="filename" select="concat(@name, '.java')" />
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:call-template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:if>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:otherwise>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:choose>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync </xsl:for-each>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:if test="not($filelistonly='')">
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync <xsl:value-of select="'&#10;'"/>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync </xsl:if>
ebb33f3aef3b410579a2865109426b798b9d4a9dvboxsync
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:template>
1f1c37d7ffc2ad3691d79dab619d2198d2d9671avboxsync</xsl:stylesheet>