| 1 22 package org.jboss.xb.binding; 23 24 import org.jboss.logging.Logger; 25 import org.jboss.util.Base64; 26 27 import javax.xml.namespace.QName ; 28 import javax.xml.namespace.NamespaceContext ; 29 import java.io.ByteArrayOutputStream ; 30 import java.io.Serializable ; 31 import java.math.BigDecimal ; 32 import java.math.BigInteger ; 33 import java.net.URISyntaxException ; 34 import java.text.DecimalFormat ; 35 import java.text.ParseException ; 36 import java.util.Calendar ; 37 import java.util.StringTokenizer ; 38 import java.util.TimeZone ; 39 import java.util.List ; 40 import java.util.ArrayList ; 41 42 43 48 public final class SimpleTypeBindings 49 implements Serializable  50 { 51 static final long serialVersionUID = 4372272109355825813L; 52 53 public static final String XS_ANYSIMPLETYPE_NAME = "anySimpleType"; 54 55 public static final String XS_STRING_NAME = "string"; 59 public static final String XS_BOOLEAN_NAME = "boolean"; 60 public static final String XS_DECIMAL_NAME = "decimal"; 61 public static final String XS_FLOAT_NAME = "float"; 62 public static final String XS_DOUBLE_NAME = "double"; 63 public static final String XS_DURATION_NAME = "duration"; 64 public static final String XS_DATETIME_NAME = "dateTime"; 65 public static final String XS_TIME_NAME = "time"; 66 public static final String XS_DATE_NAME = "date"; 67 public static final String XS_GYEARMONTH_NAME = "gYearMonth"; 68 public static final String XS_GYEAR_NAME = "gYear"; 69 public static final String XS_GMONTHDAY_NAME = "gMonthDay"; 70 public static final String XS_GDAY_NAME = "gDay"; 71 public static final String XS_GMONTH_NAME = "gMonth"; 72 public static final String XS_HEXBINARY_NAME = "hexBinary"; 73 public static final String XS_BASE64BINARY_NAME = "base64Binary"; 74 public static final String XS_ANYURI_NAME = "anyURI"; 75 public static final String XS_QNAME_NAME = "QName"; 76 public static final String XS_NOTATION_NAME = "NOTATION"; 77 78 82 public static final String XS_NORMALIZEDSTRING_NAME = "normalizedString"; 83 public static final String XS_TOKEN_NAME = "token"; 84 public static final String XS_LANGUAGE_NAME = "language"; 85 public static final String XS_NMTOKEN_NAME = "NMTOKEN"; 86 public static final String XS_NMTOKENS_NAME = "NMTOKENS"; 87 public static final String XS_NAME_NAME = "Name"; 88 public static final String XS_NCNAME_NAME = "NCName"; 89 public static final String XS_ID_NAME = "ID"; 90 public static final String XS_IDREF_NAME = "IDREF"; 91 public static final String XS_IDREFS_NAME = "IDREFS"; 92 public static final String XS_ENTITY_NAME = "ENTITY"; 93 public static final String XS_ENTITIES_NAME = "ENTITIES"; 94 public static final String XS_INTEGER_NAME = "integer"; 95 public static final String XS_NONPOSITIVEINTEGER_NAME = "nonPositiveInteger"; 96 public static final String XS_NEGATIVEINTEGER_NAME = "negativeInteger"; 97 public static final String XS_LONG_NAME = "long"; 98 public static final String XS_INT_NAME = "int"; 99 public static final String XS_SHORT_NAME = "short"; 100 public static final String XS_BYTE_NAME = "byte"; 101 public static final String XS_NONNEGATIVEINTEGER_NAME = "nonNegativeInteger"; 102 public static final String XS_UNSIGNEDLONG_NAME = "unsignedLong"; 103 public static final String XS_UNSIGNEDINT_NAME = "unsignedInt"; 104 public static final String XS_UNSIGNEDSHORT_NAME = "unsignedShort"; 105 public static final String XS_UNSIGNEDBYTE_NAME = "unsignedByte"; 106 public static final String XS_POSITIVEINTEGER_NAME = "positiveInteger"; 107 108 public static final int XS_INT = XS_INT_NAME.hashCode(); 109 public static final int XS_LONG = XS_LONG_NAME.hashCode(); 110 public static final int XS_SHORT = XS_SHORT_NAME.hashCode(); 111 public static final int XS_FLOAT = XS_FLOAT_NAME.hashCode(); 112 public static final int XS_DOUBLE = XS_DOUBLE_NAME.hashCode(); 113 public static final int XS_BOOLEAN = XS_BOOLEAN_NAME.hashCode(); 114 public static final int XS_BYTE = XS_BYTE_NAME.hashCode(); 115 public static final int XS_STRING = XS_STRING_NAME.hashCode(); 116 public static final int XS_INTEGER = XS_INTEGER_NAME.hashCode(); 117 public static final int XS_DECIMAL = XS_DECIMAL_NAME.hashCode(); 118 public static final int XS_DATETIME = XS_DATETIME_NAME.hashCode(); 119 public static final int XS_QNAME = XS_QNAME_NAME.hashCode(); 120 public static final int XS_ANYURI = XS_ANYURI_NAME.hashCode(); 121 public static final int XS_UNSIGNEDLONG = XS_UNSIGNEDLONG_NAME.hashCode(); 122 public static final int XS_UNSIGNEDINT = XS_UNSIGNEDINT_NAME.hashCode(); 123 public static final int XS_UNSIGNEDSHORT = XS_UNSIGNEDSHORT_NAME.hashCode(); 124 public static final int XS_UNSIGNEDBYTE = XS_UNSIGNEDBYTE_NAME.hashCode(); 125 public static final int XS_DATE = XS_DATE_NAME.hashCode(); 126 public static final int XS_TIME = XS_TIME_NAME.hashCode(); 127 public static final int XS_BASE64BINARY = XS_BASE64BINARY_NAME.hashCode(); 128 public static final int XS_HEXBINARY = XS_HEXBINARY_NAME.hashCode(); 129 public static final int XS_ANYSIMPLETYPE = XS_ANYSIMPLETYPE_NAME.hashCode(); 130 public static final int XS_DURATION = XS_DURATION_NAME.hashCode(); 131 public static final int XS_GYEARMONTH = XS_GYEARMONTH_NAME.hashCode(); 132 public static final int XS_GYEAR = XS_GYEAR_NAME.hashCode(); 133 public static final int XS_GMONTHDAY = XS_GMONTHDAY_NAME.hashCode(); 134 public static final int XS_GMONTH = XS_GMONTH_NAME.hashCode(); 135 public static final int XS_GDAY = XS_GDAY_NAME.hashCode(); 136 public static final int XS_NORMALIZEDSTRING = XS_NORMALIZEDSTRING_NAME.hashCode(); 137 public static final int XS_TOKEN = XS_TOKEN_NAME.hashCode(); 138 public static final int XS_LANGUAGE = XS_LANGUAGE_NAME.hashCode(); 139 public static final int XS_NAME = XS_NAME_NAME.hashCode(); 140 public static final int XS_NCNAME = XS_NCNAME_NAME.hashCode(); 141 public static final int XS_ID = XS_ID_NAME.hashCode(); 142 public static final int XS_NMTOKEN = XS_NMTOKEN_NAME.hashCode(); 143 public static final int XS_NMTOKENS = XS_NMTOKENS_NAME.hashCode(); 144 public static final int XS_NONPOSITIVEINTEGER = XS_NONPOSITIVEINTEGER_NAME.hashCode(); 145 public static final int XS_NEGATIVEINTEGER = XS_NEGATIVEINTEGER_NAME.hashCode(); 146 public static final int XS_NONNEGATIVEINTEGER = XS_NONNEGATIVEINTEGER_NAME.hashCode(); 147 public static final int XS_POSITIVEINTEGER = XS_POSITIVEINTEGER_NAME.hashCode(); 148 public static final int XS_NOTATION = XS_NOTATION_NAME.hashCode(); 149 public static final int XS_IDREF = XS_IDREF_NAME.hashCode(); 150 public static final int XS_IDREFS = XS_IDREFS_NAME.hashCode(); 151 public static final int XS_ENTITY = XS_ENTITY_NAME.hashCode(); 152 public static final int XS_ENTITIES = XS_ENTITIES_NAME.hashCode(); 153 154 public static final TypeBinding STRING = new TypeBinding() 155 { 156 public Object unmarshal(String value) 157 { 158 return value; 159 } 160 161 public String marshal(Object value) 162 { 163 return (String )value; 164 } 165 }; 166 167 public static final TypeBinding INT = new TypeBinding() 168 { 169 public Object unmarshal(String value) 170 { 171 return Integer.valueOf(value); 172 } 173 174 public String marshal(Object value) 175 { 176 return String.valueOf(value); 177 } 178 }; 179 180 public static final TypeBinding LONG = new TypeBinding() 181 { 182 public Object unmarshal(String value) 183 { 184 return Long.valueOf(value); 185 } 186 187 public String marshal(Object value) 188 { 189 return String.valueOf(value); 190 } 191 }; 192 193 public static final TypeBinding DOUBLE = new TypeBinding() 194 { 195 public Object unmarshal(String value) 196 { 197 return Double.valueOf(value); 198 } 199 200 public String marshal(Object value) 201 { 202 return String.valueOf(value); 203 } 204 }; 205 206 public static final TypeBinding FLOAT = new TypeBinding() 207 { 208 public Object unmarshal(String value) 209 { 210 return Float.valueOf(value); 211 } 212 213 public String marshal(Object value) 214 { 215 return String.valueOf(value); 216 } 217 }; 218 219 public static final TypeBinding SHORT = new TypeBinding() 220 { 221 public Object unmarshal(String value) 222 { 223 return Short.valueOf(value); 224 } 225 226 public String marshal(Object value) 227 { 228 return String.valueOf(value); 229 } 230 }; 231 232 public static final TypeBinding BYTE = new TypeBinding() 233 { 234 public Object unmarshal(String value) 235 { 236 return Byte.valueOf(value); 237 } 238 239 public String marshal(Object value) 240 { 241 return String.valueOf(value); 242 } 243 }; 244 245 public static final TypeBinding CHAR = new TypeBinding() 246 { 247 public Object unmarshal(String value) 248 { 249 return value == null ? null : new Character (value.charAt(0)); 250 } 251 252 public String marshal(Object value) 253 { 254 return String.valueOf(value); 255 } 256 }; 257 258 public static final TypeBinding JAVA_UTIL_DATE = new TypeBinding() 259 { 260 public Object unmarshal(String value) 261 { 262 return unmarshalDate(value).getTime(); 263 } 264 265 public String marshal(Object value) 266 { 267 Calendar c = Calendar.getInstance(); 268 c.setTime((java.util.Date )value); 269 return marshalDate(c); 270 } 271 }; 272 273 static 275 { 276 int[] codes = new int[45]; 277 String [] names = new String [codes.length]; 278 int i = 0; 279 280 names[i] = XS_INT_NAME; 281 codes[i++] = XS_INT; 282 283 names[i] = XS_LONG_NAME; 284 codes[i++] = XS_LONG; 285 286 names[i] = XS_SHORT_NAME; 287 codes[i++] = XS_SHORT; 288 289 names[i] = XS_FLOAT_NAME; 290 codes[i++] = XS_FLOAT; 291 292 names[i] = XS_DOUBLE_NAME; 293 codes[i++] = XS_DOUBLE; 294 295 names[i] = XS_BOOLEAN_NAME; 296 codes[i++] = XS_BOOLEAN; 297 298 names[i] = XS_BYTE_NAME; 299 codes[i++] = XS_BYTE; 300 301 names[i] = XS_STRING_NAME; 302 codes[i++] = XS_STRING; 303 304 names[i] = XS_INTEGER_NAME; 305 codes[i++] = XS_INTEGER; 306 307 names[i] = XS_DECIMAL_NAME; 308 codes[i++] = XS_DECIMAL; 309 310 names[i] = XS_DATETIME_NAME; 311 codes[i++] = XS_DATETIME; 312 313 names[i] = XS_QNAME_NAME; 314 codes[i++] = XS_QNAME; 315 316 names[i] = XS_ANYURI_NAME; 317 codes[i++] = XS_ANYURI; 318 319 names[i] = XS_UNSIGNEDINT_NAME; 320 codes[i++] = XS_UNSIGNEDINT; 321 322 names[i] = XS_UNSIGNEDSHORT_NAME; 323 codes[i++] = XS_UNSIGNEDSHORT; 324 325 names[i] = XS_UNSIGNEDBYTE_NAME; 326 codes[i++] = XS_UNSIGNEDBYTE; 327 328 names[i] = XS_DATE_NAME; 329 codes[i++] = XS_DATE; 330 331 names[i] = XS_TIME_NAME; 332 codes[i++] = XS_TIME; 333 334 names[i] = XS_BASE64BINARY_NAME; 335 codes[i++] = XS_BASE64BINARY; 336 337 names[i] = XS_HEXBINARY_NAME; 338 codes[i++] = XS_HEXBINARY; 339 340 names[i] = XS_ANYSIMPLETYPE_NAME; 341 codes[i++] = XS_ANYSIMPLETYPE; 342 343 names[i] = XS_DURATION_NAME; 344 codes[i++] = XS_DURATION; 345 346 names[i] = XS_GYEARMONTH_NAME; 347 codes[i++] = XS_GYEARMONTH; 348 349 names[i] = XS_GYEAR_NAME; 350 codes[i++] = XS_GYEAR; 351 352 names[i] = XS_GMONTHDAY_NAME; 353 codes[i++] = XS_GMONTHDAY; 354 355 names[i] = XS_GMONTH_NAME; 356 codes[i++] = XS_GMONTH; 357 358 names[i] = XS_GDAY_NAME; 359 codes[i++] = XS_GDAY; 360 361 names[i] = XS_NORMALIZEDSTRING_NAME; 362 codes[i++] = XS_NORMALIZEDSTRING; 363 364 names[i] = XS_TOKEN_NAME; 365 codes[i++] = XS_TOKEN; 366 367 names[i] = XS_LANGUAGE_NAME; 368 codes[i++] = XS_LANGUAGE; 369 370 names[i] = XS_NAME_NAME; 371 codes[i++] = XS_NAME; 372 373 names[i] = XS_NCNAME_NAME; 374 codes[i++] = XS_NCNAME; 375 376 names[i] = XS_ID_NAME; 377 codes[i++] = XS_ID; 378 379 names[i] = XS_NMTOKEN_NAME; 380 codes[i++] = XS_NMTOKEN; 381 382 names[i] = XS_NMTOKENS_NAME; 383 codes[i++] = XS_NMTOKENS; 384 385 names[i] = XS_NONPOSITIVEINTEGER_NAME; 386 codes[i++] = XS_NONPOSITIVEINTEGER; 387 388 names[i] = XS_NONNEGATIVEINTEGER_NAME; 389 codes[i++] = XS_NONNEGATIVEINTEGER; 390 391 names[i] = XS_POSITIVEINTEGER_NAME; 392 codes[i++] = XS_POSITIVEINTEGER; 393 394 names[i] = XS_NEGATIVEINTEGER_NAME; 395 codes[i++] = XS_NEGATIVEINTEGER; 396 397 names[i] = XS_UNSIGNEDLONG_NAME; 398 codes[i++] = XS_UNSIGNEDLONG; 399 400 names[i] = XS_NOTATION_NAME; 401 codes[i++] = XS_NOTATION; 402 403 names[i] = XS_IDREF_NAME; 404 codes[i++] = XS_IDREF; 405 406 names[i] = XS_IDREFS_NAME; 407 codes[i++] = XS_IDREFS; 408 409 names[i] = XS_ENTITY_NAME; 410 codes[i++] = XS_ENTITY; 411 412 names[i] = XS_ENTITIES_NAME; 413 codes[i++] = XS_ENTITIES; 414 415 Logger log = Logger.getLogger(SimpleTypeBindings.class); 416 boolean allAreUnique = true; 417 for(int outer = 0; outer < names.length; ++outer) 418 { 419 int outerCode = codes[outer]; 420 String outerName = names[outer]; 421 422 for(int inner = outer + 1; inner < names.length; ++inner) 423 { 424 int innerCode = codes[inner]; 425 String innerName = names[inner]; 426 427 if(outerCode == innerCode) 428 { 429 log.error("Types have the same hash code " + outerCode + ": " + outerName + " and " + innerName); 430 allAreUnique = false; 431 } 432 } 433 } 434 435 if(!allAreUnique) 436 { 437 throw new IllegalStateException ("Not all the schema types have unique hash codes! See log for more details."); 438 } 439 } 440 441 public static Class classForType(String xsdType, boolean nillable) 442 { 443 Class result; 444 int typeCode = xsdType.hashCode(); 445 if(typeCode == XS_INT) 446 { 447 result = nillable ? Integer .class : int.class; 448 } 449 else if(typeCode == XS_LONG) 450 { 451 result = nillable ? Long .class : long.class; 452 } 453 else if(typeCode == XS_SHORT) 454 { 455 result = nillable ? Short .class : short.class; 456 } 457 else if(typeCode == XS_BYTE) 458 { 459 result = nillable ? Byte .class : byte.class; 460 } 461 else if(typeCode == XS_FLOAT) 462 { 463 result = nillable ? Float .class : float.class; 464 } 465 else if(typeCode == XS_DOUBLE) 466 { 467 result = nillable ? Double .class : double.class; 468 } 469 else if(typeCode == XS_BOOLEAN) 470 { 471 result = nillable ? Boolean .class : boolean.class; 472 } 473 else if(typeCode == XS_STRING) 474 { 475 result = String .class; 476 } 477 else if(typeCode == XS_INTEGER) 478 { 479 result = BigInteger .class; 480 } 481 else if(typeCode == XS_DECIMAL) 482 { 483 result = BigDecimal .class; 484 } 485 else if(typeCode == XS_DATETIME) 486 { 487 result = java.util.Calendar .class; 488 } 489 else if(typeCode == XS_QNAME) 490 { 491 result = QName .class; 492 } 493 else if(typeCode == XS_ANYURI) 494 { 495 result = java.net.URI .class; 504 } 505 else if(typeCode == XS_UNSIGNEDLONG) 506 { 507 result = BigInteger .class; 508 } 509 else if(typeCode == XS_UNSIGNEDINT) 510 { 511 result = nillable ? Long .class : long.class; 512 } 513 else if(typeCode == XS_UNSIGNEDSHORT) 514 { 515 result = nillable ? Integer .class : int.class; 516 } 517 else if(typeCode == XS_UNSIGNEDBYTE) 518 { 519 result = nillable ? Short .class : short.class; 520 } 521 else if(typeCode == XS_DATE) 522 { 523 result = Calendar .class; 524 } 525 else if(typeCode == XS_TIME) 526 { 527 result = Calendar .class; 528 } 529 else if(typeCode == XS_BASE64BINARY) 530 { 531 result = byte[].class; 532 } 533 else if(typeCode == XS_HEXBINARY) 534 { 535 result = byte[].class; 536 } 537 else if(typeCode == XS_ANYSIMPLETYPE) 538 { 539 result = String .class; 540 } 541 else if(typeCode == XS_DURATION) 542 { 543 throw new IllegalStateException ("Recognized but not supported xsdType: " + XS_DURATION_NAME); 545 } 546 else if(typeCode == XS_GYEARMONTH) 547 { 548 result = Calendar .class; 549 } 550 else if(typeCode == XS_GYEAR) 551 { 552 result = Calendar .class; 553 } 554 else if(typeCode == XS_GMONTHDAY) 555 { 556 result = Calendar .class; 557 } 558 else if(typeCode == XS_GMONTH) 559 { 560 result = Calendar .class; 561 } 562 else if(typeCode == XS_GDAY) 563 { 564 result = Calendar .class; 565 } 566 else if(typeCode == XS_NORMALIZEDSTRING) 567 { 568 result = String .class; 569 } 570 else if(typeCode == XS_TOKEN) 571 { 572 result = String .class; 573 } 574 else if(typeCode == XS_LANGUAGE) 575 { 576 result = String .class; 577 } 578 else if(typeCode == XS_NAME) 579 { 580 result = String .class; 581 } 582 else if(typeCode == XS_NCNAME) 583 { 584 result = String .class; 585 } 586 else if(typeCode == XS_ID) 587 { 588 result = String .class; 589 } 590 else if(typeCode == XS_NMTOKEN) 591 { 592 result = String .class; 593 } 594 else if(typeCode == XS_NMTOKENS) 595 { 596 result = String [].class; 597 } 598 else if(typeCode == XS_NONPOSITIVEINTEGER) 599 { 600 result = BigInteger .class; 601 } 602 else if(typeCode == XS_NEGATIVEINTEGER) 603 { 604 result = BigInteger .class; 605 } 606 else if(typeCode == XS_NONNEGATIVEINTEGER) 607 { 608 result = BigInteger .class; 609 } 610 else if(typeCode == XS_POSITIVEINTEGER) 611 { 612 result = BigInteger .class; 613 } 614 else if(typeCode == XS_NOTATION) 615 { 616 result = String .class; 617 } 618 else if(typeCode == XS_IDREF) 619 { 620 result = String .class; 621 } 622 else if(typeCode == XS_IDREFS) 623 { 624 result = String [].class; 625 } 626 else if(typeCode == XS_ENTITY) 627 { 628 result = String .class; 629 } 630 else if(typeCode == XS_ENTITIES) 631 { 632 result = String [].class; 633 } 634 else 635 { 636 throw new IllegalStateException ("Not supported xsdType: " + xsdType + ", hashCode=" + xsdType.hashCode()); 637 } 638 return result; 639 } 640 641 public static Object unmarshal(String xsdType, String value, NamespaceContext nsCtx) 642 { 643 if (xsdType == null) 644 throw new IllegalArgumentException ("Schema type cannot be null"); 645 if (value == null) 646 throw new IllegalArgumentException ("Value string cannot be null"); 647 648 int typeCode = xsdType.hashCode(); 649 Object result; 650 if(typeCode == XS_INT) 651 { 652 result = Integer.valueOf(value); 653 } 654 else if(typeCode == XS_LONG) 655 { 656 result = Long.valueOf(value); 657 } 658 else if(typeCode == XS_SHORT) 659 { 660 result = Short.valueOf(value); 661 } 662 else if(typeCode == XS_BYTE) 663 { 664 result = Byte.valueOf(value); 665 } 666 else if(typeCode == XS_FLOAT) 667 { 668 if("INF".equals(value)) 669 { 670 result = new Float (Float.POSITIVE_INFINITY); 671 } 672 else if("-INF".equals(value)) 673 { 674 result = new Float (Float.NEGATIVE_INFINITY); 675 } 676 else 677 { 678 result = Float.valueOf(value); 679 } 680 } 681 else if(typeCode == XS_DOUBLE) 682 { 683 if("INF".equals(value)) 684 { 685 result = new Double (Double.POSITIVE_INFINITY); 686 } 687 else if("-INF".equals(value)) 688 { 689 result = new Double (Double.NEGATIVE_INFINITY); 690 } 691 else 692 { 693 result = Double.valueOf(value); 694 } 695 } 696 else if(typeCode == XS_BOOLEAN) 697 { 698 if(value.length() == 1) 699 { 700 switch(value.charAt(0)) 701 { 702 case '1': 703 result = Boolean.TRUE; 704 break; 705 case '0': 706 result = Boolean.FALSE; 707 break; 708 default: 709 throw new JBossXBValueFormatException("An instance of a datatype that is defined as ?boolean? can have the following legal literals" + 710 " {true, false, 1, 0}. But got: " + value 711 ); 712 } 713 } 714 else 715 { 716 result = Boolean.valueOf(value); 717 } 718 } 719 else if(typeCode == XS_STRING) 720 { 721 result = value; 722 } 723 else if(typeCode == XS_INTEGER) 724 { 725 result = new BigInteger (value); 726 } 727 else if(typeCode == XS_DECIMAL) 728 { 729 result = new BigDecimal (value); 730 } 731 else if(typeCode == XS_DATETIME) 732 { 733 result = unmarshalDateTime(value); 734 } 735 else if(typeCode == XS_QNAME) 736 { 737 result = unmarshalQName(value, nsCtx); 738 } 739 else if(typeCode == XS_ANYURI) 740 { 741 try 750 { 751 result = new java.net.URI (value); 752 } 753 catch(URISyntaxException e) 754 { 755 throw new JBossXBValueFormatException("Failed to unmarshal anyURI value " + value, e); 756 } 757 } 758 else if(typeCode == XS_UNSIGNEDLONG) 759 { 760 BigInteger d = new BigInteger (value); 761 if(d.doubleValue() < 0 || d.doubleValue() > 18446744073709551615D) 762 { 763 throw new JBossXBValueFormatException("Invalid unsignedLong value: " + value); 764 } 765 result = d; 766 } 767 else if(typeCode == XS_UNSIGNEDINT) 768 { 769 long l = Long.parseLong(value); 770 if(l < 0 || l > 4294967295L) 771 { 772 throw new JBossXBValueFormatException("Invalid unsignedInt value: " + value); 773 } 774 result = new Long (l); 775 } 776 else if(typeCode == XS_UNSIGNEDSHORT) 777 { 778 int i = Integer.parseInt(value); 779 if(i < 0 || i > 65535) 780 { 781  
|