This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.xml.bind
interface DatatypeConverterInterface


public interface DatatypeConverterInterface

The DatatypeConverterInterface is for JAXB provider use only. A JAXB provider must supply a class that implements this interface. JAXB Providers are required to call the {@link DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface) DatatypeConverter.setDatatypeConverter} api at some point before the first marshal or unmarshal operation (perhaps during the call to JAXBContext.newInstance). This step is necessary to configure the converter that should be used to perform the print and parse functionality. Calling this api repeatedly will have no effect - the DatatypeConverter instance passed into the first invocation is the one that will be used from then on.

This interface defines the parse and print methods. There is one parse and print method for each XML schema datatype specified in the the default binding Table 5-1 in the JAXB specification.

The parse and print methods defined here are invoked by the static parse and print methods defined in the {@link DatatypeConverter DatatypeConverter} class.

A parse method for a XML schema datatype must be capable of converting any lexical representation of the XML schema datatype ( specified by the XML Schema Part2: Datatypes specification into a value in the value space of the XML schema datatype. If an error is encountered during conversion, then an IllegalArgumentException or a subclass of IllegalArgumentException must be thrown by the method.

A print method for a XML schema datatype can output any lexical representation that is valid with respect to the XML schema datatype. If an error is encountered during conversion, then an IllegalArgumentException, or a subclass of IllegalArgumentException must be thrown by the method.

The prefix xsd: is used to refer to XML schema datatypes XML Schema Part2: Datatypes specification.


Method Summary
 String
parseAnySimpleType(String lexicalXSDAnySimpleType)

           Return a string containing the lexical representation of the simple type.
 byte[]
parseBase64Binary(String lexicalXSDBase64Binary)

           Converts the string argument into an array of bytes.
 boolean
parseBoolean(String lexicalXSDBoolean)

           Converts the string argument into a boolean value.
 byte
parseByte(String lexicalXSDByte)

           Converts the string argument into a byte value.
 Calendar
parseDate(String lexicalXSDDate)

           Converts the string argument into a Calendar value.
 Calendar
parseDateTime(String lexicalXSDDateTime)

           Converts the string argument into a Calendar value.
 BigDecimal
parseDecimal(String lexicalXSDDecimal)

           Converts the string argument into a BigDecimal value.
 double
parseDouble(String lexicalXSDDouble)

           Converts the string argument into a double value.
 float
parseFloat(String lexicalXSDFloat)

           Converts the string argument into a float value.
 byte[]
parseHexBinary(String lexicalXSDHexBinary)

           Converts the string argument into an array of bytes.
 int
parseInt(String lexicalXSDInt)

           Convert the string argument into an int value.
 BigInteger
parseInteger(String lexicalXSDInteger)

           Convert the string argument into a BigInteger value.
 long
parseLong(String lexicalXSDLong)

           Converts the string argument into a long value.
 QName
parseQName(String lexicalXSDQName, NamespaceContext nsc)

           Converts the string argument into a QName value.
 short
parseShort(String lexicalXSDShort)

           Converts the string argument into a short value.
 String
parseString(String lexicalXSDString)

           Convert the string argument into a string.
 Calendar
parseTime(String lexicalXSDTime)

           Converts the string argument into a Calendar value.
 long
parseUnsignedInt(String lexicalXSDUnsignedInt)

           Converts the string argument into a long value.
 int
parseUnsignedShort(String lexicalXSDUnsignedShort)

           Converts the string argument into an int value.
 String

           Converts a string value into a string.
 String
printBase64Binary(byte[] val)

           Converts an array of bytes into a string.
 String
printBoolean(boolean val)

           Converts a boolean value into a string.
 String
printByte(byte val)

           Converts a byte value into a string.
 String

           Converts a Calendar value into a string.
 String

           Converts a Calendar value into a string.
 String

           Converts a BigDecimal value into a string.
 String
printDouble(double val)

           Converts a double value into a string.
 String
printFloat(float val)

           Converts a float value into a string.
 String
printHexBinary(byte[] val)

           Converts an array of bytes into a string.
 String
printInt(int val)

           Converts an int value into a string.
 String

           Converts a BigInteger value into a string.
 String
printLong(long val)

           Converts a long value into a string.
 String

           Converts a QName instance into a string.
 String
printShort(short val)

           Converts a short value into a string.
 String

           Converts the string argument into a string.
 String

           Converts a Calendar value into a string.
 String
printUnsignedInt(long val)

           Converts a long value into a string.
 String

           Converts an int value into a string.
 

Method Detail

parseAnySimpleType

public String parseAnySimpleType(String lexicalXSDAnySimpleType)

Return a string containing the lexical representation of the simple type.

Parameters:
lexicalXSDAnySimpleType - A string containing lexical representation of the simple type.
Returns:
A string containing the lexical representation of the simple type.

parseBase64Binary

public byte[] parseBase64Binary(String lexicalXSDBase64Binary)

Converts the string argument into an array of bytes.

Parameters:
lexicalXSDBase64Binary - A string containing lexical representation of xsd:base64Binary.
Returns:
An array of bytes represented by the string argument.

parseBoolean

public boolean parseBoolean(String lexicalXSDBoolean)

Converts the string argument into a boolean value.

Parameters:
lexicalXSDBoolean - A string containing lexical representation of xsd:boolean.
Returns:
A boolean value represented by the string argument.

parseByte

public byte parseByte(String lexicalXSDByte)

Converts the string argument into a byte value.

Parameters:
lexicalXSDByte - A string containing lexical representation of xsd:byte.
Returns:
A byte value represented by the string argument.

parseDate

public Calendar parseDate(String lexicalXSDDate)

Converts the string argument into a Calendar value.

Parameters:
lexicalXSDDate - A string containing lexical representation of xsd:Date.
Returns:
A Calendar value represented by the string argument.

parseDateTime

public Calendar parseDateTime(String lexicalXSDDateTime)

Converts the string argument into a Calendar value.

Parameters:
lexicalXSDDateTime - A string containing lexical representation of xsd:datetime.
Returns:
A Calendar object represented by the string argument.

parseDecimal

public BigDecimal parseDecimal(String lexicalXSDDecimal)

Converts the string argument into a BigDecimal value.

Parameters:
lexicalXSDDecimal - A string containing lexical representation of xsd:decimal.
Returns:
A BigDecimal value represented by the string argument.

parseDouble

public double parseDouble(String lexicalXSDDouble)

Converts the string argument into a double value.

Parameters:
lexicalXSDDouble - A string containing lexical representation of xsd:double.
Returns:
A double value represented by the string argument.

parseFloat

public float parseFloat(String lexicalXSDFloat)

Converts the string argument into a float value.

Parameters:
lexicalXSDFloat - A string containing lexical representation of xsd:float.
Returns:
A float value represented by the string argument.

parseHexBinary

public byte[] parseHexBinary(String lexicalXSDHexBinary)

Converts the string argument into an array of bytes.

Parameters:
lexicalXSDHexBinary - A string containing lexical representation of xsd:hexBinary.
Returns:
An array of bytes represented by the string argument.

parseInt

public int parseInt(String lexicalXSDInt)

Convert the string argument into an int value.

Parameters:
lexicalXSDInt - A string containing a lexical representation of xsd:int.
Returns:
An int value represented byte the string argument.

parseInteger

public BigInteger parseInteger(String lexicalXSDInteger)

Convert the string argument into a BigInteger value.

Parameters:
lexicalXSDInteger - A string containing a lexical representation of xsd:integer.
Returns:
A BigInteger value represented by the string argument.

parseLong

public long parseLong(String lexicalXSDLong)

Converts the string argument into a long value.

Parameters:
lexicalXSDLong - A string containing lexical representation of xsd:long.
Returns:
A long value represented by the string argument.

parseQName

public QName parseQName(String lexicalXSDQName,
                        NamespaceContext nsc)

Converts the string argument into a QName value.

String parameter lexicalXSDQname must conform to lexical value space specifed at XML Schema Part 2:Datatypes specification:QNames

Parameters:
lexicalXSDQName - A string containing lexical representation of xsd:QName.
nsc - A namespace context for interpreting a prefix within a QName.
Returns:
A QName value represented by the string argument.

parseShort

public short parseShort(String lexicalXSDShort)

Converts the string argument into a short value.

Parameters:
lexicalXSDShort - A string containing lexical representation of xsd:short.
Returns:
A short value represented by the string argument.

parseString

public String parseString(String lexicalXSDString)

Convert the string argument into a string.

Parameters:
lexicalXSDString - A lexical representation of the XML Schema datatype xsd:string
Returns:
A string that is the same as the input string.

parseTime

public Calendar parseTime(String lexicalXSDTime)

Converts the string argument into a Calendar value.

Parameters:
lexicalXSDTime - A string containing lexical representation of xsd:Time.
Returns:
A Calendar value represented by the string argument.

parseUnsignedInt

public long parseUnsignedInt(String lexicalXSDUnsignedInt)

Converts the string argument into a long value.

Parameters:
lexicalXSDUnsignedInt - A string containing lexical representation of xsd:unsignedInt.
Returns:
A long value represented by the string argument.

parseUnsignedShort

public int parseUnsignedShort(String lexicalXSDUnsignedShort)

Converts the string argument into an int value.

Parameters:
lexicalXSDUnsignedShort - A string containing lexical representation of xsd:unsignedShort.
Returns:
An int value represented by the string argument.

printAnySimpleType

public String printAnySimpleType(String val)

Converts a string value into a string.

Parameters:
val - A string value
Returns:
A string containing a lexical representation of xsd:AnySimpleType

printBase64Binary

public String printBase64Binary(byte[] val)

Converts an array of bytes into a string.

Parameters:
val - an array of bytes
Returns:
A string containing a lexical representation of xsd:base64Binary

printBoolean

public String printBoolean(boolean val)

Converts a boolean value into a string.

Parameters:
val - A boolean value
Returns:
A string containing a lexical representation of xsd:boolean

printByte

public String printByte(byte val)

Converts a byte value into a string.

Parameters:
val - A byte value
Returns:
A string containing a lexical representation of xsd:byte

printDate

public String printDate(Calendar val)

Converts a Calendar value into a string.

Parameters:
val - A Calendar value
Returns:
A string containing a lexical representation of xsd:date

printDateTime

public String printDateTime(Calendar val)

Converts a Calendar value into a string.

Parameters:
val - A Calendar value
Returns:
A string containing a lexical representation of xsd:dateTime

printDecimal

public String printDecimal(BigDecimal val)

Converts a BigDecimal value into a string.

Parameters:
val - A BigDecimal value
Returns:
A string containing a lexical representation of xsd:decimal

printDouble

public String printDouble(double val)

Converts a double value into a string.

Parameters:
val - A double value
Returns:
A string containing a lexical representation of xsd:double

printFloat

public String printFloat(float val)

Converts a float value into a string.

Parameters:
val - A float value
Returns:
A string containing a lexical representation of xsd:float

printHexBinary

public String printHexBinary(byte[] val)

Converts an array of bytes into a string.

Parameters:
val - an array of bytes
Returns:
A string containing a lexical representation of xsd:hexBinary

printInt

public String printInt(int val)

Converts an int value into a string.

Parameters:
val - An int value
Returns:
A string containing a lexical representation of xsd:int

printInteger

public String printInteger(BigInteger val)

Converts a BigInteger value into a string.

Parameters:
val - A BigInteger value
Returns:
A string containing a lexical representation of xsd:integer

printLong

public String printLong(long val)

Converts a long value into a string.

Parameters:
val - A long value
Returns:
A string containing a lexical representation of xsd:long

printQName

public String printQName(QName val,
                         NamespaceContext nsc)

Converts a QName instance into a string.

Parameters:
val - A QName value
nsc - A namespace context for interpreting a prefix within a QName.
Returns:
A string containing a lexical representation of QName

printShort

public String printShort(short val)

Converts a short value into a string.

Parameters:
val - A short value
Returns:
A string containing a lexical representation of xsd:short

printString

public String printString(String val)

Converts the string argument into a string.

Parameters:
val - A string value.
Returns:
A string containing a lexical representation of xsd:string

printTime

public String printTime(Calendar val)

Converts a Calendar value into a string.

Parameters:
val - A Calendar value
Returns:
A string containing a lexical representation of xsd:time

printUnsignedInt

public String printUnsignedInt(long val)

Converts a long value into a string.

Parameters:
val - A long value
Returns:
A string containing a lexical representation of xsd:unsignedInt

printUnsignedShort

public String printUnsignedShort(int val)

Converts an int value into a string.

Parameters:
val - An int value
Returns:
A string containing a lexical representation of xsd:unsignedShort


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.