Changeset 21898 in vbox
- Timestamp:
- Jul 30, 2009 4:39:25 PM (16 years ago)
- Location:
- trunk/src/VBox/Main/webservice
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/webservice/glue-jaxws.xsl
r21819 r21898 113 113 </xsl:when> 114 114 <xsl:when test="//interface[@name=$name]/@wsmap='struct' or //interface[@name=$origname]/@wsmap='struct'"> 115 <xsl:value-of select="concat($G_virtualBoxPackage, concat('.', $name))" />115 <xsl:value-of select="concat($G_virtualBoxPackage2, concat('.', $name))" /> 116 116 </xsl:when> 117 117 <xsl:when test="//interface[@name=$name]"> … … 191 191 </xsl:when> 192 192 <xsl:when test="$type='$unknown'">String</xsl:when> 193 <xsl:when test="//interface[@name=$type]/@wsmap='struct'"> 194 <xsl:value-of select="concat($G_virtualBoxPackage, '.', $type)" /> 195 </xsl:when> 193 196 <xsl:when test="//interface[@name=$type]/@wsmap='managed'">String</xsl:when> 194 197 <xsl:otherwise> … … 210 213 <xsl:param name="idltype"/> 211 214 <xsl:param name="safearray"/> 215 <xsl:variable name="isstruct" 216 select="//interface[@name=$idltype]/@wsmap='struct'" /> 212 217 <xsl:choose> 213 218 <xsl:when test="//collection[@name=$idltype]"> … … 233 238 <xsl:when test="//interface[@name=$idltype] or $idltype='$unknown'"> 234 239 <xsl:choose> 235 <xsl:when test="//interface[@name=$idltype]/@wsmap='struct' and $safearray='yes'">236 <xsl:value-of select="concat('/* 2 */', $value)" />237 </xsl:when>238 <xsl:when test="//interface[@name=$idltype]/@wsmap='struct'">239 <xsl:value-of select="$value" />240 </xsl:when>241 240 <xsl:when test="$safearray='yes'"> 242 241 <xsl:variable name="elemtype"> … … 250 249 </xsl:call-template> 251 250 </xsl:variable> 252 <xsl:value-of select="concat('Helper.wrap(',$elemtype, '.class, port, ', $value,')')"/> 251 <xsl:choose> 252 <xsl:when test="$isstruct"> 253 <xsl:value-of select="concat('Helper.wrap2(',$elemtype, '.class, port, ', $value,')')"/> 254 </xsl:when> 255 <xsl:otherwise> 256 <xsl:value-of select="concat('Helper.wrap(',$elemtype, '.class, port, ', $value,')')"/> 257 </xsl:otherwise> 258 </xsl:choose> 253 259 </xsl:when> 254 260 <xsl:otherwise> … … 262 268 </xsl:call-template> 263 269 </xsl:variable> 264 <!-- if the MOR string is empty, that means NULL, so return NULL instead of an object then --> 265 <xsl:value-of select="concat('(', $value, '.length() > 0) ? new ', $gluetype, '(', $value,', port) : null')" /> 270 <xsl:choose> 271 <xsl:when test="$isstruct"> 272 <xsl:value-of select="concat('(', $value, ' != null) ? new ', $gluetype, '(', $value,', port) : null')" /> 273 </xsl:when> 274 <xsl:otherwise> 275 <!-- if the MOR string is empty, that means NULL, so return NULL instead of an object then --> 276 <xsl:value-of select="concat('(', $value, '.length() > 0) ? new ', $gluetype, '(', $value,', port) : null')" /> 277 </xsl:otherwise> 278 </xsl:choose> 266 279 </xsl:otherwise> 267 280 </xsl:choose> … … 272 285 </xsl:choose> 273 286 </xsl:template> 287 288 <xsl:template name="genStructWrapper"> 289 <xsl:param name="ifname" select="@name" /> 290 291 <xsl:value-of select="concat(' private ', $G_virtualBoxPackage,'.',$ifname, ' real; ')"/> 292 <xsl:value-of select="' private VboxPortType port; '"/> 293 294 <xsl:value-of select="concat(' public ', $ifname, '(', $G_virtualBoxPackage,'.',$ifname,' real, VboxPortType port) { this.real = real; this.port = port; } ')"/> 295 <xsl:for-each select="attribute"> 296 <xsl:variable name="attrname"><xsl:value-of select="@name" /></xsl:variable> 297 <xsl:variable name="attrtype"><xsl:value-of select="@type" /></xsl:variable> 298 <xsl:variable name="attrreadonly"><xsl:value-of select="@readonly" /></xsl:variable> 299 <xsl:variable name="attrsafearray"><xsl:value-of select="@safearray" /></xsl:variable> 300 <xsl:choose> 301 <xsl:when test="$attrreadonly='yes'"> 302 <xsl:value-of select="concat(' // read-only attribute ', $ifname, '::', $attrname, ' of type ', $attrtype, ' ')" /> 303 304 </xsl:when> 305 <xsl:otherwise> 306 <xsl:value-of select="concat(' // read/write attribute ', $ifname, '::', $attrname, ' of type ', $attrtype, ' ')" /> 307 </xsl:otherwise> 308 </xsl:choose> 309 310 <!-- emit getter method --> 311 <xsl:variable name="gettername"> 312 <xsl:choose> 313 <!-- Stupid, but boolean getters called isFoo(), not getFoo() --> 314 <xsl:when test="$attrtype = 'boolean'"> 315 <xsl:variable name="capsname"> 316 <xsl:call-template name="capitalize"> 317 <xsl:with-param name="str" select="$attrname" /> 318 </xsl:call-template> 319 </xsl:variable> 320 <xsl:value-of select="concat('is', $capsname)" /> 321 </xsl:when> 322 <xsl:otherwise> 323 <xsl:call-template name="makeGetterName"> 324 <xsl:with-param name="attrname" select="$attrname" /> 325 </xsl:call-template> 326 </xsl:otherwise> 327 </xsl:choose> 328 </xsl:variable> 329 <xsl:variable name="gluegettertype"> 330 <xsl:call-template name="typeIdl2Glue"> 331 <xsl:with-param name="ifname" select="$ifname" /> 332 <xsl:with-param name="method" select="$gettername" /> 333 <xsl:with-param name="name" select="$attrname" /> 334 <xsl:with-param name="type" select="$attrtype" /> 335 <xsl:with-param name="safearray" select="@safearray" /> 336 </xsl:call-template> 337 </xsl:variable> 338 <xsl:variable name="javagettertype"> 339 <xsl:call-template name="typeIdl2Java"> 340 <xsl:with-param name="ifname" select="$ifname" /> 341 <xsl:with-param name="method" select="$gettername" /> 342 <xsl:with-param name="name" select="$attrname" /> 343 <xsl:with-param name="type" select="$attrtype" /> 344 <xsl:with-param name="safearray" select="@safearray" /> 345 </xsl:call-template> 346 </xsl:variable> 347 <xsl:value-of select="concat(' public ', $gluegettertype, ' ', $gettername, '() { ')" /> 348 <xsl:value-of select="concat(' ', $javagettertype, ' retVal = real.', $gettername, '(); ')" /> 349 <xsl:variable name="wrapped"> 350 <xsl:call-template name="cookOutParam"> 351 <xsl:with-param name="ifname" select="$ifname" /> 352 <xsl:with-param name="method" select="$gettername" /> 353 <xsl:with-param name="value" select="'retVal'" /> 354 <xsl:with-param name="idltype" select="$attrtype" /> 355 <xsl:with-param name="safearray" select="@safearray" /> 356 </xsl:call-template> 357 </xsl:variable> 358 <xsl:value-of select="concat(' return ', $wrapped, '; ')" /> 359 <xsl:text> } </xsl:text> 360 361 </xsl:for-each> 362 363 </xsl:template> 364 274 365 275 366 <xsl:template name="emitArgInMethodImpl"> … … 428 519 } 429 520 521 522 public static <T, T1> List<T> wrap2(Class<T> wrapperClass, VboxPortType pt, List<T1> thisPtrs) { 523 try { 524 if(thisPtrs==null) return Collections.emptyList(); 525 526 Constructor<T> c = wrapperClass.getConstructor(String.class, VboxPortType.class); 527 List<T> ret = new ArrayList<T>(thisPtrs.size()); 528 for (T1 thisPtr : thisPtrs) { 529 ret.add(c.newInstance(thisPtr,pt)); 530 } 531 return ret; 532 } catch (NoSuchMethodException e) { 533 throw new AssertionError(e); 534 } catch (InstantiationException e) { 535 throw new AssertionError(e); 536 } catch (IllegalAccessException e) { 537 throw new AssertionError(e); 538 } catch (InvocationTargetException e) { 539 throw new AssertionError(e); 540 } 541 } 542 430 543 public static <T extends IUnknown> List<String> unwrap(List<T> thisPtrs) { 431 544 if (thisPtrs==null) return Collections.emptyList(); … … 770 883 <xsl:variable name="wscpp" select="@wscpp" /> 771 884 772 <xsl:if test="not($wsmap='suppress') and not ($wsmap='struct') and not($wsmap='global')">885 <xsl:if test="not($wsmap='suppress') and not ($wsmap='global')"> 773 886 <xsl:call-template name="startFile"> 774 887 <xsl:with-param name="file" select="concat($filename, '.java')" /> … … 782 895 <xsl:choose> 783 896 <xsl:when test="$wsmap='struct'"> 784 785 897 <xsl:value-of select="concat('public class ', $ifname, ' { ')" /> 786 898 <xsl:call-template name="genStructWrapper"> 899 <xsl:with-param name="name" select="$ifname" /> 900 </xsl:call-template> 787 901 </xsl:when> 788 902 789 903 <xsl:otherwise> 790 791 904 <xsl:variable name="extends" select="//interface[@name=$ifname]/@extends" /> 792 905 <xsl:choose> -
trunk/src/VBox/Main/webservice/samples/java/jax-ws/clienttest.java
r19245 r21898 31 31 /* Somewhat ugly way to support versioning */ 32 32 import com.sun.xml.ws.commons.virtualbox{VBOX_API_SUFFIX}.*; 33 import org.virtualbox{VBOX_API_SUFFIX}.*;34 33 35 34 import java.util.*; -
trunk/src/VBox/Main/webservice/samples/java/jax-ws/metrictest.java
r18694 r21898 30 30 */ 31 31 import com.sun.xml.ws.commons.virtualbox{VBOX_API_SUFFIX}.*; 32 import org.virtualbox{VBOX_API_SUFFIX}.*;33 32 34 33 import java.util.*;
Note:
See TracChangeset
for help on using the changeset viewer.