The DatatypeConverterInterface is for Jakarta XML Binding provider use only. A
Jakarta XML Binding provider must supply a class that implements this interface.
Jakarta XML Binding Providers are required to call the
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 Jakarta XML Binding specification.
The parse and print methods defined here are invoked by the static parse
and print methods defined in the 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.
DatatypeConverter, ParseConversionEvent, PrintConversionEvent
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: A string containing the lexical representation of the simple type.A string containing lexical
representation of the simple type. lexicalXSDAnySimpleType)Return a string containing the lexical representation of the simple type. |
| public byte[] | Returns: An array of bytes represented by the string argument.A string containing lexical representation
of xsd:base64Binary. lexicalXSDBase64Binary)Converts the string argument into an array of bytes. |
| public boolean | Returns: A boolean value represented by the string argument.A string containing lexical representation of
xsd:boolean. lexicalXSDBoolean)Converts the string argument into a boolean value. |
| public byte | |
| public Calendar | |
| public Calendar | Returns: A Calendar object represented by the string argument.A string containing lexical representation of
xsd:datetime. lexicalXSDDateTime)Converts the string argument into a Calendar value. |
| public BigDecimal | Returns: A BigDecimal value represented by the string argument.A string containing lexical representation of
xsd:decimal. lexicalXSDDecimal)Converts the string argument into a BigDecimal value. |
| public double | Returns: A double value represented by the string argument.A string containing lexical representation of
xsd:double. lexicalXSDDouble)Converts the string argument into a double value. |
| public float | Returns: A float value represented by the string argument.A string containing lexical representation of
xsd:float. lexicalXSDFloat)Converts the string argument into a float value. |
| public byte[] | Returns: An array of bytes represented by the string argument.A string containing lexical representation of
xsd:hexBinary. lexicalXSDHexBinary)Converts the string argument into an array of bytes. |
| public int | |
| public BigInteger | Returns: A BigInteger value represented by the string argument.A string containing a lexical representation of
xsd:integer. lexicalXSDInteger)Convert the string argument into a BigInteger value. |
| public long | |
| public QName | Returns: A QName value represented by the string argument.A string containing lexical representation of xsd:QName. lexicalXSDQName, NamespaceContext A namespace context for interpreting a prefix within a QName. nsc)Converts the string argument into a QName value. |
| public short | Returns: A short value represented by the string argument.A string containing lexical representation of
xsd:short. lexicalXSDShort)Converts the string argument into a short value. |
| public String | Returns: A string that is the same as the input string.A lexical representation of the XML Schema datatype xsd:string lexicalXSDString)Convert the string argument into a string. |
| public Calendar | |
| public long | Returns: A long value represented by the string argument.A string containing lexical representation
of xsd:unsignedInt. lexicalXSDUnsignedInt)Converts the string argument into a long value. |
| public int | Returns: An int value represented by the string argument.A string containing lexical
representation of xsd:unsignedShort. lexicalXSDUnsignedShort)Converts the string argument into an int value. |
| public String | Returns: A string containing a lexical representation of xsd:AnySimpleTypeA string value val)Converts a string value into a string. |
| public String | Returns: A string containing a lexical representation of xsd:base64Binaryan array of bytes val)Converts an array of bytes into a string. |
| public String | Returns: A string containing a lexical representation of xsd:booleanA boolean value val)Converts a boolean value into a string. |
| public String | Returns: A string containing a lexical representation of xsd:byteA byte value val)Converts a byte value into a string. |
| public String | |
| public String | Returns: A string containing a lexical representation of xsd:dateTimeA Calendar value val)Converts a Calendar value into a string. |
| public String | Returns: A string containing a lexical representation of xsd:decimalA BigDecimal value val)Converts a BigDecimal value into a string. |
| public String | Returns: A string containing a lexical representation of xsd:doubleA double value val)Converts a double value into a string. |
| public String | Returns: A string containing a lexical representation of xsd:floatA float value val)Converts a float value into a string. |
| public String | Returns: A string containing a lexical representation of xsd:hexBinaryan array of bytes val)Converts an array of bytes into a string. |
| public String | Returns: A string containing a lexical representation of xsd:intAn int value val)Converts an int value into a string. |
| public String | Returns: A string containing a lexical representation of xsd:integerA BigInteger value val)Converts a BigInteger value into a string. |
| public String | Returns: A string containing a lexical representation of xsd:longA long value val)Converts a long value into a string. |
| public String | Returns: A string containing a lexical representation of QNameA QName value val, NamespaceContext A namespace context for interpreting a prefix within a QName. nsc)Converts a QName instance into a string. |
| public String | Returns: A string containing a lexical representation of xsd:shortA short value val)Converts a short value into a string. |
| public String | Returns: A string containing a lexical representation of xsd:stringA string value. val)Converts the string argument into a string. |
| public String | |
| public String | Returns: A string containing a lexical representation of xsd:unsignedIntA long value val)Converts a long value into a string. |
| public String | Returns: A string containing a lexical representation of xsd:unsignedShortAn int value val)Converts an int value into a string. |
| parseAnySimpleType | back to summary |
|---|---|
| public String parseAnySimpleType(String lexicalXSDAnySimpleType) Return a string containing the lexical representation of the simple type. | |
| parseBase64Binary | back to summary |
|---|---|
| public byte[] parseBase64Binary(String lexicalXSDBase64Binary) Converts the string argument into an array of bytes.
| |
| parseBoolean | back to summary |
|---|---|
| public boolean parseBoolean(String lexicalXSDBoolean) Converts the string argument into a boolean value.
| |
| parseByte | back to summary |
|---|---|
| public byte parseByte(String lexicalXSDByte) Converts the string argument into a byte value.
| |
| parseDate | back to summary |
|---|---|
| public Calendar parseDate(String lexicalXSDDate) Converts the string argument into a Calendar value.
| |
| parseDateTime | back to summary |
|---|---|
| public Calendar parseDateTime(String lexicalXSDDateTime) Converts the string argument into a Calendar value.
| |
| parseDecimal | back to summary |
|---|---|
| public BigDecimal parseDecimal(String lexicalXSDDecimal) Converts the string argument into a BigDecimal value.
| |
| parseDouble | back to summary |
|---|---|
| public double parseDouble(String lexicalXSDDouble) Converts the string argument into a double value.
| |
| parseFloat | back to summary |
|---|---|
| public float parseFloat(String lexicalXSDFloat) Converts the string argument into a float value.
| |
| parseHexBinary | back to summary |
|---|---|
| public byte[] parseHexBinary(String lexicalXSDHexBinary) Converts the string argument into an array of bytes.
| |
| parseInt | back to summary |
|---|---|
| public int parseInt(String lexicalXSDInt) Convert the string argument into an int value.
| |
| parseInteger | back to summary |
|---|---|
| public BigInteger parseInteger(String lexicalXSDInteger) Convert the string argument into a BigInteger value.
| |
| parseLong | back to summary |
|---|---|
| public long parseLong(String lexicalXSDLong) Converts the string argument into a long value.
| |
| parseQName | back to summary |
|---|---|
| public QName parseQName(String lexicalXSDQName, NamespaceContext nsc) Converts the string argument into a QName value.
String parameter
| |
| parseShort | back to summary |
|---|---|
| public short parseShort(String lexicalXSDShort) Converts the string argument into a short value.
| |
| parseString | back to summary |
|---|---|
| public String parseString(String lexicalXSDString) Convert the string argument into a string. | |
| parseTime | back to summary |
|---|---|
| public Calendar parseTime(String lexicalXSDTime) Converts the string argument into a Calendar value.
| |
| parseUnsignedInt | back to summary |
|---|---|
| public long parseUnsignedInt(String lexicalXSDUnsignedInt) Converts the string argument into a long value.
| |
| parseUnsignedShort | back to summary |
|---|---|
| public int parseUnsignedShort(String lexicalXSDUnsignedShort) Converts the string argument into an int value.
| |
| printAnySimpleType | back to summary |
|---|---|
| public String printAnySimpleType(String val) Converts a string value into a string. | |
| printBase64Binary | back to summary |
|---|---|
| public String printBase64Binary(byte[] val) Converts an array of bytes into a string.
| |
| printBoolean | back to summary |
|---|---|
| public String printBoolean(boolean val) Converts a boolean value into a string.
| |
| printByte | back to summary |
|---|---|
| public String printByte(byte val) Converts a byte value into a string.
| |
| printDate | back to summary |
|---|---|
| public String printDate(Calendar val) Converts a Calendar value into a string.
| |
| printDateTime | back to summary |
|---|---|
| public String printDateTime(Calendar val) Converts a Calendar value into a string.
| |
| printDecimal | back to summary |
|---|---|
| public String printDecimal(BigDecimal val) Converts a BigDecimal value into a string.
| |
| printDouble | back to summary |
|---|---|
| public String printDouble(double val) Converts a double value into a string.
| |
| printFloat | back to summary |
|---|---|
| public String printFloat(float val) Converts a float value into a string.
| |
| printHexBinary | back to summary |
|---|---|
| public String printHexBinary(byte[] val) Converts an array of bytes into a string.
| |
| printInt | back to summary |
|---|---|
| public String printInt(int val) Converts an int value into a string.
| |
| printInteger | back to summary |
|---|---|
| public String printInteger(BigInteger val) Converts a BigInteger value into a string.
| |
| printLong | back to summary |
|---|---|
| public String printLong(long val) Converts a long value into a string.
| |
| printQName | back to summary |
|---|---|
| public String printQName(QName val, NamespaceContext nsc) Converts a QName instance into a string.
| |
| printShort | back to summary |
|---|---|
| public String printShort(short val) Converts a short value into a string.
| |
| printString | back to summary |
|---|---|
| public String printString(String val) Converts the string argument into a string. | |
| printTime | back to summary |
|---|---|
| public String printTime(Calendar val) Converts a Calendar value into a string.
| |
| printUnsignedInt | back to summary |
|---|---|
| public String printUnsignedInt(long val) Converts a long value into a string.
| |
| printUnsignedShort | back to summary |
|---|---|
| public String printUnsignedShort(int val) Converts an int value into a string.
| |