21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package javax.xml.bind; 27 28 /** 29 * <p> 30 * The DatatypeConverterInterface is for JAXB provider use only. A 31 * JAXB provider must supply a class that implements this interface. 32 * JAXB Providers are required to call the 33 * {@link DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface) 34 * DatatypeConverter.setDatatypeConverter} api at 35 * some point before the first marshal or unmarshal operation (perhaps during 36 * the call to JAXBContext.newInstance). This step is necessary to configure 37 * the converter that should be used to perform the print and parse 38 * functionality. Calling this api repeatedly will have no effect - the 39 * DatatypeConverter instance passed into the first invocation is the one that 40 * will be used from then on. 41 * </p> 42 * 43 * <p> 44 * This interface defines the parse and print methods. There is one 45 * parse and print method for each XML schema datatype specified in the 46 * the default binding Table 5-1 in the JAXB specification. 47 * </p> 48 * 49 * <p> 50 * The parse and print methods defined here are invoked by the static parse 51 * and print methods defined in the {@link DatatypeConverter DatatypeConverter} 52 * class. 53 * </p> 54 * 55 * <p> 56 * A parse method for a XML schema datatype must be capable of converting any 57 * lexical representation of the XML schema datatype ( specified by the 58 * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes 59 * specification</a> into a value in the value space of the XML schema datatype. 60 * If an error is encountered during conversion, then an IllegalArgumentException 61 * or a subclass of IllegalArgumentException must be thrown by the method. 62 * 63 * </p> 64 * 65 * <p> 66 * A print method for a XML schema datatype can output any lexical 67 * representation that is valid with respect to the XML schema datatype. 68 * If an error is encountered during conversion, then an IllegalArgumentException, 69 * or a subclass of IllegalArgumentException must be thrown by the method. 70 * </p> 71 * 72 * The prefix xsd: is used to refer to XML schema datatypes 73 * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes 74 * specification.</a> 75 * 76 * <p> 77 * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker,Sun Microsystems Inc.</li></ul> 78 * @see DatatypeConverter 79 * @see ParseConversionEvent 80 * @see PrintConversionEvent 81 * @since 1.6, JAXB 1.0 82 */ 83 84 public interface DatatypeConverterInterface { 85 /** 86 * <p> 87 * Convert the string argument into a string. 88 * @param lexicalXSDString 89 * A lexical representation of the XML Schema datatype xsd:string 90 * @return 91 * A string that is the same as the input string. 92 */ 93 public String parseString( String lexicalXSDString ); 94 95 /** 96 * <p> 97 * Convert the string argument into a BigInteger value. 98 * @param lexicalXSDInteger 99 * A string containing a lexical representation of 100 * xsd:integer. 101 * @return 102 * A BigInteger value represented by the string argument. 103 * @throws NumberFormatException <code>lexicalXSDInteger</code> is not a valid string representation of a {@link java.math.BigInteger} value. 104 */ 105 public java.math.BigInteger parseInteger( String lexicalXSDInteger ); 106 107 /** 108 * <p> 109 * Convert the string argument into an int value. 110 * @param lexicalXSDInt 111 * A string containing a lexical representation of 112 * xsd:int. 113 * @return 114 * An int value represented byte the string argument. 115 * @throws NumberFormatException <code>lexicalXSDInt</code> is not a valid string representation of an <code>int</code> value. 116 */ 117 public int parseInt( String lexicalXSDInt ); 118 119 /** 120 * <p> 121 * Converts the string argument into a long value. 122 * @param lexicalXSDLong 123 * A string containing lexical representation of 124 * xsd:long. 125 * @return 126 * A long value represented by the string argument. 127 * @throws NumberFormatException <code>lexicalXSDLong</code> is not a valid string representation of a <code>long</code> value. 128 */ 129 public long parseLong( String lexicalXSDLong ); 130 131 /** 132 * <p> 133 * Converts the string argument into a short value. 134 * @param lexicalXSDShort 135 * A string containing lexical representation of 136 * xsd:short. 137 * @return 138 * A short value represented by the string argument. 139 * @throws NumberFormatException <code>lexicalXSDShort</code> is not a valid string representation of a <code>short</code> value. 140 */ 141 public short parseShort( String lexicalXSDShort ); 142 143 /** 144 * <p> 145 * Converts the string argument into a BigDecimal value. 146 * @param lexicalXSDDecimal 147 * A string containing lexical representation of 148 * xsd:decimal. 149 * @return 150 * A BigDecimal value represented by the string argument. 151 * @throws NumberFormatException <code>lexicalXSDDecimal</code> is not a valid string representation of {@link java.math.BigDecimal}. 152 */ 153 public java.math.BigDecimal parseDecimal( String lexicalXSDDecimal ); 154 155 /** 156 * <p> 157 * Converts the string argument into a float value. 158 * @param lexicalXSDFloat 159 * A string containing lexical representation of 160 * xsd:float. 161 * @return 162 * A float value represented by the string argument. 163 * @throws NumberFormatException <code>lexicalXSDFloat</code> is not a valid string representation of a <code>float</code> value. 164 */ 165 public float parseFloat( String lexicalXSDFloat ); 166 167 /** 168 * <p> 169 * Converts the string argument into a double value. 170 * @param lexicalXSDDouble 171 * A string containing lexical representation of 172 * xsd:double. 173 * @return 174 * A double value represented by the string argument. 175 * @throws NumberFormatException <code>lexicalXSDDouble</code> is not a valid string representation of a <code>double</code> value. 176 */ 177 public double parseDouble( String lexicalXSDDouble ); 178 179 /** 180 * <p> 181 * Converts the string argument into a boolean value. 182 * @param lexicalXSDBoolean 183 * A string containing lexical representation of 184 * xsd:boolean. 185 * @return 186 * A boolean value represented by the string argument. 187 * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:boolean. 188 */ 189 public boolean parseBoolean( String lexicalXSDBoolean ); 190 191 /** 192 * <p> 193 * Converts the string argument into a byte value. 194 * @param lexicalXSDByte 195 * A string containing lexical representation of 196 * xsd:byte. 197 * @return 198 * A byte value represented by the string argument. 199 * @throws NumberFormatException <code>lexicalXSDByte</code> does not contain a parseable byte. 200 * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:byte. 201 */ 202 public byte parseByte( String lexicalXSDByte ); 203 204 /** 205 * <p> 206 * Converts the string argument into a QName value. 207 * 208 * <p> 209 * String parameter <tt>lexicalXSDQname</tt> must conform to lexical value space specifed at 210 * <a href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part 2:Datatypes specification:QNames</a> 211 * 212 * @param lexicalXSDQName 213 * A string containing lexical representation of xsd:QName. 214 * @param nsc 215 * A namespace context for interpreting a prefix within a QName. 216 * @return 217 * A QName value represented by the string argument. 218 * @throws IllegalArgumentException if string parameter does not conform to XML Schema Part 2 specification or 219 * if namespace prefix of <tt>lexicalXSDQname</tt> is not bound to a URI in NamespaceContext <tt>nsc</tt>. 220 */ 221 public javax.xml.namespace.QName parseQName( String lexicalXSDQName, 222 javax.xml.namespace.NamespaceContext nsc); 223 224 /** 225 * <p> 226 * Converts the string argument into a Calendar value. 227 * @param lexicalXSDDateTime 228 * A string containing lexical representation of 229 * xsd:datetime. 230 * @return 231 * A Calendar object represented by the string argument. 232 * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:dateTime. 233 */ 234 public java.util.Calendar parseDateTime( String lexicalXSDDateTime ); 235 236 /** 237 * <p> 238 * Converts the string argument into an array of bytes. 239 * @param lexicalXSDBase64Binary 240 * A string containing lexical representation 241 * of xsd:base64Binary. 242 * @return 243 * An array of bytes represented by the string argument. 244 * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:base64Binary 245 */ 246 public byte[] parseBase64Binary( String lexicalXSDBase64Binary ); 247 248 /** 249 * <p> 250 * Converts the string argument into an array of bytes. 251 * @param lexicalXSDHexBinary 252 * A string containing lexical representation of 253 * xsd:hexBinary. 254 * @return 255 * An array of bytes represented by the string argument. 256 * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:hexBinary. 257 */ 258 public byte[] parseHexBinary( String lexicalXSDHexBinary ); 259 260 /** 261 * <p> 262 * Converts the string argument into a long value. 263 * @param lexicalXSDUnsignedInt 264 * A string containing lexical representation 265 * of xsd:unsignedInt. 266 * @return 267 * A long value represented by the string argument. 268 * @throws NumberFormatException if string parameter can not be parsed into a <tt>long</tt> value. 269 */ 270 public long parseUnsignedInt( String lexicalXSDUnsignedInt ); 271 272 /** 273 * <p> 274 * Converts the string argument into an int value. 275 * @param lexicalXSDUnsignedShort 276 * A string containing lexical 277 * representation of xsd:unsignedShort. 278 * @return 279 * An int value represented by the string argument. 280 * @throws NumberFormatException if string parameter can not be parsed into an <tt>int</tt> value. 281 */ 282 public int parseUnsignedShort( String lexicalXSDUnsignedShort ); 283 284 /** 285 * <p> 286 * Converts the string argument into a Calendar value. 287 * @param lexicalXSDTime 288 * A string containing lexical representation of 289 * xsd:Time. 290 * @return 291 * A Calendar value represented by the string argument. 292 * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Time. 293 */ 294 public java.util.Calendar parseTime( String lexicalXSDTime ); 295 296 /** 297 * <p> 298 * Converts the string argument into a Calendar value. 299 * @param lexicalXSDDate 300 * A string containing lexical representation of 301 * xsd:Date. 302 * @return 303 * A Calendar value represented by the string argument. 304 * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Date. 305 */ 306 public java.util.Calendar parseDate( String lexicalXSDDate ); 307 308 /** 309 * <p> 310 * Return a string containing the lexical representation of the 311 * simple type. 312 * @param lexicalXSDAnySimpleType 313 * A string containing lexical 314 * representation of the simple type. 315 * @return 316 * A string containing the lexical representation of the 317 * simple type. 318 */ 319 public String parseAnySimpleType( String lexicalXSDAnySimpleType ); 320 321 /** 322 * <p> 323 * Converts the string argument into a string. 324 * @param val 325 * A string value. 326 * @return 327 * A string containing a lexical representation of xsd:string 328 */ 329 public String printString( String val ); 330 331 /** 332 * <p> 333 * Converts a BigInteger value into a string. 334 * @param val 335 * A BigInteger value 336 * @return 337 * A string containing a lexical representation of xsd:integer 338 * @throws IllegalArgumentException <tt>val</tt> is null. 339 */ 340 public String printInteger( java.math.BigInteger val ); 341 342 /** 343 * <p> 344 * Converts an int value into a string. 345 * @param val 346 * An int value 347 * @return 348 * A string containing a lexical representation of xsd:int 349 */ 350 public String printInt( int val ); 351 352 353 /** 354 * <p> 355 * Converts a long value into a string. 356 * @param val 357 * A long value 358 * @return 359 * A string containing a lexical representation of xsd:long 360 */ 361 public String printLong( long val ); 362 363 /** 364 * <p> 365 * Converts a short value into a string. 366 * @param val 367 * A short value 368 * @return 369 * A string containing a lexical representation of xsd:short 370 */ 371 public String printShort( short val ); 372 373 /** 374 * <p> 375 * Converts a BigDecimal value into a string. 376 * @param val 377 * A BigDecimal value 378 * @return 379 * A string containing a lexical representation of xsd:decimal 380 * @throws IllegalArgumentException <tt>val</tt> is null. 381 */ 382 public String printDecimal( java.math.BigDecimal val ); 383 384 /** 385 * <p> 386 * Converts a float value into a string. 387 * @param val 388 * A float value 389 * @return 390 * A string containing a lexical representation of xsd:float 391 */ 392 public String printFloat( float val ); 393 394 /** 395 * <p> 396 * Converts a double value into a string. 397 * @param val 398 * A double value 399 * @return 400 * A string containing a lexical representation of xsd:double 401 */ 402 public String printDouble( double val ); 403 404 /** 405 * <p> 406 * Converts a boolean value into a string. 407 * @param val 408 * A boolean value 409 * @return 410 * A string containing a lexical representation of xsd:boolean 411 */ 412 public String printBoolean( boolean val ); 413 414 /** 415 * <p> 416 * Converts a byte value into a string. 417 * @param val 418 * A byte value 419 * @return 420 * A string containing a lexical representation of xsd:byte 421 */ 422 public String printByte( byte val ); 423 424 /** 425 * <p> 426 * Converts a QName instance into a string. 427 * @param val 428 * A QName value 429 * @param nsc 430 * A namespace context for interpreting a prefix within a QName. 431 * @return 432 * A string containing a lexical representation of QName 433 * @throws IllegalArgumentException if <tt>val</tt> is null or 434 * if <tt>nsc</tt> is non-null or <tt>nsc.getPrefix(nsprefixFromVal)</tt> is null. 435 */ 436 public String printQName( javax.xml.namespace.QName val, 437 javax.xml.namespace.NamespaceContext nsc ); 438 439 /** 440 * <p> 441 * Converts a Calendar value into a string. 442 * @param val 443 * A Calendar value 444 * @return 445 * A string containing a lexical representation of xsd:dateTime 446 * @throws IllegalArgumentException if <tt>val</tt> is null. 447 */ 448 public String printDateTime( java.util.Calendar val ); 449 450 /** 451 * <p> 452 * Converts an array of bytes into a string. 453 * @param val 454 * an array of bytes 455 * @return 456 * A string containing a lexical representation of xsd:base64Binary 457 * @throws IllegalArgumentException if <tt>val</tt> is null. 458 */ 459 public String printBase64Binary( byte[] val ); 460 461 /** 462 * <p> 463 * Converts an array of bytes into a string. 464 * @param val 465 * an array of bytes 466 * @return 467 * A string containing a lexical representation of xsd:hexBinary 468 * @throws IllegalArgumentException if <tt>val</tt> is null. 469 */ 470 public String printHexBinary( byte[] val ); 471 472 /** 473 * <p> 474 * Converts a long value into a string. 475 * @param val 476 * A long value 477 * @return 478 * A string containing a lexical representation of xsd:unsignedInt 479 */ 480 public String printUnsignedInt( long val ); 481 482 /** 483 * <p> 484 * Converts an int value into a string. 485 * @param val 486 * An int value 487 * @return 488 * A string containing a lexical representation of xsd:unsignedShort 489 */ 490 public String printUnsignedShort( int val ); 491 492 /** 493 * <p> 494 * Converts a Calendar value into a string. 495 * @param val 496 * A Calendar value 497 * @return 498 * A string containing a lexical representation of xsd:time 499 * @throws IllegalArgumentException if <tt>val</tt> is null. 500 */ 501 public String printTime( java.util.Calendar val ); 502 503 /** 504 * <p> 505 * Converts a Calendar value into a string. 506 * @param val 507 * A Calendar value 508 * @return 509 * A string containing a lexical representation of xsd:date 510 * @throws IllegalArgumentException if <tt>val</tt> is null. 511 */ 512 public String printDate( java.util.Calendar val ); 513 514 /** 515 * <p> 516 * Converts a string value into a string. 517 * @param val 518 * A string value 519 * @return 520 * A string containing a lexical representation of xsd:AnySimpleType 521 */ 522 public String printAnySimpleType( String val ); 523 } | 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package javax.xml.bind; 27 28 /** 29 * <p> 30 * The DatatypeConverterInterface is for JAXB provider use only. A 31 * JAXB provider must supply a class that implements this interface. 32 * JAXB Providers are required to call the 33 * {@link DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface) 34 * DatatypeConverter.setDatatypeConverter} api at 35 * some point before the first marshal or unmarshal operation (perhaps during 36 * the call to JAXBContext.newInstance). This step is necessary to configure 37 * the converter that should be used to perform the print and parse 38 * functionality. Calling this api repeatedly will have no effect - the 39 * DatatypeConverter instance passed into the first invocation is the one that 40 * will be used from then on. 41 * 42 * <p> 43 * This interface defines the parse and print methods. There is one 44 * parse and print method for each XML schema datatype specified in the 45 * the default binding Table 5-1 in the JAXB specification. 46 * 47 * <p> 48 * The parse and print methods defined here are invoked by the static parse 49 * and print methods defined in the {@link DatatypeConverter DatatypeConverter} 50 * class. 51 * 52 * <p> 53 * A parse method for a XML schema datatype must be capable of converting any 54 * lexical representation of the XML schema datatype ( specified by the 55 * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes 56 * specification</a> into a value in the value space of the XML schema datatype. 57 * If an error is encountered during conversion, then an IllegalArgumentException 58 * or a subclass of IllegalArgumentException must be thrown by the method. 59 * 60 * <p> 61 * A print method for a XML schema datatype can output any lexical 62 * representation that is valid with respect to the XML schema datatype. 63 * If an error is encountered during conversion, then an IllegalArgumentException, 64 * or a subclass of IllegalArgumentException must be thrown by the method. 65 * 66 * <p> 67 * The prefix xsd: is used to refer to XML schema datatypes 68 * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes 69 * specification.</a> 70 * 71 * @author <ul> 72 * <li>Sekhar Vajjhala, Sun Microsystems, Inc.</li> 73 * <li>Joe Fialli, Sun Microsystems Inc.</li> 74 * <li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li> 75 * <li>Ryan Shoemaker,Sun Microsystems Inc.</li> 76 * </ul> 77 * @see DatatypeConverter 78 * @see ParseConversionEvent 79 * @see PrintConversionEvent 80 * @since 1.6, JAXB 1.0 81 */ 82 83 public interface DatatypeConverterInterface { 84 /** 85 * Convert the string argument into a string. 86 * @param lexicalXSDString 87 * A lexical representation of the XML Schema datatype xsd:string 88 * @return 89 * A string that is the same as the input string. 90 */ 91 public String parseString( String lexicalXSDString ); 92 93 /** 94 * Convert the string argument into a BigInteger value. 95 * @param lexicalXSDInteger 96 * A string containing a lexical representation of 97 * xsd:integer. 98 * @return 99 * A BigInteger value represented by the string argument. 100 * @throws NumberFormatException {@code lexicalXSDInteger} is not a valid string representation of a {@link java.math.BigInteger} value. 101 */ 102 public java.math.BigInteger parseInteger( String lexicalXSDInteger ); 103 104 /** 105 * Convert the string argument into an int value. 106 * @param lexicalXSDInt 107 * A string containing a lexical representation of 108 * xsd:int. 109 * @return 110 * An int value represented byte the string argument. 111 * @throws NumberFormatException {@code lexicalXSDInt} is not a valid string representation of an {@code int} value. 112 */ 113 public int parseInt( String lexicalXSDInt ); 114 115 /** 116 * Converts the string argument into a long value. 117 * @param lexicalXSDLong 118 * A string containing lexical representation of 119 * xsd:long. 120 * @return 121 * A long value represented by the string argument. 122 * @throws NumberFormatException {@code lexicalXSDLong} is not a valid string representation of a {@code long} value. 123 */ 124 public long parseLong( String lexicalXSDLong ); 125 126 /** 127 * Converts the string argument into a short value. 128 * @param lexicalXSDShort 129 * A string containing lexical representation of 130 * xsd:short. 131 * @return 132 * A short value represented by the string argument. 133 * @throws NumberFormatException {@code lexicalXSDShort} is not a valid string representation of a {@code short} value. 134 */ 135 public short parseShort( String lexicalXSDShort ); 136 137 /** 138 * Converts the string argument into a BigDecimal value. 139 * @param lexicalXSDDecimal 140 * A string containing lexical representation of 141 * xsd:decimal. 142 * @return 143 * A BigDecimal value represented by the string argument. 144 * @throws NumberFormatException {@code lexicalXSDDecimal} is not a valid string representation of {@link java.math.BigDecimal}. 145 */ 146 public java.math.BigDecimal parseDecimal( String lexicalXSDDecimal ); 147 148 /** 149 * Converts the string argument into a float value. 150 * @param lexicalXSDFloat 151 * A string containing lexical representation of 152 * xsd:float. 153 * @return 154 * A float value represented by the string argument. 155 * @throws NumberFormatException {@code lexicalXSDFloat} is not a valid string representation of a {@code float} value. 156 */ 157 public float parseFloat( String lexicalXSDFloat ); 158 159 /** 160 * Converts the string argument into a double value. 161 * @param lexicalXSDDouble 162 * A string containing lexical representation of 163 * xsd:double. 164 * @return 165 * A double value represented by the string argument. 166 * @throws NumberFormatException {@code lexicalXSDDouble} is not a valid string representation of a {@code double} value. 167 */ 168 public double parseDouble( String lexicalXSDDouble ); 169 170 /** 171 * Converts the string argument into a boolean value. 172 * @param lexicalXSDBoolean 173 * A string containing lexical representation of 174 * xsd:boolean. 175 * @return 176 * A boolean value represented by the string argument. 177 * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:boolean. 178 */ 179 public boolean parseBoolean( String lexicalXSDBoolean ); 180 181 /** 182 * Converts the string argument into a byte value. 183 * @param lexicalXSDByte 184 * A string containing lexical representation of 185 * xsd:byte. 186 * @return 187 * A byte value represented by the string argument. 188 * @throws NumberFormatException {@code lexicalXSDByte} does not contain a parseable byte. 189 * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:byte. 190 */ 191 public byte parseByte( String lexicalXSDByte ); 192 193 /** 194 * Converts the string argument into a QName value. 195 * 196 * <p> 197 * String parameter <tt>lexicalXSDQname</tt> must conform to lexical value space specifed at 198 * <a href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part 2:Datatypes specification:QNames</a> 199 * 200 * @param lexicalXSDQName 201 * A string containing lexical representation of xsd:QName. 202 * @param nsc 203 * A namespace context for interpreting a prefix within a QName. 204 * @return 205 * A QName value represented by the string argument. 206 * @throws IllegalArgumentException if string parameter does not conform to XML Schema Part 2 specification or 207 * if namespace prefix of <tt>lexicalXSDQname</tt> is not bound to a URI in NamespaceContext <tt>nsc</tt>. 208 */ 209 public javax.xml.namespace.QName parseQName( String lexicalXSDQName, 210 javax.xml.namespace.NamespaceContext nsc); 211 212 /** 213 * Converts the string argument into a Calendar value. 214 * @param lexicalXSDDateTime 215 * A string containing lexical representation of 216 * xsd:datetime. 217 * @return 218 * A Calendar object represented by the string argument. 219 * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:dateTime. 220 */ 221 public java.util.Calendar parseDateTime( String lexicalXSDDateTime ); 222 223 /** 224 * Converts the string argument into an array of bytes. 225 * @param lexicalXSDBase64Binary 226 * A string containing lexical representation 227 * of xsd:base64Binary. 228 * @return 229 * An array of bytes represented by the string argument. 230 * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:base64Binary 231 */ 232 public byte[] parseBase64Binary( String lexicalXSDBase64Binary ); 233 234 /** 235 * Converts the string argument into an array of bytes. 236 * @param lexicalXSDHexBinary 237 * A string containing lexical representation of 238 * xsd:hexBinary. 239 * @return 240 * An array of bytes represented by the string argument. 241 * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:hexBinary. 242 */ 243 public byte[] parseHexBinary( String lexicalXSDHexBinary ); 244 245 /** 246 * Converts the string argument into a long value. 247 * @param lexicalXSDUnsignedInt 248 * A string containing lexical representation 249 * of xsd:unsignedInt. 250 * @return 251 * A long value represented by the string argument. 252 * @throws NumberFormatException if string parameter can not be parsed into a <tt>long</tt> value. 253 */ 254 public long parseUnsignedInt( String lexicalXSDUnsignedInt ); 255 256 /** 257 * Converts the string argument into an int value. 258 * @param lexicalXSDUnsignedShort 259 * A string containing lexical 260 * representation of xsd:unsignedShort. 261 * @return 262 * An int value represented by the string argument. 263 * @throws NumberFormatException if string parameter can not be parsed into an <tt>int</tt> value. 264 */ 265 public int parseUnsignedShort( String lexicalXSDUnsignedShort ); 266 267 /** 268 * Converts the string argument into a Calendar value. 269 * @param lexicalXSDTime 270 * A string containing lexical representation of 271 * xsd:Time. 272 * @return 273 * A Calendar value represented by the string argument. 274 * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Time. 275 */ 276 public java.util.Calendar parseTime( String lexicalXSDTime ); 277 278 /** 279 * Converts the string argument into a Calendar value. 280 * @param lexicalXSDDate 281 * A string containing lexical representation of 282 * xsd:Date. 283 * @return 284 * A Calendar value represented by the string argument. 285 * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Date. 286 */ 287 public java.util.Calendar parseDate( String lexicalXSDDate ); 288 289 /** 290 * Return a string containing the lexical representation of the 291 * simple type. 292 * @param lexicalXSDAnySimpleType 293 * A string containing lexical 294 * representation of the simple type. 295 * @return 296 * A string containing the lexical representation of the 297 * simple type. 298 */ 299 public String parseAnySimpleType( String lexicalXSDAnySimpleType ); 300 301 /** 302 * Converts the string argument into a string. 303 * @param val 304 * A string value. 305 * @return 306 * A string containing a lexical representation of xsd:string 307 */ 308 public String printString( String val ); 309 310 /** 311 * Converts a BigInteger value into a string. 312 * @param val 313 * A BigInteger value 314 * @return 315 * A string containing a lexical representation of xsd:integer 316 * @throws IllegalArgumentException <tt>val</tt> is null. 317 */ 318 public String printInteger( java.math.BigInteger val ); 319 320 /** 321 * Converts an int value into a string. 322 * @param val 323 * An int value 324 * @return 325 * A string containing a lexical representation of xsd:int 326 */ 327 public String printInt( int val ); 328 329 330 /** 331 * Converts a long value into a string. 332 * @param val 333 * A long value 334 * @return 335 * A string containing a lexical representation of xsd:long 336 */ 337 public String printLong( long val ); 338 339 /** 340 * Converts a short value into a string. 341 * @param val 342 * A short value 343 * @return 344 * A string containing a lexical representation of xsd:short 345 */ 346 public String printShort( short val ); 347 348 /** 349 * Converts a BigDecimal value into a string. 350 * @param val 351 * A BigDecimal value 352 * @return 353 * A string containing a lexical representation of xsd:decimal 354 * @throws IllegalArgumentException <tt>val</tt> is null. 355 */ 356 public String printDecimal( java.math.BigDecimal val ); 357 358 /** 359 * Converts a float value into a string. 360 * @param val 361 * A float value 362 * @return 363 * A string containing a lexical representation of xsd:float 364 */ 365 public String printFloat( float val ); 366 367 /** 368 * Converts a double value into a string. 369 * @param val 370 * A double value 371 * @return 372 * A string containing a lexical representation of xsd:double 373 */ 374 public String printDouble( double val ); 375 376 /** 377 * Converts a boolean value into a string. 378 * @param val 379 * A boolean value 380 * @return 381 * A string containing a lexical representation of xsd:boolean 382 */ 383 public String printBoolean( boolean val ); 384 385 /** 386 * Converts a byte value into a string. 387 * @param val 388 * A byte value 389 * @return 390 * A string containing a lexical representation of xsd:byte 391 */ 392 public String printByte( byte val ); 393 394 /** 395 * Converts a QName instance into a string. 396 * @param val 397 * A QName value 398 * @param nsc 399 * A namespace context for interpreting a prefix within a QName. 400 * @return 401 * A string containing a lexical representation of QName 402 * @throws IllegalArgumentException if <tt>val</tt> is null or 403 * if <tt>nsc</tt> is non-null or <tt>nsc.getPrefix(nsprefixFromVal)</tt> is null. 404 */ 405 public String printQName( javax.xml.namespace.QName val, 406 javax.xml.namespace.NamespaceContext nsc ); 407 408 /** 409 * Converts a Calendar value into a string. 410 * @param val 411 * A Calendar value 412 * @return 413 * A string containing a lexical representation of xsd:dateTime 414 * @throws IllegalArgumentException if <tt>val</tt> is null. 415 */ 416 public String printDateTime( java.util.Calendar val ); 417 418 /** 419 * Converts an array of bytes into a string. 420 * @param val 421 * an array of bytes 422 * @return 423 * A string containing a lexical representation of xsd:base64Binary 424 * @throws IllegalArgumentException if <tt>val</tt> is null. 425 */ 426 public String printBase64Binary( byte[] val ); 427 428 /** 429 * Converts an array of bytes into a string. 430 * @param val 431 * an array of bytes 432 * @return 433 * A string containing a lexical representation of xsd:hexBinary 434 * @throws IllegalArgumentException if <tt>val</tt> is null. 435 */ 436 public String printHexBinary( byte[] val ); 437 438 /** 439 * Converts a long value into a string. 440 * @param val 441 * A long value 442 * @return 443 * A string containing a lexical representation of xsd:unsignedInt 444 */ 445 public String printUnsignedInt( long val ); 446 447 /** 448 * Converts an int value into a string. 449 * @param val 450 * An int value 451 * @return 452 * A string containing a lexical representation of xsd:unsignedShort 453 */ 454 public String printUnsignedShort( int val ); 455 456 /** 457 * Converts a Calendar value into a string. 458 * @param val 459 * A Calendar value 460 * @return 461 * A string containing a lexical representation of xsd:time 462 * @throws IllegalArgumentException if <tt>val</tt> is null. 463 */ 464 public String printTime( java.util.Calendar val ); 465 466 /** 467 * Converts a Calendar value into a string. 468 * @param val 469 * A Calendar value 470 * @return 471 * A string containing a lexical representation of xsd:date 472 * @throws IllegalArgumentException if <tt>val</tt> is null. 473 */ 474 public String printDate( java.util.Calendar val ); 475 476 /** 477 * Converts a string value into a string. 478 * @param val 479 * A string value 480 * @return 481 * A string containing a lexical representation of xsd:AnySimpleType 482 */ 483 public String printAnySimpleType( String val ); 484 } |