Changeset 38796 in vbox for trunk/src/VBox
- Timestamp:
- Sep 19, 2011 5:11:11 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 74091
- Location:
- trunk/src/VBox/Main
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/Makefile.kmk
r38788 r38796 917 917 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \ 918 918 --stringparam G_vboxGlueStyle mscom \ 919 --stringparam G_vboxDirPrefix "" \ 919 920 -o $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $< 920 921 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_JMSCOM_GEN)/java -
trunk/src/VBox/Main/glue/glue-java.xsl
r37457 r38796 11 11 VirtualBox.xidl. 12 12 13 Copyright (C) 2010 Oracle Corporation13 Copyright (C) 2010-2011 Oracle Corporation 14 14 15 15 This file is part of VirtualBox Open Source Edition (OSE), as … … 43 43 <xsl:include href="../webservice/websrv-shared.inc.xsl" /> 44 44 45 <xsl:strip-space elements="*"/> 46 45 47 <xsl:template name="fileheader"> 46 48 <xsl:param name="name" /> 47 <xsl:text>/* *48 * Copyright (C) 2010 Oracle Corporation49 <xsl:text>/* 50 * Copyright (C) 2010-2011 Oracle Corporation 49 51 * 50 52 * This file is part of VirtualBox Open Source Edition (OSE), as … … 72 74 <xsl:param name="package" /> 73 75 74 <xsl:value-of select="concat(' // ##### BEGINFILE "', $ file, '" ')" />76 <xsl:value-of select="concat(' // ##### BEGINFILE "', $G_vboxDirPrefix, $file, '" ')" /> 75 77 <xsl:call-template name="fileheader"> 76 78 <xsl:with-param name="name" select="$file" /> … … 91 93 92 94 <xsl:when test="$G_vboxGlueStyle='jaxws'"> 93 <xsl:value-of select=" 95 <xsl:value-of select="'import javax.xml.ws.*; '" /> 94 96 </xsl:when> 95 97 … … 107 109 </xsl:template> 108 110 111 112 <xsl:template name="string-replace"> 113 <xsl:param name="haystack"/> 114 <xsl:param name="needle"/> 115 <xsl:param name="replacement"/> 116 <xsl:choose> 117 <xsl:when test="contains($haystack,$needle)"> 118 <xsl:value-of select="substring-before($haystack,$needle)"/> 119 <xsl:value-of select="$replacement"/> 120 <xsl:call-template name="string-replace"> 121 <xsl:with-param name="haystack" select="substring-after($haystack,$needle)"/> 122 <xsl:with-param name="needle" select="$needle"/> 123 <xsl:with-param name="replacement" select="$replacement"/> 124 </xsl:call-template> 125 </xsl:when> 126 <xsl:otherwise> 127 <xsl:value-of select="$haystack"/> 128 </xsl:otherwise> 129 </xsl:choose> 130 </xsl:template> 131 132 <!-- descriptions --> 133 134 <xsl:template match="*/text()"> 135 <!-- TODO: strip out @c/@a for now. long term solution is changing that to a 136 tag in the xidl file, and translate it when generating doxygen etc. --> 137 <xsl:variable name="rep1"> 138 <xsl:call-template name="string-replace"> 139 <xsl:with-param name="haystack" select="."/> 140 <xsl:with-param name="needle" select="'@c'"/> 141 <xsl:with-param name="replacement" select="''"/> 142 </xsl:call-template> 143 </xsl:variable> 144 145 <xsl:variable name="rep2"> 146 <xsl:call-template name="string-replace"> 147 <xsl:with-param name="haystack" select="$rep1"/> 148 <xsl:with-param name="needle" select="'@a'"/> 149 <xsl:with-param name="replacement" select="''"/> 150 </xsl:call-template> 151 </xsl:variable> 152 153 <xsl:variable name="rep3"> 154 <xsl:call-template name="string-replace"> 155 <xsl:with-param name="haystack" select="$rep2"/> 156 <xsl:with-param name="needle" select="'@todo'"/> 157 <xsl:with-param name="replacement" select="'TODO'"/> 158 </xsl:call-template> 159 </xsl:variable> 160 161 <xsl:value-of select="$rep3"/> 162 </xsl:template> 163 164 <!-- 165 * all sub-elements that are not explicitly matched are considered to be 166 * html tags and copied w/o modifications 167 --> 168 <xsl:template match="desc//*"> 169 <xsl:variable name="tagname" select="local-name()"/> 170 <xsl:value-of select="concat('<',$tagname,'>')"/> 171 <xsl:apply-templates/> 172 <xsl:value-of select="concat('</',$tagname,'>')"/> 173 </xsl:template> 174 175 <xsl:template name="emit_refsig"> 176 <xsl:param name="context"/> 177 <xsl:param name="identifier"/> 178 179 <xsl:choose> 180 <xsl:when test="//enum[@name=$context]/const[@name=$identifier]"> 181 <xsl:value-of select="$identifier"/> 182 </xsl:when> 183 <xsl:when test="//interface[@name=$context]/method[@name=$identifier]"> 184 <xsl:value-of select="$identifier"/> 185 <xsl:text>(</xsl:text> 186 <xsl:for-each select="//interface[@name=$context]/method[@name=$identifier]/param"> 187 <xsl:if test="@dir!='return'"> 188 <xsl:if test="position() > 1"> 189 <xsl:text>,</xsl:text> 190 </xsl:if> 191 <xsl:choose> 192 <xsl:when test="@dir='out'"> 193 <xsl:text>Holder</xsl:text> 194 </xsl:when> 195 <xsl:otherwise> 196 <xsl:call-template name="typeIdl2Glue"> 197 <xsl:with-param name="type" select="@type"/> 198 <xsl:with-param name="safearray" select="@safearray"/> 199 <xsl:with-param name="skiplisttype" select="'yes'"/> 200 </xsl:call-template> 201 </xsl:otherwise> 202 </xsl:choose> 203 </xsl:if> 204 </xsl:for-each> 205 <xsl:text>)</xsl:text> 206 </xsl:when> 207 <xsl:when test="//interface[@name=$context]/attribute[@name=$identifier]"> 208 <xsl:call-template name="makeGetterName"> 209 <xsl:with-param name="attrname" select="$identifier" /> 210 </xsl:call-template> 211 <xsl:text>()</xsl:text> 212 </xsl:when> 213 <xsl:otherwise> 214 <xsl:call-template name="fatalError"> 215 <xsl:with-param name="msg" select="concat('unknown reference destination in @see/@link: context=',$context,' identifier=',$identifier)" /> 216 </xsl:call-template> 217 </xsl:otherwise> 218 </xsl:choose> 219 </xsl:template> 220 221 <!-- 222 * link 223 --> 224 <xsl:template match="desc//link"> 225 <xsl:text>{@link </xsl:text> 226 <xsl:apply-templates select="." mode="middle"/> 227 <xsl:text>}</xsl:text> 228 </xsl:template> 229 230 <xsl:template match="link" mode="middle"> 231 <xsl:variable name="linktext"> 232 <xsl:value-of select="translate(@to,'_','#')"/> 233 </xsl:variable> 234 <xsl:choose> 235 <xsl:when test="substring($linktext,1,1)='#'"> 236 <xsl:variable name="context"> 237 <xsl:choose> 238 <xsl:when test="local-name(../..)='interface' or local-name(../..)='enum'"> 239 <xsl:value-of select="../../@name"/> 240 </xsl:when> 241 <xsl:when test="local-name(../../..)='interface' or local-name(../../..)='enum'"> 242 <xsl:value-of select="../../../@name"/> 243 </xsl:when> 244 <xsl:when test="local-name(../../../..)='interface' or local-name(../../../..)='enum'"> 245 <xsl:value-of select="../../../../@name"/> 246 </xsl:when> 247 <xsl:when test="local-name(../../../../..)='interface' or local-name(../../../../..)='enum'"> 248 <xsl:value-of select="../../../../../@name"/> 249 </xsl:when> 250 <xsl:when test="local-name(../../../../../..)='interface' or local-name(../../../../../..)='enum'"> 251 <xsl:value-of select="../../../../../../@name"/> 252 </xsl:when> 253 <xsl:otherwise> 254 <xsl:call-template name="fatalError"> 255 <xsl:with-param name="msg" select="concat('cannot determine context for identifier ',$linktext)" /> 256 </xsl:call-template> 257 </xsl:otherwise> 258 </xsl:choose> 259 </xsl:variable> 260 <xsl:variable name="linkname"> 261 <xsl:value-of select="substring($linktext,2)"/> 262 </xsl:variable> 263 <xsl:text>#</xsl:text> 264 <xsl:call-template name="emit_refsig"> 265 <xsl:with-param name="context" select="$context"/> 266 <xsl:with-param name="identifier" select="$linkname"/> 267 </xsl:call-template> 268 </xsl:when> 269 <xsl:when test="contains($linktext,'::')"> 270 <xsl:variable name="context"> 271 <xsl:value-of select="substring-before($linktext,'::')"/> 272 </xsl:variable> 273 <xsl:variable name="linkname"> 274 <xsl:value-of select="substring-after($linktext,'::')"/> 275 </xsl:variable> 276 <xsl:value-of select="concat($G_virtualBoxPackage,'.',$context,'#')"/> 277 <xsl:call-template name="emit_refsig"> 278 <xsl:with-param name="context" select="$context"/> 279 <xsl:with-param name="identifier" select="$linkname"/> 280 </xsl:call-template> 281 </xsl:when> 282 <xsl:otherwise> 283 <xsl:value-of select="concat($G_virtualBoxPackage,'.',$linktext)"/> 284 </xsl:otherwise> 285 </xsl:choose> 286 </xsl:template> 287 <!-- 288 * note 289 --> 290 <xsl:template match="desc/note"> 291 <xsl:if test="not(@internal='yes')"> 292 <xsl:text> NOTE: </xsl:text> 293 <xsl:apply-templates/> 294 <xsl:text> </xsl:text> 295 </xsl:if> 296 </xsl:template> 297 298 <!-- 299 * see 300 --> 301 <xsl:template match="desc/see"> 302 <!-- TODO: quirk in our xidl file: only one <see> tag with <link> nested 303 into it, translate this to multiple @see lines and strip the rest. 304 Should be replaced in the xidl by multiple <see> without nested tag --> 305 <xsl:text> </xsl:text> 306 <xsl:apply-templates match="link"/> 307 </xsl:template> 308 309 <xsl:template match="desc/see/text()"/> 310 311 <xsl:template match="desc/see/link"> 312 <xsl:text>@see </xsl:text> 313 <xsl:apply-templates select="." mode="middle"/> 314 <xsl:text> </xsl:text> 315 </xsl:template> 316 317 <!-- 318 * common comment prologue (handles group IDs) 319 --> 320 <xsl:template match="desc" mode="begin"> 321 <xsl:param name="id" select="@group | preceding::descGroup[1]/@id"/> 322 <xsl:text>/** </xsl:text> 323 <xsl:if test="$id"> 324 <xsl:value-of select="concat(' @ingroup ',$id,' ')"/> 325 </xsl:if> 326 </xsl:template> 327 328 <!-- 329 * common middle part of the comment block 330 --> 331 <xsl:template match="desc" mode="middle"> 332 <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/> 333 <xsl:apply-templates select="note"/> 334 <xsl:apply-templates select="see"/> 335 </xsl:template> 336 337 <!-- 338 * result part of the comment block 339 --> 340 <xsl:template match="desc" mode="results"> 341 <xsl:if test="result"> 342 <xsl:text> Expected result codes: </xsl:text> 343 <xsl:text><table> </xsl:text> 344 <xsl:for-each select="result"> 345 <xsl:text><tr></xsl:text> 346 <xsl:choose> 347 <xsl:when test="ancestor::library/result[@name=current()/@name]"> 348 <xsl:value-of select="concat('<td>@link ::',@name,' ',@name,'</td>')"/> 349 </xsl:when> 350 <xsl:otherwise> 351 <xsl:value-of select="concat('<td>',@name,'</td>')"/> 352 </xsl:otherwise> 353 </xsl:choose> 354 <xsl:text><td></xsl:text> 355 <xsl:apply-templates select="text() | *[not(self::note or self::see or 356 self::result)]"/> 357 <xsl:text></td><tr> </xsl:text> 358 </xsl:for-each> 359 <xsl:text></table> </xsl:text> 360 </xsl:if> 361 </xsl:template> 362 363 <!-- 364 * translates the string to uppercase 365 --> 366 <xsl:template name="uppercase"> 367 <xsl:param name="str" select="."/> 368 <xsl:value-of select=" 369 translate($str,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ') 370 "/> 371 </xsl:template> 372 373 <!-- 374 * comment for interfaces 375 --> 376 <xsl:template match="desc" mode="interface"> 377 <xsl:apply-templates select="." mode="begin"/> 378 <xsl:apply-templates select="." mode="middle"/> 379 <xsl:text> Interface ID: <tt>{</xsl:text> 380 <xsl:call-template name="uppercase"> 381 <xsl:with-param name="str" select="../@uuid"/> 382 </xsl:call-template> 383 <xsl:text>}</tt> */ </xsl:text> 384 </xsl:template> 385 386 <!-- 387 * comment for attribute getters 388 --> 389 <xsl:template match="desc" mode="attribute_get"> 390 <xsl:apply-templates select="." mode="begin"/> 391 <xsl:apply-templates select="text() | *[not(self::note or self::see or self::result)]"/> 392 <xsl:apply-templates select="." mode="results"/> 393 <xsl:apply-templates select="note"/> 394 <xsl:text> @return </xsl:text> 395 <xsl:call-template name="typeIdl2Glue"> 396 <xsl:with-param name="type" select="../@type"/> 397 <xsl:with-param name="safearray" select="../@safearray"/> 398 </xsl:call-template> 399 <xsl:text> </xsl:text> 400 <xsl:apply-templates select="see"/> 401 <xsl:text> */ </xsl:text> 402 </xsl:template> 403 404 <!-- 405 * comment for attribute setters 406 --> 407 <xsl:template match="desc" mode="attribute_set"> 408 <xsl:apply-templates select="." mode="begin"/> 409 <xsl:apply-templates select="text() | *[not(self::note or self::see or self::result)]"/> 410 <xsl:apply-templates select="." mode="results"/> 411 <xsl:apply-templates select="note"/> 412 <xsl:text> @param value </xsl:text> 413 <xsl:call-template name="typeIdl2Glue"> 414 <xsl:with-param name="type" select="../@type"/> 415 <xsl:with-param name="safearray" select="../@safearray"/> 416 </xsl:call-template> 417 <xsl:text> </xsl:text> 418 <xsl:apply-templates select="see"/> 419 <xsl:text> */ </xsl:text> 420 </xsl:template> 421 422 <!-- 423 * comment for methods 424 --> 425 <xsl:template match="desc" mode="method"> 426 <xsl:apply-templates select="." mode="begin"/> 427 <xsl:apply-templates select="text() | *[not(self::note or self::see or self::result)]"/> 428 <xsl:for-each select="../param"> 429 <xsl:apply-templates select="desc"/> 430 </xsl:for-each> 431 <xsl:apply-templates select="." mode="results"/> 432 <xsl:apply-templates select="note"/> 433 <xsl:apply-templates select="../param/desc/note"/> 434 <xsl:apply-templates select="see"/> 435 <xsl:text> */ </xsl:text> 436 </xsl:template> 437 438 <!-- 439 * comment for method parameters 440 --> 441 <xsl:template match="method/param/desc"> 442 <xsl:if test="text() | *[not(self::note or self::see)]"> 443 <xsl:choose> 444 <xsl:when test="../@dir='return'"> 445 <xsl:text> @return </xsl:text> 446 </xsl:when> 447 <xsl:otherwise> 448 <xsl:text> @param </xsl:text> 449 <xsl:value-of select="../@name"/> 450 <xsl:text> </xsl:text> 451 </xsl:otherwise> 452 </xsl:choose> 453 <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/> 454 <xsl:text> </xsl:text> 455 </xsl:if> 456 </xsl:template> 457 458 <!-- 459 * comment for enums 460 --> 461 <xsl:template match="desc" mode="enum"> 462 <xsl:apply-templates select="." mode="begin"/> 463 <xsl:apply-templates select="." mode="middle"/> 464 <xsl:text> Interface ID: <tt>{</xsl:text> 465 <xsl:call-template name="uppercase"> 466 <xsl:with-param name="str" select="../@uuid"/> 467 </xsl:call-template> 468 <xsl:text>}</tt> */ </xsl:text> 469 </xsl:template> 470 471 <!-- 472 * comment for enum values 473 --> 474 <xsl:template match="desc" mode="enum_const"> 475 <xsl:apply-templates select="." mode="begin"/> 476 <xsl:apply-templates select="." mode="middle"/> 477 <xsl:text> */ </xsl:text> 478 </xsl:template> 479 480 <!-- 481 * ignore descGroups by default (processed in /idl) 482 --> 483 <xsl:template match="descGroup"/> 484 485 486 487 <!-- actual code generation --> 488 109 489 <xsl:template name="genEnum"> 110 490 <xsl:param name="enumname" /> … … 116 496 </xsl:call-template> 117 497 498 <xsl:apply-templates select="desc" mode="enum"/> 118 499 <xsl:value-of select="concat('public enum ', $enumname, ' { ')" /> 119 500 <xsl:for-each select="const"> 501 <xsl:apply-templates select="desc" mode="enum_const"/> 120 502 <xsl:variable name="enumconst" select="@name" /> 121 503 <xsl:value-of select="concat(' ', $enumconst, '(', @value, ')')" /> … … 164 546 <xsl:template name="startExcWrapper"> 165 547 166 <xsl:value-of select=" 548 <xsl:value-of select="' try { '" /> 167 549 168 550 </xsl:template> … … 247 629 <xsl:param name="safearray" /> 248 630 <xsl:param name="forceelem" /> 631 <xsl:param name="skiplisttype" /> 249 632 250 633 <xsl:variable name="needarray" select="($safearray='yes') and not($forceelem='yes')" /> … … 252 635 253 636 <xsl:if test="($needlist)"> 254 <xsl:value-of select="'List<'" /> 637 <xsl:value-of select="'List'" /> 638 <xsl:if test="not($skiplisttype='yes')"> 639 <xsl:value-of select="'<'" /> 640 </xsl:if> 255 641 </xsl:if> 256 642 257 <!-- look up Java type from IDL type from table array in websrv-shared.inc.xsl --> 258 <xsl:variable name="javatypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@javaname" /> 259 260 <xsl:choose> 261 <xsl:when test="string-length($javatypefield)"> 262 <xsl:value-of select="$javatypefield" /> 263 </xsl:when> 264 <!-- not a standard type: then it better be one of the types defined in the XIDL --> 265 <xsl:when test="$type='$unknown'">IUnknown</xsl:when> 266 <xsl:otherwise> 267 <xsl:call-template name="fullClassName"> 268 <xsl:with-param name="name" select="$type" /> 269 <xsl:with-param name="collPrefix" select="''"/> 270 </xsl:call-template> 271 </xsl:otherwise> 272 </xsl:choose> 643 <xsl:if test="not($needlist) or not($skiplisttype='yes')"> 644 <!-- look up Java type from IDL type from table array in websrv-shared.inc.xsl --> 645 <xsl:variable name="javatypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@javaname" /> 646 647 <xsl:choose> 648 <xsl:when test="string-length($javatypefield)"> 649 <xsl:value-of select="$javatypefield" /> 650 </xsl:when> 651 <!-- not a standard type: then it better be one of the types defined in the XIDL --> 652 <xsl:when test="$type='$unknown'">IUnknown</xsl:when> 653 <xsl:otherwise> 654 <xsl:call-template name="fullClassName"> 655 <xsl:with-param name="name" select="$type" /> 656 <xsl:with-param name="collPrefix" select="''"/> 657 </xsl:call-template> 658 </xsl:otherwise> 659 </xsl:choose> 660 </xsl:if> 273 661 274 662 <xsl:choose> 275 663 <xsl:when test="($needlist)"> 276 <xsl:value-of select="'>'" /> 664 <xsl:if test="not($skiplisttype='yes')"> 665 <xsl:value-of select="'>'" /> 666 </xsl:if> 277 667 </xsl:when> 278 668 <xsl:when test="($needarray)"> … … 1427 1817 </xsl:choose> 1428 1818 </xsl:variable> 1819 <xsl:apply-templates select="desc" mode="method"/> 1429 1820 <xsl:value-of select="concat(' public ', $returngluetype, ' ', $methodname, '(')" /> 1430 1821 <xsl:variable name="paramsinout" select="param[@dir='in' or @dir='out']" /> … … 1867 2258 <xsl:otherwise> 1868 2259 <!-- emit getter method --> 2260 <xsl:apply-templates select="desc" mode="attribute_get"/> 1869 2261 <xsl:variable name="gettername"> 1870 2262 <xsl:call-template name="makeGetterName"> … … 1909 2301 <xsl:if test="not(@readonly='yes')"> 1910 2302 <!-- emit setter method --> 2303 <xsl:apply-templates select="desc" mode="attribute_set"/> 1911 2304 <xsl:variable name="settername"><xsl:call-template name="makeSetterName"><xsl:with-param name="attrname" select="$attrname" /></xsl:call-template></xsl:variable> 1912 2305 <xsl:variable name="unwrapped"> … … 1962 2355 </xsl:call-template> 1963 2356 1964 <xsl:text>import java.util.List; </xsl:text> 1965 1966 <xsl:choose> 1967 <xsl:when test="($wsmap='struct') and ($G_vboxGlueStyle='jaxws')"> 1968 <xsl:value-of select="concat('public class ', $ifname, ' { ')" /> 1969 <xsl:call-template name="genStructWrapperJaxws"> 1970 <xsl:with-param name="ifname" select="$ifname" /> 2357 <xsl:text>import java.util.List; </xsl:text> 2358 2359 <xsl:apply-templates select="desc" mode="interface"/> 2360 2361 <xsl:choose> 2362 <xsl:when test="($wsmap='struct') and ($G_vboxGlueStyle='jaxws')"> 2363 <xsl:value-of select="concat('public class ', $ifname, ' { ')" /> 2364 <xsl:call-template name="genStructWrapperJaxws"> 2365 <xsl:with-param name="ifname" select="$ifname" /> 2366 </xsl:call-template> 2367 </xsl:when> 2368 2369 <xsl:otherwise> 2370 <xsl:variable name="extends" select="//interface[@name=$ifname]/@extends" /> 2371 <xsl:choose> 2372 <xsl:when test="($extends = '$unknown') or ($extends = '$dispatched') or ($extends = '$errorinfo')"> 2373 <xsl:value-of select="concat('public class ', $ifname, ' extends IUnknown { ')" /> 2374 </xsl:when> 2375 <xsl:when test="//interface[@name=$extends]"> 2376 <xsl:value-of select="concat('public class ', $ifname, ' extends ', $extends, ' { ')" /> 2377 </xsl:when> 2378 <xsl:otherwise> 2379 <xsl:call-template name="fatalError"> 2380 <xsl:with-param name="msg" select="concat('Interface generation: interface "', $ifname, '" has invalid "extends" value ', $extends, '.')" /> 1971 2381 </xsl:call-template> 1972 </xsl:when>1973 1974 <xsl:otherwise>1975 <xsl:variable name="extends" select="//interface[@name=$ifname]/@extends" />1976 <xsl:choose>1977 <xsl:when test="($extends = '$unknown') or ($extends = '$dispatched') or ($extends = '$errorinfo')">1978 <xsl:value-of select="concat('public class ', $ifname, ' extends IUnknown { ')" />1979 </xsl:when>1980 <xsl:when test="//interface[@name=$extends]">1981 <xsl:value-of select="concat('public class ', $ifname, ' extends ', $extends, ' { ')" />1982 </xsl:when>1983 <xsl:otherwise>1984 <xsl:call-template name="fatalError">1985 <xsl:with-param name="msg" select="concat('Interface generation: interface "', $ifname, '" has invalid "extends" value ', $extends, '.')" />1986 </xsl:call-template>1987 </xsl:otherwise>1988 </xsl:choose>1989 <xsl:call-template name="genIfaceWrapper">1990 <xsl:with-param name="ifname" select="$ifname" />1991 </xsl:call-template>1992 2382 </xsl:otherwise> 1993 </xsl:choose> 1994 1995 <!-- end of class --> 1996 <xsl:value-of select="'} '" /> 1997 1998 <xsl:call-template name="endFile"> 1999 <xsl:with-param name="file" select="$filename" /> 2000 </xsl:call-template> 2383 </xsl:choose> 2384 <xsl:call-template name="genIfaceWrapper"> 2385 <xsl:with-param name="ifname" select="$ifname" /> 2386 </xsl:call-template> 2387 </xsl:otherwise> 2388 </xsl:choose> 2389 2390 <!-- end of class --> 2391 <xsl:value-of select="'} '" /> 2392 2393 <xsl:call-template name="endFile"> 2394 <xsl:with-param name="file" select="$filename" /> 2395 </xsl:call-template> 2001 2396 2002 2397 </xsl:template> … … 2076 2471 2077 2472 <xsl:template name="emitHandwritten"> 2078 2079 <xsl:call-template name="startFile">2080 <xsl:with-param name="file" select="'Holder.java'" />2081 <xsl:with-param name="package" select="$G_virtualBoxPackage" />2082 </xsl:call-template>2083 2084 <xsl:text><![CDATA[2085 public class Holder<T>2086 {2087 public T value;2088 2089 public Holder()2090 {2091 }2092 public Holder(T value)2093 {2094 this.value = value;2095 }2096 }2097 ]]></xsl:text>2098 2099 <xsl:call-template name="endFile">2100 <xsl:with-param name="file" select="'Holder.java'" />2101 </xsl:call-template>2102 2473 2103 2474 <xsl:call-template name="startFile"> -
trunk/src/VBox/Main/webservice/Makefile.kmk
r38228 r38796 7 7 8 8 # 9 # Copyright (C) 2006-201 0Oracle Corporation9 # Copyright (C) 2006-2011 Oracle Corporation 10 10 # 11 11 # This file is part of VirtualBox Open Source Edition (OSE), as … … 155 155 PATH_TARGET_WEBTEST := $(VBOXWEB_OUT_DIR)/webtest 156 156 157 # the original XIDL file (has to include documentation as we need it): 158 VBOXWEB_IDL_SRC_ORIG := $(VBOX_XIDL_FILE_SRC) 157 159 # platform-specific XIDL file generated from $(VBOXWEB_IDL_SRC): 158 VBOXWEB_IDL_SRC_ORIG := $(VBOX_XIDL_FILE)159 # the original XIDL file:160 160 VBOXWEB_IDL_SRC := $(VBOXWEB_OUT_DIR)/VirtualBox.xidl 161 161 … … 305 305 # 306 306 VBOX_JWS_JAR = $(VBoxJWs-inst-jar_0_OUTDIR)/vboxjws.jar 307 VBOX_JWSDOC_JAR = $(VBoxJWs-inst-jar_0_OUTDIR)/vboxjws-doc.jar 308 VBOX_JWSSRC_JAR = $(VBoxJWs-inst-jar_0_OUTDIR)/vboxjws-src.jar 307 309 VBOX_JWS_TARGET := $(PATH_TARGET)/vboxjws-gen 308 310 VBOX_JWS_GEN = $(VBOX_JWS_TARGET)/jwsgen 309 311 VBOX_JWS_JDEST := $(VBOX_JWS_TARGET)/jdest 312 VBOX_JWSDOC_JDEST := $(VBOX_JWS_TARGET)/jdest-doc 310 313 VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue 311 314 VBOX_JAXLIB_DIR := $(PATH_ROOT)/src/VBox/Main/webservice/jaxlibs … … 314 317 VBoxJWs-inst-jar_MODE = a+r,u+w 315 318 VBoxJWs-inst-jar_SOURCES = \ 316 $(VBOX_JWS_JAR) 319 $(VBOX_JWS_JAR) \ 320 $(VBOX_JWSDOC_JAR) \ 321 $(VBOX_JWSSRC_JAR) 317 322 VBoxJWs-inst-jar_CLEAN = \ 318 323 $(VBOX_JWS_JAR) \ 324 $(VBOX_JWSDOC_JAR) \ 325 $(VBOX_JWSSRC_JAR) \ 319 326 $(VBOX_JWS_GEN)/jwsglue.list \ 327 $(VBOX_JWSDOC_JDEST)/package-list \ 320 328 $(wildcard \ 321 $(VBOX_JWS_GEN)/java/* .java \322 $(VBOX_JWS_GEN)/java/jws/*/*/*/*.java \329 $(VBOX_JWS_GEN)/java/*/*/*.java \ 330 $(VBOX_JWS_GEN)/java/*/*/*/*.java \ 323 331 $(VBOX_JWS_JDEST)/*.class \ 324 332 $(VBOX_JWS_JDEST)/*/*.class \ 325 333 $(VBOX_JWS_JDEST)/*/*/*.class \ 326 334 $(VBOX_JWS_JDEST)/*/*/*/*.class \ 335 $(VBOX_JWSDOC_JDEST)/*.html \ 336 $(VBOX_JWSDOC_JDEST)/*.css \ 337 $(VBOX_JWSDOC_JDEST)/*/*.gif \ 338 $(VBOX_JWSDOC_JDEST)/*/*/*.html \ 339 $(VBOX_JWSDOC_JDEST)/*/*/*/*.html \ 327 340 ) 328 VBoxJWs-inst-jar_BLDDIRS += $(VBOX_JWS_GEN)/java $(VBOX_JWS_GEN)/java/jws329 330 $(VBOX_JWS_GEN)/jwsglue.list: 331 $(VBOX _XIDL_FILE)\332 333 $(VBOX_FILESPLIT)\341 VBoxJWs-inst-jar_BLDDIRS += $(VBOX_JWS_GEN)/java 342 343 $(VBOX_JWS_GEN)/jwsglue.list: \ 344 $(VBOXWEB_IDL_SRC_ORIG) \ 345 $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \ 346 $(VBOX_FILESPLIT) \ 334 347 $(VBOXWEBSERVICE_WSDL) \ 335 348 $(VBOXWEB_WSDL) \ 336 | $(VBOX_JWS_GEN)/java/jws/349 | $(VBOX_JWS_GEN)/java/ 337 350 $(call MSG_L1,Generating JAX-WS Java glue files from XIDL) 338 $(RM) -f $(wildcard $(VBOX_JWS_GEN)/java/* .java) $(wildcard $(VBOX_JWS_GEN)/java/jws/*/*/*/*.java)351 $(RM) -f $(wildcard $(VBOX_JWS_GEN)/java/*/*/*.java) $(wildcard $(VBOX_JWS_GEN)/java/*/*/*/*.java) 339 352 $(QUIET)$(VBOX_XSLTPROC) \ 340 353 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \ 341 354 --stringparam G_vboxGlueStyle jaxws \ 342 -o $(VBOX_JWS_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $< 343 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JWS_GEN)/java/merged.file $(VBOX_JWS_GEN)/java 355 --stringparam G_vboxDirPrefix org/virtualbox$(VBOX_API_SUFFIX)/ \ 356 -o $(VBOX_JWS_GEN)/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $< 357 $(QUIET)$(MKDIR) -p $(VBOX_JWS_GEN)/java/org/virtualbox$(VBOX_API_SUFFIX) 358 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JWS_GEN)/merged.file $(VBOX_JWS_GEN)/java 344 359 $(call MSG_GENERATE,,$@,JAX-WS for Java 1.6 bindings using $(VBOXWEBSERVICE_WSDL)) 345 $(VBOX_WSIMPORT) -Xnocompile -p $(VBOX_JAVA_PACKAGE).jaxws -d $(VBOX_JWS_GEN)/java /jws$(VBOXWEBSERVICE_WSDL)346 $(QUIET)echo $(VBOX_JWS_GEN)/java/* .java > $@347 $(QUIET)echo $(VBOX_JWS_GEN)/java/ jws/*/*/*/*.java >> $@348 349 $$(VBOX_JWS_JAR): $(VBOX_JWS_GEN)/jwsglue.list $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL) | $$(dir $$@)360 $(VBOX_WSIMPORT) -Xnocompile -p $(VBOX_JAVA_PACKAGE).jaxws -d $(VBOX_JWS_GEN)/java $(VBOXWEBSERVICE_WSDL) 361 $(QUIET)echo $(VBOX_JWS_GEN)/java/*/*/*.java > $@ 362 $(QUIET)echo $(VBOX_JWS_GEN)/java/*/*/*/*.java >> $@ 363 364 $$(VBOX_JWS_JAR): $(VBOX_JWS_GEN)/jwsglue.list $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL) $(VBOX_JWS_GEN)/MANIFEST.MF | $$(dir $$@) 350 365 $(call MSG_TOOL,javac,$(notdir $@),jwsgen.list,) 351 366 $(QUIET)$(RM) -Rf $(VBOX_JWS_JDEST) … … 358 373 $(QUIET)$(CP) -f $(VBOXWEB_WSDL) $(VBOX_JWS_JDEST)/vboxweb$(VBOX_API_SUFFIX).wsdl 359 374 $(call MSG_LINK,$(notdir $@),$@) 360 $(VBOX_JAR) cf $@ -C $(VBOX_JWS_JDEST) . 375 $(VBOX_JAR) cf $@ $(VBOX_JWS_GEN)/MANIFEST.MF -C $(VBOX_JWS_JDEST) . 376 377 $(VBOX_JWS_GEN)/MANIFEST.MF: $(VBOX_PATH_WEBSERVICE)/MANIFEST.MF.in 378 $(QUIET)$(RM) -f -- $@ 379 $(QUIET)$(MKDIR) -p $(VBOX_JWS_GEN) 380 $(QUIET)$(SED) \ 381 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/' \ 382 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/' \ 383 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/' \ 384 -e 's/@VBOX_API_SUFFIX@/$(VBOX_API_SUFFIX)/' \ 385 < $< > $@ 386 387 $$(VBOX_JWSDOC_JAR): $(VBOX_JWS_GEN)/jwsglue.list $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL) $$(VBOX_JWS_JAR) | $$(dir $$@) 388 $(call MSG_TOOL,javadoc,$(notdir $@),jwsgen.list,) 389 $(QUIET)$(RM) -Rf $(VBOX_JWSDOC_JDEST) 390 $(QUIET)$(MKDIR) -p $(VBOX_JWSDOC_JDEST) 391 $(call MSG_L1,Generating javadoc html documentation) 392 $(VBOX_JAVADOC) $(VBOX_JAVADOC_OPTS) -quiet \ 393 @$(VBOX_JWS_GEN)/jwsglue.list \ 394 -d $(VBOX_JWSDOC_JDEST) 395 $(call MSG_LINK,$(notdir $@),$@) 396 $(VBOX_JAR) cf $@ -C $(VBOX_JWSDOC_JDEST) . 397 398 $$(VBOX_JWSSRC_JAR): $$(VBOX_JWS_JAR) | $$(dir $$@) 399 $(call MSG_LINK,$(notdir $@),$@) 400 $(VBOX_JAR) cf $@ -C $(VBOX_JWS_GEN)/java . 361 401 362 402 endif # VBOX_WITH_JWS -
trunk/src/VBox/Main/webservice/platform-xidl.xsl
r33540 r38796 9 9 sections are resolved (for easier processing). 10 10 11 Copyright (C) 2006-201 0Oracle Corporation11 Copyright (C) 2006-2011 Oracle Corporation 12 12 13 13 This file is part of VirtualBox Open Source Edition (OSE), as … … 62 62 ignore everything we don't need 63 63 --> 64 <xsl:template match="cpp|class|enumerator |desc|note">64 <xsl:template match="cpp|class|enumerator"> 65 65 </xsl:template> 66 66 67 67 <!-- 68 68 and keep the rest intact (including all attributes) 69 70 NOTE: this drops class and everything in it, which I left unchanged 71 since the other xslt scripts blow up badly. 69 72 --> 70 <xsl:template match="library|module|enum|const|interface|attribute|collection|method|param ">73 <xsl:template match="library|module|enum|const|interface|attribute|collection|method|param|result"> 71 74 <xsl:copy><xsl:copy-of select="@*"/><xsl:apply-templates/></xsl:copy> 75 </xsl:template> 76 77 <!-- 78 keep those completely unchanged, including child nodes (including all 79 attributes) 80 --> 81 <xsl:template match="descGroup|desc|note"> 82 <xsl:copy-of select="."/> 72 83 </xsl:template> 73 84
Note:
See TracChangeset
for help on using the changeset viewer.