glue-java.xsl revision 53382684020a114d11269916b2921d20c9166ac7
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:stylesheet version = '1.0'
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk extension-element-prefixes="exsl">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk XSLT stylesheet that generates Java glue code for XPCOM, MSCOM and JAX-WS from
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk Copyright (C) 2010-2015 Oracle Corporation
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk This file is part of VirtualBox Open Source Edition (OSE), as
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk available from http://www.virtualbox.org. This file is free software;
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk you can redistribute it and/or modify it under the terms of the GNU
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk General Public License (GPL) as published by the Free Software
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk Foundation, in version 2 as it comes in the "COPYING" file of the
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk VirtualBox OSE distribution. VirtualBox OSE is distributed in the
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk method="text"
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk version="1.0"
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk encoding="utf-8"
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk indent="no"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<!-- - - - - - - - - - - - - - - - - - - - - - -
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk global XSLT variables
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk - - - - - - - - - - - - - - - - - - - - - - -->
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:variable name="G_xsltFilename" select="'glue-java.xsl'" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:variable name="G_virtualBoxPackage" select="concat('org.virtualbox', $G_vboxApiSuffix)" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:variable name="G_virtualBoxPackageCom" select="concat('org.virtualbox', $G_vboxApiSuffix, '.', $G_vboxGlueStyle)" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:variable name="G_virtualBoxWsdl" select="concat('"vboxwebService', $G_vboxApiSuffix, '.wsdl"')" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<!-- collect all interfaces with "wsmap='suppress'" in a global variable for quick lookup -->
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:variable name="G_setSuppressedInterfaces"
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk select="//interface[@wsmap='suppress']" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:include href="../idl/typemap-shared.inc.xsl" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:strip-space elements="*"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<!-- - - - - - - - - - - - - - - - - - - - - - -
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk Keys for more efficiently looking up of types.
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk - - - - - - - - - - - - - - - - - - - - - - -->
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:key name="G_keyEnumsByName" match="//enum[@name]" use="@name"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:key name="G_keyInterfacesByName" match="//interface[@name]" use="@name"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<!-- - - - - - - - - - - - - - - - - - - - - - -
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk - - - - - - - - - - - - - - - - - - - - - - -->
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:template name="fileheader">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:param name="name" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:text>/*
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * Copyright (C) 2010-2014 Oracle Corporation
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * This file is part of the VirtualBox SDK, as available from
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * http://www.virtualbox.org. This library is free software; you can
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * redistribute it and/or modify it under the terms of the GNU Lesser General
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * Public License as published by the Free Software Foundation, in version 2.1
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * as it comes in the "COPYING.LIB" file of the VirtualBox SDK distribution.
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * This library is distributed in the hope that it will be useful, but WITHOUT
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * License for more details.
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:value-of select="concat(' * ', $name)"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * DO NOT EDIT! This is a generated file.
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's interface definitions in XML)
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk</xsl:template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:template name="startFile">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:param name="file" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:param name="package" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:choose>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:when test="$filelistonly=''">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:value-of select="concat(' // ##### BEGINFILE "', $G_vboxDirPrefix, $file, '" ')" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="fileheader">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="name" select="$file" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:value-of select="concat('package ', $package, '; ')" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:value-of select="concat('import ', $G_virtualBoxPackageCom, '.*; ')" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:choose>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:when test="$G_vboxGlueStyle='xpcom'">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:text>import org.mozilla.interfaces.*; </xsl:text>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:when test="$G_vboxGlueStyle='mscom'">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:text>import com.jacob.com.*; </xsl:text>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:text>import com.jacob.activeX.ActiveXComponent; </xsl:text>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:when test="$G_vboxGlueStyle='jaxws'">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:text>import javax.xml.ws.*; </xsl:text>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:otherwise>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="fatalError">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="msg" select="'no header rule (startFile)'" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:otherwise>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:choose>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:otherwise>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:value-of select="concat(' \', $G_sNewLine, '	', $G_vboxDirPrefix, $file)"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:otherwise>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:choose>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk</xsl:template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:template name="endFile">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:param name="file" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:if test="$filelistonly=''">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:value-of select="concat(' // ##### ENDFILE "', $file, '" ')" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="xsltprocNewlineOutputHack"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk</xsl:template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<!-- strip-and-normalize-desc
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk Removes leading and trailing white space on each line in the given text.
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:template name="strip-and-normalize-desc">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:param name="text"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <!-- Strip the whole string first so we won't leave trailing new line chars behind. -->
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:variable name="sStrippedText">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="strip-string">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="text" select="$text"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:variable>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:choose>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <!-- If there are multiple lines, strip them one by one on a recursive fasion. -->
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:when test="contains($sStrippedText, ' ')">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="strip-string-right">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="text" select="substring-before($sStrippedText, ' ')"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:value-of select="' '"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="strip-and-normalize-desc-recursive">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="text" select="substring-after($sStrippedText, ' ')"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <!-- Single line, we're done. -->
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:otherwise>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:value-of select="$sStrippedText"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:otherwise>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:choose>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk</xsl:template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<!-- Internal worker for strip-and-normalize-desc, don't use. -->
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:template name="strip-and-normalize-desc-recursive">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:param name="text"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:choose>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <!-- If there are multiple lines, strip them one by one on a recursive fasion. -->
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:when test="contains($text, ' ')">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="strip-string">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="text" select="substring-before($text, ' ')"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:value-of select="' '"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="strip-and-normalize-desc-recursive">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="text" select="substring-after($text, ' ')"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <!-- Single line: Left strip it. -->
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:otherwise>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="strip-string-left">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="text" select="$text"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:otherwise>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:choose>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk</xsl:template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<!-- descriptions -->
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:template match="*/text()">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <!-- TODO: strip out @c/@a for now. long term solution is changing that to a
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk tag in the xidl file, and translate it when generating doxygen etc. -->
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:variable name="rep1">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="string-replace">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="haystack" select="."/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="needle" select="'@c'"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="replacement" select="''"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:variable>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:variable name="rep2">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="string-replace">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="haystack" select="$rep1"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="needle" select="'@a'"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="replacement" select="''"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:variable>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:variable name="rep3">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="string-replace">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="haystack" select="$rep2"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="needle" select="'@todo'"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="replacement" select="'TODO'"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:variable>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <!-- &, < and > must remain as they are or javadoc 8 throws a fit. -->
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:variable name="rep4">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="string-replace">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="haystack" select="$rep3"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="needle" select="'&'"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="replacement" select="'&amp;'"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:variable>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:variable name="rep5">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="string-replace">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="haystack" select="$rep4"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="needle" select="'<'"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="replacement" select="'&lt;'"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:variable>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:variable name="rep6">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="string-replace">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="haystack" select="$rep5"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="needle" select="'>'"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="replacement" select="'&gt;'"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:variable>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:variable name="rep7">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="strip-and-normalize-desc">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="text" select="$rep6"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:variable>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:value-of select="$rep7"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk</xsl:template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * all sub-elements that are not explicitly matched are considered to be
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * html tags and copied w/o modifications
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:template match="desc//*">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:variable name="tagname" select="local-name()"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:value-of select="concat('<', $tagname)"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:if test="$tagname = 'table'"> <!-- javadoc 8 fudge -->
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:text> summary=""</xsl:text>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:text>></xsl:text>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:apply-templates/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:value-of select="concat('</', $tagname, '>')"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk</xsl:template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:template name="emit_refsig">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:param name="context"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:param name="identifier"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:choose>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:when test="key('G_keyEnumsByName', $context)/const[@name=$identifier]">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:value-of select="$identifier"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:when test="key('G_keyInterfacesByName', $context)/method[@name=$identifier]">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:value-of select="$identifier"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:text>(</xsl:text>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:for-each select="key('G_keyInterfacesByName', $context)/method[@name=$identifier]/param">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:if test="@dir!='return'">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:if test="position() > 1">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:text>,</xsl:text>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:choose>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:when test="@dir='out'">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:text>Holder</xsl:text>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:otherwise>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="typeIdl2Glue">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="type" select="@type"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="safearray" select="@safearray"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="skiplisttype" select="'yes'"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:otherwise>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:choose>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:for-each>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:text>)</xsl:text>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:when test="key('G_keyInterfacesByName', $context)/attribute[@name=$identifier]">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="makeGetterName">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="attrname" select="$identifier" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:text>()</xsl:text>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:otherwise>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:call-template name="fatalError">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:with-param name="msg" select="concat('unknown reference destination in @see/@link: context=', $context, ' identifier=', $identifier)" />
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:call-template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:otherwise>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk </xsl:choose>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk</xsl:template>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk<xsl:template match="desc//link">
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:text>{@link </xsl:text>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:apply-templates select="." mode="middle"/>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk <xsl:text>}</xsl:text>
<xsl:with-param name="msg" select="concat('cannot determine context for identifier ', $linktext)" />
<xsl:template match="desc/note">
<xsl:template match="desc/see">
<xsl:template match="desc/see/text()"/>
<xsl:template match="desc/see/link">
<xsl:when test="ancestor::library/result[@name=current()/@name]">
<xsl:apply-templates select="../param/desc/note"/>
<xsl:template match="method/param/desc">
<xsl:text> if (c.value == (int)v) </xsl:text>
<xsl:text> throw new IllegalArgumentException(Long.toString(v)); </xsl:text>
<xsl:text> catch (org.mozilla.xpcom.XPCOMException e) </xsl:text>
<xsl:text> throw new VBoxException(e.getMessage(), e); </xsl:text>
<xsl:text> catch (com.jacob.com.ComException e) </xsl:text>
<xsl:text> throw new VBoxException(e.getMessage(), e); </xsl:text>
<xsl:value-of select="concat('org.mozilla.interfaces.', $ifname)" />
<xsl:text>com.jacob.com.Dispatch</xsl:text>
<xsl:when test="(count(key('G_keyEnumsByName', $name)) > 0) or (count(key('G_keyEnumsByName', $origname)) > 0)">
<xsl:with-param name="msg" select="concat('fullClassName: Type "', $name, '" is not supported.')" />
<!-- look up Java type from IDL type from table array in typemap-shared.inc.xsl -->
<xsl:variable name="javatypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@javaname" />
<xsl:variable name="needarray" select="($safearray='yes' and not($type='octet')) and not($forceelem='yes')" />
<xsl:value-of select="concat('Helper.wrap2(', $elemgluetype, '.class, ', $elembacktype, '.class, ', $value, ')')"/>
<xsl:value-of select="concat('(', $value, ' != null) ? new ', $gluetype, '(', $value, ') : null')" />
<xsl:value-of select="concat('Helper.wrapEnum(', $elemgluetype, '.class, ', $value, ')')"/>
<xsl:value-of select="concat('Helper.wrap(', $value, ')')"/>
<xsl:value-of select="concat('Helper.wrapBytes(', $value, '.toSafeArray())')"/>
<xsl:value-of select="concat('Helper.wrap(', $elemgluetype, '.class, ', $value, '.toSafeArray())')"/>
<xsl:value-of select="concat('Helper.wrapDispatch(', $gluetype, '.class, ', $value, '.getDispatch())')"/>
<xsl:value-of select="concat('Helper.wrap2(', $elemgluetype, '.class, ', $elembacktype, '.class, port, ', $value, ')')"/>
<xsl:value-of select="concat('Helper.convertEnums(', $elembacktype, '.class, ', $elemgluetype, '.class, ', $value, ')')"/>
<xsl:value-of select="concat('Helper.wrap(', $elemgluetype, '.class, port, ', $value, ')')"/>
<xsl:value-of select="concat('Helper.decodeBase64(', $value, ')')"/>
<xsl:value-of select="concat('(', $value, ' != null) ? new ', $gluetype, '(', $value, ', port) : null')" />
<xsl:value-of select="concat('(', $value, '.length() > 0) ? new ', $gluetype, '(', $value, ', port) : null')" />
<xsl:value-of select="concat('Helper.unwrap2(', $elemgluetype, '.class, ', $elembacktype, '.class, ', $value, ')')"/>
<xsl:value-of select="concat('Helper.unwrap2(', $elemgluetype, '.class, nsISupports.class, ', $value, ')')"/>
<xsl:value-of select="concat('(', $value, ' != null) ? (nsISupports)', $value, '.getWrapped() : null')" />
<xsl:value-of select="concat('Helper.unwrapEnum(', $elemgluetype, '.class, ', $value, ')')"/>
<xsl:value-of select="concat('Helper.unwrapBoolean(', $value, ')')"/>
<xsl:value-of select="concat('Helper.unwrapInteger(', $value, ')')"/>
<xsl:value-of select="concat('Helper.unwrapUShort(', $value, ')')"/>
<xsl:value-of select="concat('Helper.unwrapULong(', $value, ')')"/>
<xsl:value-of select="concat('Helper.unwrapStr(', $value, ')')"/>
<xsl:value-of select="concat('(Object)Helper.unwrap2(', $elemgluetype, '.class, ', $elembacktype, '.class, ', $value, ')')"/>
<xsl:value-of select="concat('Helper.unwrap2(', $elemgluetype, '.class, Dispatch.class, ', $value, ')')"/>
<xsl:value-of select="concat('(', $value, ' != null) ? (Dispatch)', $value, '.getWrapped() : null')" />
<xsl:value-of select="concat('Helper.unwrapEnum(', $elemgluetype, '.class, ', $value, ')')"/>
<xsl:value-of select="concat('Helper.unwrapBool(', $value, ')')"/>
<xsl:value-of select="concat('Helper.unwrapShort(', $value, ')')"/>
<xsl:value-of select="concat('Helper.unwrapInt(', $value, ')')"/>
<xsl:value-of select="concat('Helper.unwrapString(', $value, ')')"/>
<xsl:value-of select="concat('Helper.unwrapLong(', $value, ')')"/>
<xsl:value-of select="concat('Helper.unwrap(', $value, ')')"/>
<xsl:value-of select="concat('Helper.convertEnums(', $elemgluetype, '.class, ', $elembacktype, '.class, ', $value, ')')"/>
<xsl:value-of select="concat('Helper.encodeBase64(', $value, ')')"/>
<xsl:if test="not(position()=last()) and not(following-sibling::param[1]/@dir='return' and not(following-sibling::param[1]/@safearray='yes'))">
<xsl:value-of select="concat('Helper.invoke(getTypedWrapped(), "', $methodname, '" ')"/>
<xsl:value-of select="concat(' ', $backtype, ' ', $retval, ' = getTypedWrapped().', $gettername, '(')" />
<xsl:value-of select="concat(' ', $backtype, ' ', $retval, ' = Dispatch.get(getTypedWrapped(), "', @name, '"); ')" />
<xsl:value-of select="concat(' ', $backtype, ' ', $retval, ' = port.', $jaxwsGetter, '(obj); ')" />
<xsl:value-of select="concat(' Dispatch.put(getTypedWrapped(), "', @name, '", ', $value, '); ')" />
<xsl:value-of select="concat(' public ', $ifname, '(', $G_virtualBoxPackageCom, '.', $ifname, ' real, VboxPortType port) ')" />
<xsl:text> this.real = real; </xsl:text>
<xsl:text> this.port = port; </xsl:text>
<xsl:with-param name="msg" select="concat('Non read-only struct (genStructWrapperJaxws) in interface ', $ifname, ', attribute ', $attrname)" />
<xsl:value-of select="concat(' ', $backgettertype, ' retVal = real.', $backgettername, '(); ')" />
<xsl:when test="(param[@mod='ptr']) or (($G_vboxGlueStyle='jaxws') and (param[@type=($G_setSuppressedInterfaces/@name)]))" >
<xsl:value-of select="concat(' // Skipping method ', $methodname, ' for it has parameters with suppressed types ')" />
<xsl:if test="$hasOutParms and not($hasReturnParms) and (string-length(@wsmap) = 0) and (count(param[@dir='out']) = 1)">
<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')" />
<xsl:text>retVal.value</xsl:text>
<xsl:value-of select="concat(' ', $backouttype, '[] tmp_', @name, ' = (', $backouttype, '[])java.lang.reflect.Array.newInstance(', $backouttype, '.class, 1); ')"/>
<xsl:value-of select="concat(' javax.xml.ws.Holder<', $backouttype, '> tmp_', @name, ' = new javax.xml.ws.Holder<', $backouttype, '>(); ')"/>
<xsl:value-of select="concat(' javax.xml.ws.Holder<', $backrettype, '>',
' retVal = new javax.xml.ws.Holder<', $backrettype,
<xsl:value-of select="concat(' // Skipping method ', $methodname, ' for it has parameters with suppressed types ')" />
<xsl:text> nsISupports nsobj = obj != null ? (nsISupports)obj.getWrapped() : null; </xsl:text>
<xsl:value-of select="concat(' ', $backtype, ' qiobj = Helper.queryInterface(nsobj, "{', $uuid, '}", ', $backtype, '.class); ')" />
<xsl:value-of select="concat(' return', ' obj == null ? null : new ', $ifname, '((com.jacob.com.Dispatch)obj.getWrapped()); ')" />
<xsl:value-of select="concat(' return obj == null ? null : new ', $ifname, '(obj.getWrapped(), obj.getRemoteWSPort()); ')" />
<xsl:value-of select="concat(' // Skipping method ', $methodname, ' for it has parameters with suppressed types ')" />
<xsl:value-of select="concat(' ', $parambacktype, ' ', @name, '=_args[', count(preceding-sibling::param), ']; ')" />
<xsl:value-of select="concat(' Holder<', $glueouttype, '> tmp_', @name, ' = new Holder<', $glueouttype, '>(); ')"/>
<xsl:value-of select="concat(' _args[', count(preceding-sibling::param), '] = ', $unwrapped, '; ')"/>
<xsl:value-of select="concat(' // Skipping attribute ', $attrname, ' of suppressed type ', $attrtype, ' ')" />
<xsl:value-of select="concat(' // Skipping attribute ', $attrname, ' for it is suppressed ')" />
<xsl:variable name="settername"><xsl:call-template name="makeSetterName"><xsl:with-param name="attrname" select="$attrname" /></xsl:call-template></xsl:variable>
<xsl:text>import java.util.List; </xsl:text>
<xsl:with-param name="msg" select="concat('Interface generation: interface "', $ifname, '" has invalid "extends" value ', $extends, '.')" />
<xsl:text>import java.util.List; </xsl:text>
<xsl:text>import java.util.List; </xsl:text>
<xsl:value-of select="concat('class ', $ifname, 'Impl extends nsISupportsBase implements ', $backtype, ' ')" />
<xsl:text> this.sink = sink; </xsl:text>
<xsl:with-param name="file" select="'Holder.java'" />
this.value = value;
<xsl:with-param name="file" select="'Holder.java'" />
<xsl:with-param name="file" select="'IUnknown.java'" />
this.obj = obj;
return this.obj;
this.obj = obj;
<xsl:with-param name="file" select="'IUnknown.java'" />
<xsl:with-param name="file" select="'Helper.java'" />
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
List<Short> ret = new ArrayList<Short>(values.length);
ret.add(v);
List<Short> ret = new ArrayList<Short>(values.length);
ret.add(v);
List<Integer> ret = new ArrayList<Integer>(values.length);
ret.add(v);
List<Long> ret = new ArrayList<Long>(values.length);
ret.add(v);
List<Boolean> ret = new ArrayList<Boolean>(values.length);
ret.add(v);
List<String> ret = new ArrayList<String>(values.length);
ret.add(v);
List<T> ret = new ArrayList<T>(values.length);
ret.add(v);
//c.setAccessible(true); // make it callable
//List<T> ret = new ArrayList<T>(values.length);
// T convEnum = c.newInstance("unknown", (int)v, (int)v);
// ret.add(convEnum);
List<T> ret = new ArrayList<T>(values.length);
T convEnum = (T)fromValue.invoke(null, v);
ret.add(convEnum);
short[] ret = new short[values.size()];
int[] ret = new int[values.size()];
long[] ret = new long[values.size()];
boolean[] ret = new boolean[values.size()];
String[] ret = new String[values.size()];
long result[] = new long[values.size()];
result[i++] = (Integer)valueM.invoke(v);
public static <T1, T2> List<T1> wrap2(Class<T1> wrapperClass1, Class<T2> wrapperClass2, T2[] values)
Constructor<T1> c = wrapperClass1.getConstructor(wrapperClass2);
List<T1> ret = new ArrayList<T1>(values.length);
if (values.size() == 0)
long xpobj = moz.wrapJavaObject(obj, uuid);
return moz.wrapXPCOMObject(xpobj, uuid);
public static <T1 extends IUnknown, T2> T2[] unwrap2(Class<T1> wrapperClass1, Class<T2> wrapperClass2, List<T1> values)
ret[i++] = (T2)obj.getWrapped();
<xsl:with-param name="file" select="'Helper.java'" />
<xsl:with-param name="file" select="'VBoxException.java'" />
import org.mozilla.xpcom.*;
if (cause instanceof org.mozilla.xpcom.XPCOMException)
resultCode = (int)((org.mozilla.xpcom.XPCOMException)cause).errorcode;
Mozilla mozilla = Mozilla.getInstance();
nsIServiceManager sm = mozilla.getServiceManager();
nsIExceptionService es = (nsIExceptionService)sm.getServiceByContractID("@mozilla.org/exceptionservice;1", nsIExceptionService.NS_IEXCEPTIONSERVICE_IID);
nsIExceptionManager em = es.getCurrentExceptionManager();
nsIException ex = em.getCurrentException();
errorInfo = new IVirtualBoxErrorInfo((org.mozilla.interfaces.IVirtualBoxErrorInfo)ex.queryInterface(org.mozilla.interfaces.IVirtualBoxErrorInfo.IVIRTUALBOXERRORINFO_IID));
<xsl:with-param name="file" select="'VBoxException.java'" />
<xsl:with-param name="file" select="'VirtualBoxManager.java'" />
import java.io.File;
import org.mozilla.xpcom.*;
import org.mozilla.interfaces.*;
this.mozilla = mozilla;
.createInstanceByContractID("@virtualbox.org/VirtualBox;1",
return this.vbox;
return new ISession((org.mozilla.interfaces.ISession) componentManager
.createInstanceByContractID("@virtualbox.org/Session;1", null,
if (home == null || home.equals(""))
throw new VBoxException("vbox.home Java property must be defined to use XPCOM bridge");
Mozilla mozilla = Mozilla.getInstance();
mozilla.initialize(grePath);
mozilla.initXPCOM(grePath, null);
// mozilla.shutdownXPCOM(null);
mozilla.waitForEvents(tmo);
<xsl:with-param name="file" select="'VirtualBoxManager.java'" />
<xsl:with-param name="file" select="'EventListenerImpl.java'" />
import org.mozilla.interfaces.*;
public class EventListenerImpl extends nsISupportsBase implements org.mozilla.interfaces.IEventListener
private java.lang.reflect.Method handleEvent;
this.obj = obj;
public void handleEvent(org.mozilla.interfaces.IEvent ev)
handleEvent.invoke(obj, ev != null ? new IEvent(ev) : null);
<xsl:with-param name="file" select="'EventListenerImpl.java'" />
<xsl:with-param name="file" select="'VBoxObjectBase.java'" />
abstract class nsISupportsBase implements org.mozilla.interfaces.nsISupports
public org.mozilla.interfaces.nsISupports queryInterface(String iid)
return org.mozilla.xpcom.Mozilla.queryInterface(this, iid);
<xsl:with-param name="file" select="'VBoxObjectBase.java'" />
<xsl:with-param name="file" select="'IUnknown.java'" />
this.obj = obj;
return this.obj;
this.obj = obj;
<xsl:with-param name="file" select="'IUnknown.java'" />
<xsl:with-param name="file" select="'Helper.java'" />
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import com.jacob.com.*;
List<Short> ret = new ArrayList<Short>(values.length);
ret.add(v);
List<Integer> ret = new ArrayList<Integer>(values.length);
ret.add(v);
List<Long> ret = new ArrayList<Long>(values.length);
ret.add(v);
List<String> ret = new ArrayList<String>(values.length);
ret.add(v);
if (d == null || d.m_pDispatch == 0)
return (T)c.newInstance(d);
short vt = v.getvt();
case Variant.VariantNull:
case Variant.VariantBoolean:
return v.getBoolean();
case Variant.VariantByte:
return v.getByte();
case Variant.VariantShort:
return v.getShort();
case Variant.VariantInt:
return v.getInt();
case Variant.VariantLongInt:
return v.getLong();
case Variant.VariantString:
return v.getString();
case Variant.VariantDispatch:
return wrapDispatch(wrapperClass, v.getDispatch());
Variant v = sa.getVariant(i);
ret[j++] = v.getByte();
return Collections.emptyList();
Variant v = sa.getVariant(i);
ret.add((T)wrapVariant(wrapperClass, v));
return Collections.emptyList();
Variant v = sa.getVariant(i);
ret.setInt(i++, l);
ret.setLong(i++, l);
result.setBoolean(i++, l);
result.setByte(i++, l);
result.setString(i++, l);
public static <T1, T2> List<T1> wrap2(Class<T1> wrapperClass1, Class<T2> wrapperClass2, T2[] values)
if (values.length == 0)
return Collections.emptyList();
Constructor<T1> c = wrapperClass1.getConstructor(wrapperClass2);
List<T1> ret = new ArrayList<T1>(values.length);
public static <T1 extends IUnknown, T2> T2[] unwrap2(Class<T1> wrapperClass1, Class<T2> wrapperClass2, List<T1> values)
ret[i++] = (T2)obj.getWrapped();
return Dispatch.callN(d, method, args);
<xsl:with-param name="file" select="'Helper.java'" />
<xsl:with-param name="file" select="'VBoxException.java'" />
if (cause instanceof com.jacob.com.ComException)
resultCode = ((com.jacob.com.ComException)cause).getHResult();
<xsl:with-param name="file" select="'VBoxException.java'" />
<xsl:with-param name="file" select="'VirtualBoxManager.java'" />
import com.jacob.com.ComThread;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
import com.jacob.com.SafeArray;
import com.jacob.com.DispatchEvents;
vbox = new IVirtualBox(new ActiveXComponent("VirtualBox.VirtualBox"));
return this.vbox;
return new ISession(new ActiveXComponent("VirtualBox.Session"));
Thread.sleep(tmo);
<xsl:with-param name="file" select="'VirtualBoxManager.java'" />
<xsl:with-param name="file" select="'IUnknown.java'" />
this.obj = obj;
this.port = port;
return this.obj;
return this.port;
this.obj = null;
<xsl:with-param name="file" select="'IUnknown.java'" />
<xsl:with-param name="file" select="'Helper.java'" />
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.math.BigInteger;
List<T> ret = new ArrayList<T>(values.size());
public static <T1, T2> List<T1> wrap2(Class<T1> wrapperClass1, Class<T2> wrapperClass2, VboxPortType pt, List<T2> values)
List<T1> ret = new ArrayList<T1>(values.size());
List<String> ret = new ArrayList<String>(values.size());
public static <T1 extends Enum <T1>, T2 extends Enum <T2>> List<T2> convertEnums(Class<T1> fromClass,
List<T2> ret = new ArrayList<T2>(values.size());
int enumOrdinal = v.ordinal();
T2 convEnum = toClass.getEnumConstants()[enumOrdinal];
ret.add(convEnum);
/* Pretty naive Base64 encoder/decoder. */
private static final char[] valToChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray();
for (int i = 0; i < charToVal.length; i++)
for (int i = 0; i < valToChar.length; i++)
if (data.length == 0)
int fullTriplets = data.length / 3;
int resultLen = ((data.length - 1) / 3 + 1) * 4;
switch (data.length - dataIndex)
while (charToVal[str.charAt(stringIndex)] < 0)
int stringLength = str.length();
for (int i = 0; i < str.length(); i++)
char ch = str.charAt(i);
int ch1 = str.charAt(stringIndex++);
int ch2 = str.charAt(stringIndex++);
int ch3 = str.charAt(stringIndex++);
int ch4 = str.charAt(stringIndex++);
if (dataIndex < result.length)
if (dataIndex < result.length)
<xsl:with-param name="file" select="'Helper.java'" />
<xsl:with-param name="file" select="'VBoxException.java'" />
RuntimeFault f = m.getFaultInfo();
resultCode = f.getResultCode();
String retVal = f.getReturnval();
errorInfo = (retVal.length() > 0) ? new IVirtualBoxErrorInfo(retVal, port) : null;
<xsl:with-param name="file" select="'VBoxException.java'" />
<xsl:with-param name="file" select="'VirtualBoxManager.java'" />
<xsl:text>import java.net.URL;
import java.math.BigInteger;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.ArrayList;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Holder;
import javax.xml.ws.WebServiceException;
import java.io.IOException;
import java.net.UnknownHostException;
import java.net.Socket;
import java.net.InetAddress;
import javax.net.SocketFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.SSLSocket;
known.notify();
known.wait();
for (VboxPortType cur: known.keySet())
int value = known.get(cur);
URL wsdl = PortPool.class.getClassLoader().getResource(wsdlFile);
new QName("http://www.virtualbox.org/Service",
port = svc.getVboxServicePort();
known.put(port, new Integer(0x10000 | ttl));
Integer val = known.get(port);
known.remove(port);
known.put(port, v);
String[] oldproto = s.getEnabledProtocols();
for (int i = 0; i < oldproto.length; i++)
protolist.add(oldproto[i]);
s.setEnabledProtocols(newproto);
SSLContext sc = SSLContext.getInstance("TLS");
sc.init(null, null, null);
tmp = sc.getSocketFactory();
SSLSocket s = (SSLSocket)sf.createSocket(socket, host, port, autoClose);
SSLSocket s = (SSLSocket)sf.createSocket();
SSLSocket s = (SSLSocket)sf.createSocket(host, port);
SSLSocket s = (SSLSocket)sf.createSocket(address, port, localAddress, localPort);
SSLSocket s = (SSLSocket)sf.createSocket(host, port);
SSLSocket s = (SSLSocket)sf.createSocket(host, port, localHost, localPort);
return sf.getSupportedCipherSuites();
return sf.getSupportedCipherSuites();
put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
String handle = port.iWebsessionManagerLogon(username, passwd);
this.vbox = new IVirtualBox(handle, port);
if (this.port != null && pool != null)
this.port = null;
put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
String handle = port.iWebsessionManagerLogon(username, passwd);
this.vbox = new IVirtualBox(handle, port);
if (this.port != null && pool != null)
this.port = null;
if (this.port == null)
if (this.vbox != null && port != null)
if (this.port != null)
this.port = null;
return this.vbox;
if (this.vbox == null)
<xsl:with-param name="file" select="'VirtualBoxManager.java'" />