- Timestamp:
- Jul 27, 2009 3:59:56 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 50433
- Location:
- trunk/src/VBox/Main/webservice
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/webservice/glue-jaxws.xsl
r21783 r21819 211 211 <xsl:param name="safearray"/> 212 212 <xsl:choose> 213 <xsl:when test="$idltype='uuid'">214 <xsl:choose>215 <xsl:when test="$safearray">216 <xsl:value-of select="concat('Helper.uuidWrap(',$value,')')" />217 </xsl:when>218 <xsl:otherwise>219 <xsl:value-of select="concat('UUID.fromString(',$value,')')" />220 </xsl:otherwise>221 </xsl:choose>222 </xsl:when>223 213 <xsl:when test="//collection[@name=$idltype]"> 224 214 <xsl:variable name="elemtype"> … … 305 295 </xsl:choose> 306 296 </xsl:when> 307 <xsl:when test="$paramtype='uuid'">308 <xsl:value-of select="concat($paramname, '.toString()')" />309 </xsl:when>310 297 <xsl:otherwise> 311 298 <xsl:value-of select="$paramname" /> … … 416 403 import java.util.ArrayList; 417 404 import java.util.Collections; 418 import java.util.UUID;419 405 import java.lang.reflect.Constructor; 420 406 import java.lang.reflect.InvocationTargetException; … … 442 428 } 443 429 444 public static List<UUID> uuidWrap(List<String> uuidVals) {445 List<UUID> ret = new ArrayList<UUID>(uuidVals.size());446 for (String uuid : uuidVals) {447 ret.add(UUID.fromString(uuid));448 }449 return ret;450 }451 452 430 public static <T extends IUnknown> List<String> unwrap(List<T> thisPtrs) { 453 431 if (thisPtrs==null) return Collections.emptyList(); … … 476 454 import java.util.Map; 477 455 import java.util.HashMap; 478 import java.util.UUID;479 456 import javax.xml.namespace.QName; 480 457 import javax.xml.ws.BindingProvider; … … 800 777 <xsl:text>import java.math.BigInteger; </xsl:text> 801 778 <xsl:text>import java.util.List; </xsl:text> 802 <xsl:text>import java.util.UUID; </xsl:text>803 779 <xsl:text>import javax.xml.ws.Holder; </xsl:text> 804 780 <xsl:text>import javax.xml.ws.WebServiceException; </xsl:text> -
trunk/src/VBox/Main/webservice/websrv-python.xsl
r21640 r21819 53 53 <xsl:when test="$type='unsigned long long'">UnsignedLong</xsl:when> 54 54 <xsl:when test="$type='result'">UnsignedInt</xsl:when> 55 <xsl:when test="$type='uuid'">UUID</xsl:when>56 55 <xsl:when test="$type='$unknown'">IUnknown</xsl:when> 57 56 <xsl:when test="$type='$dispatched'">IUnknown</xsl:when> … … 538 537 539 538 540 class UUID:541 def __init__(self, mgr, handle, isarray = False):542 self.handle = handle543 self.mgr = mgr544 self.isarray = isarray545 546 def __next(self):547 if self.isarray:548 return self.handle.__next()549 raise TypeError, "iteration over non-sequence"550 551 def __size(self):552 if self.isarray:553 return self.handle.__size()554 raise TypeError, "iteration over non-sequence"555 556 def __len__(self):557 if self.isarray:558 return self.handle.__len__()559 raise TypeError, "iteration over non-sequence"560 561 def __getitem__(self, index):562 if self.isarray:563 return UUID(self.mgr, self.handle[index])564 raise TypeError, "iteration over non-sequence"565 566 def __str__(self):567 return self.handle568 569 def __eq__(self,other):570 if self.isarray:571 return isinstance(other,UUID) and self.handle == other.handle572 if isinstance(other,UUID):573 return self.handle == other.handle574 if isinstance(other,basestring):575 return self.handle == other576 return False577 578 def __ne__(self,other):579 if self.isarray:580 return not isinstance(other,UUID) or self.handle == other.handle581 if isinstance(other,UUID):582 return self.handle != other.handle583 if isinstance(other,basestring):584 return self.handle != other585 return True586 587 539 class Boolean: 588 540 def __init__(self, mgr, handle, isarray = False): -
trunk/src/VBox/Main/webservice/websrv-shared.inc.xsl
r20888 r21819 171 171 <type idlname="float" xmlname="float" cname="float" gluename="" javaname="Float" /> 172 172 <type idlname="wstring" xmlname="string" cname="std::string" gluename="" javaname="String" /> 173 <type idlname="uuid" xmlname="string" cname="std::string" gluename="" javaname="UUID" />174 173 <type idlname="result" xmlname="unsignedInt" cname="unsigned int" gluename="HRESULT" javaname="Long" /> 175 174 </xsl:variable>
Note:
See TracChangeset
for help on using the changeset viewer.