public interface DatatypeConverterInterface (Code)
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
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
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.
Return a string containing the lexical representation of the
simple type.
Parameters: lexicalXSDAnySimpleType - A string containing lexical representation of the simple type.A string containing the lexical representation of the simple type.
parseBase64Binary
public byte[] parseBase64Binary(String lexicalXSDBase64Binary)(Code)
Converts the string argument into an array of bytes.
Parameters: lexicalXSDBase64Binary - A string containing lexical representationof xsd:base64Binary.An array of bytes represented by the string argument. throws: IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:base64Binary
parseBoolean
public boolean parseBoolean(String lexicalXSDBoolean)(Code)
Converts the string argument into a boolean value.
Parameters: lexicalXSDBoolean - A string containing lexical representation ofxsd:boolean.A boolean value represented by the string argument. throws: IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:boolean.
parseByte
public byte parseByte(String lexicalXSDByte)(Code)
Converts the string argument into a byte value.
Parameters: lexicalXSDByte - A string containing lexical representation ofxsd:byte.A byte value represented by the string argument. throws: NumberFormatException - lexicalXSDByte does not contain a parseable byte. throws: IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:byte.
Converts the string argument into a Calendar value.
Parameters: lexicalXSDDate - A string containing lexical representation ofxsd:Date.A Calendar value represented by the string argument. throws: IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Date.
Converts the string argument into a Calendar value.
Parameters: lexicalXSDDateTime - A string containing lexical representation ofxsd:datetime.A Calendar object represented by the string argument. throws: IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:dateTime.
Converts the string argument into a BigDecimal value.
Parameters: lexicalXSDDecimal - A string containing lexical representation ofxsd:decimal.A BigDecimal value represented by the string argument. throws: NumberFormatException - lexicalXSDDecimal is not a valid string representation of java.math.BigDecimal.
parseDouble
public double parseDouble(String lexicalXSDDouble)(Code)
Converts the string argument into a double value.
Parameters: lexicalXSDDouble - A string containing lexical representation ofxsd:double.A double value represented by the string argument. throws: NumberFormatException - lexicalXSDDouble is not a valid string representation of a double value.
parseFloat
public float parseFloat(String lexicalXSDFloat)(Code)
Converts the string argument into a float value.
Parameters: lexicalXSDFloat - A string containing lexical representation ofxsd:float.A float value represented by the string argument. throws: NumberFormatException - lexicalXSDFloat is not a valid string representation of a float value.
parseHexBinary
public byte[] parseHexBinary(String lexicalXSDHexBinary)(Code)
Converts the string argument into an array of bytes.
Parameters: lexicalXSDHexBinary - A string containing lexical representation ofxsd:hexBinary.An array of bytes represented by the string argument. throws: IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:hexBinary.
Convert the string argument into an int value.
Parameters: lexicalXSDInt - A string containing a lexical representation ofxsd:int.An int value represented byte the string argument. throws: NumberFormatException - lexicalXSDInt is not a valid string representation of an int value.
Convert the string argument into a BigInteger value.
Parameters: lexicalXSDInteger - A string containing a lexical representation ofxsd:integer.A BigInteger value represented by the string argument. throws: NumberFormatException - lexicalXSDInteger is not a valid string representation of a java.math.BigInteger value.
parseLong
public long parseLong(String lexicalXSDLong)(Code)
Converts the string argument into a long value.
Parameters: lexicalXSDLong - A string containing lexical representation ofxsd:long.A long value represented by the string argument. throws: NumberFormatException - lexicalXSDLong is not a valid string representation of a long 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. Parameters: nsc - A namespace context for interpreting a prefix within a QName.A QName value represented by the string argument. throws: IllegalArgumentException - if string parameter does not conform to XML Schema Part 2 specification or if namespace prefix of lexicalXSDQname is not bound to a URI in NamespaceContext nsc.
parseShort
public short parseShort(String lexicalXSDShort)(Code)
Converts the string argument into a short value.
Parameters: lexicalXSDShort - A string containing lexical representation ofxsd:short.A short value represented by the string argument. throws: NumberFormatException - lexicalXSDShort is not a valid string representation of a short value.
Convert the string argument into a string.
Parameters: lexicalXSDString - A lexical representation of the XML Schema datatype xsd:stringA string that is the same as the input string.
Converts the string argument into a Calendar value.
Parameters: lexicalXSDTime - A string containing lexical representation ofxsd:Time.A Calendar value represented by the string argument. throws: IllegalArgumentException - if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Time.
parseUnsignedInt
public long parseUnsignedInt(String lexicalXSDUnsignedInt)(Code)
Converts the string argument into a long value.
Parameters: lexicalXSDUnsignedInt - A string containing lexical representationof xsd:unsignedInt.A long value represented by the string argument. throws: NumberFormatException - if string parameter can not be parsed into a long value.
parseUnsignedShort
public int parseUnsignedShort(String lexicalXSDUnsignedShort)(Code)
Converts the string argument into an int value.
Parameters: lexicalXSDUnsignedShort - A string containing lexicalrepresentation of xsd:unsignedShort.An int value represented by the string argument. throws: NumberFormatException - if string parameter can not be parsed into an int value.
Converts an array of bytes into a string.
Parameters: val - an array of bytesA string containing a lexical representation of xsd:base64Binary throws: IllegalArgumentException - if val is null.
Converts a Calendar value into a string.
Parameters: val - A Calendar valueA string containing a lexical representation of xsd:date throws: IllegalArgumentException - if val is null.
Converts a Calendar value into a string.
Parameters: val - A Calendar valueA string containing a lexical representation of xsd:dateTime throws: IllegalArgumentException - if val is null.
Converts a BigDecimal value into a string.
Parameters: val - A BigDecimal valueA string containing a lexical representation of xsd:decimal throws: IllegalArgumentException - val is null.
Converts an array of bytes into a string.
Parameters: val - an array of bytesA string containing a lexical representation of xsd:hexBinary throws: IllegalArgumentException - if val is null.
Converts a BigInteger value into a string.
Parameters: val - A BigInteger valueA string containing a lexical representation of xsd:integer throws: IllegalArgumentException - val is null.
Converts a QName instance into a string.
Parameters: val - A QName value Parameters: nsc - A namespace context for interpreting a prefix within a QName.A string containing a lexical representation of QName throws: IllegalArgumentException - if val is null or if nsc is non-null or nsc.getPrefix(nsprefixFromVal) is null.
Converts a Calendar value into a string.
Parameters: val - A Calendar valueA string containing a lexical representation of xsd:time throws: IllegalArgumentException - if val is null.