Package org.glassfish.jaxb.runtime
Class DatatypeConverterImpl
java.lang.Object
org.glassfish.jaxb.runtime.DatatypeConverterImpl
- All Implemented Interfaces:
DatatypeConverterInterface
@Deprecated
public final class DatatypeConverterImpl
extends Object
implements DatatypeConverterInterface
Deprecated.
in JAXB 2.2.4 - use jakarta.xml.bind.DatatypeConverterImpl instead
or let us know why you can't
This class is the JAXB RI's default implementation of the
DatatypeConverterInterface.
When client applications specify the use of the static print/parse
methods in DatatypeConverter, it will delegate
to this class.
This class is responsible for whitespace normalization.
- Since:
- JAXB 1.0
- Author:
- Ryan Shoemaker, Martin Grebac
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]_parseBase64Binary(String text) Deprecated.static Boolean_parseBoolean(CharSequence literal) Deprecated.static byte_parseByte(CharSequence literal) Deprecated.static GregorianCalendarDeprecated.static BigDecimal_parseDecimal(CharSequence content) Deprecated.static double_parseDouble(CharSequence _val) Deprecated.static float_parseFloat(CharSequence _val) Deprecated.static intDeprecated.Faster but less robustString->intconversion.static BigIntegerDeprecated.static longDeprecated.static QName_parseQName(CharSequence text, NamespaceContext nsc) Deprecated.static shortDeprecated.static String_printBase64Binary(byte[] input) Deprecated.static String_printBase64Binary(byte[] input, int offset, int len) Deprecated.static int_printBase64Binary(byte[] input, int offset, int len, byte[] out, int ptr) Deprecated.Encodes a byte array into another byte array by first doing base64 encoding then encoding the result in ASCII.static int_printBase64Binary(byte[] input, int offset, int len, char[] buf, int ptr) Deprecated.Encodes a byte array into a char array by doing base64 encoding.static void_printBase64Binary(byte[] input, int offset, int len, XMLStreamWriter output) Deprecated.static String_printBoolean(boolean val) Deprecated.static String_printByte(byte val) Deprecated.static String_printDate(Calendar val) Deprecated.static String_printDateTime(Calendar val) Deprecated.static String_printDecimal(BigDecimal val) Deprecated.static String_printDouble(double v) Deprecated.static String_printFloat(float v) Deprecated.static String_printInt(int val) Deprecated.static String_printInteger(BigInteger val) Deprecated.static String_printLong(long val) Deprecated.static String_printQName(QName val, NamespaceContext nsc) Deprecated.static String_printShort(short val) Deprecated.static charencode(int i) Deprecated.static byteencodeByte(int i) Deprecated.static DatatypeFactoryDeprecated.parseAnySimpleType(String lexicalXSDAnySimpleType) Deprecated.byte[]parseBase64Binary(String lexicalXSDBase64Binary) Deprecated.booleanparseBoolean(String lexicalXSDBoolean) Deprecated.byteDeprecated.Deprecated.parseDateTime(String lexicalXSDDateTime) Deprecated.parseDecimal(String content) Deprecated.doubleparseDouble(String lexicalXSDDouble) Deprecated.floatparseFloat(String lexicalXSDFloat) Deprecated.byte[]Deprecated.intDeprecated.parseInteger(String lexicalXSDInteger) Deprecated.longDeprecated.parseQName(String lexicalXSDQName, NamespaceContext nsc) Deprecated.shortparseShort(String lexicalXSDShort) Deprecated.parseString(String lexicalXSDString) Deprecated.Deprecated.longparseUnsignedInt(String lexicalXSDUnsignedInt) Deprecated.intparseUnsignedShort(String lexicalXSDUnsignedShort) Deprecated.printAnySimpleType(String val) Deprecated.printBase64Binary(byte[] val) Deprecated.printBoolean(boolean val) Deprecated.printByte(byte val) Deprecated.Deprecated.printDateTime(Calendar val) Deprecated.printDecimal(BigDecimal val) Deprecated.printDouble(double v) Deprecated.printFloat(float v) Deprecated.printHexBinary(byte[] data) Deprecated.printInt(int val) Deprecated.printInteger(BigInteger val) Deprecated.printLong(long val) Deprecated.printQName(QName val, NamespaceContext nsc) Deprecated.printShort(short val) Deprecated.printString(String val) Deprecated.Deprecated.printUnsignedInt(long val) Deprecated.printUnsignedShort(int val) Deprecated.
-
Field Details
-
theInstance
Deprecated.
-
-
Constructor Details
-
DatatypeConverterImpl
protected DatatypeConverterImpl()Deprecated.
-
-
Method Details
-
_parseInteger
Deprecated. -
_printInteger
Deprecated. -
_parseInt
Deprecated.Faster but less robustString->intconversion. Note that:- XML Schema allows '+', but
Integer.valueOf(String)is not. - XML Schema allows leading and trailing (but not in-between) whitespaces.
Integer.valueOf(String)doesn't allow any.
- XML Schema allows '+', but
-
_parseLong
Deprecated. -
_parseShort
Deprecated. -
_printShort
Deprecated. -
_parseDecimal
Deprecated. -
_parseFloat
Deprecated. -
_printFloat
Deprecated. -
_parseDouble
Deprecated. -
_parseBoolean
Deprecated. -
_printBoolean
Deprecated. -
_parseByte
Deprecated. -
_printByte
Deprecated. -
_parseQName
Deprecated.- Returns:
- null if fails to convert.
-
_parseDateTime
Deprecated. -
_printDateTime
Deprecated. -
_printDate
Deprecated. -
_printInt
Deprecated. -
_printLong
Deprecated. -
_printDecimal
Deprecated. -
_printDouble
Deprecated. -
_printQName
Deprecated. -
_parseBase64Binary
Deprecated.- Parameters:
text- base64Binary data is likely to be long, and decoding requires each character to be accessed twice (once for counting length, another for decoding.) A benchmark showed that takingStringis faster, presumably because JIT can inline a lot of string access (with data of 1K chars, it was twice as fast)
-
encode
public static char encode(int i) Deprecated. -
encodeByte
public static byte encodeByte(int i) Deprecated. -
_printBase64Binary
Deprecated. -
_printBase64Binary
Deprecated. -
_printBase64Binary
public static int _printBase64Binary(byte[] input, int offset, int len, char[] buf, int ptr) Deprecated.Encodes a byte array into a char array by doing base64 encoding. The caller must supply a big enough buffer.- Returns:
- the value of
ptr+((len+2)/3)*4, which is the new offset in the output buffer where the further bytes should be placed.
-
_printBase64Binary
public static void _printBase64Binary(byte[] input, int offset, int len, XMLStreamWriter output) throws XMLStreamException Deprecated.- Throws:
XMLStreamException
-
_printBase64Binary
public static int _printBase64Binary(byte[] input, int offset, int len, byte[] out, int ptr) Deprecated.Encodes a byte array into another byte array by first doing base64 encoding then encoding the result in ASCII. The caller must supply a big enough buffer.- Returns:
- the value of
ptr+((len+2)/3)*4, which is the new offset in the output buffer where the further bytes should be placed.
-
getDatatypeFactory
Deprecated. -
parseString
Deprecated.Description copied from interface:DatatypeConverterInterfaceConvert the string argument into a string.- Specified by:
parseStringin interfaceDatatypeConverterInterface- Parameters:
lexicalXSDString- A lexical representation of the XML Schema datatype xsd:string- Returns:
- A string that is the same as the input string.
-
parseInteger
Deprecated.Description copied from interface:DatatypeConverterInterfaceConvert the string argument into a BigInteger value.- Specified by:
parseIntegerin interfaceDatatypeConverterInterface- Parameters:
lexicalXSDInteger- A string containing a lexical representation of xsd:integer.- Returns:
- A BigInteger value represented by the string argument.
-
printInteger
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts a BigInteger value into a string.- Specified by:
printIntegerin interfaceDatatypeConverterInterface- Parameters:
val- A BigInteger value- Returns:
- A string containing a lexical representation of xsd:integer
-
parseInt
Deprecated.Description copied from interface:DatatypeConverterInterfaceConvert the string argument into an int value.- Specified by:
parseIntin interfaceDatatypeConverterInterface- Parameters:
s- A string containing a lexical representation of xsd:int.- Returns:
- An int value represented byte the string argument.
-
parseLong
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts the string argument into a long value.- Specified by:
parseLongin interfaceDatatypeConverterInterface- Parameters:
lexicalXSLong- A string containing lexical representation of xsd:long.- Returns:
- A long value represented by the string argument.
-
parseShort
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts the string argument into a short value.- Specified by:
parseShortin interfaceDatatypeConverterInterface- Parameters:
lexicalXSDShort- A string containing lexical representation of xsd:short.- Returns:
- A short value represented by the string argument.
-
printShort
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts a short value into a string.- Specified by:
printShortin interfaceDatatypeConverterInterface- Parameters:
val- A short value- Returns:
- A string containing a lexical representation of xsd:short
-
parseDecimal
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts the string argument into a BigDecimal value.- Specified by:
parseDecimalin interfaceDatatypeConverterInterface- Parameters:
content- A string containing lexical representation of xsd:decimal.- Returns:
- A BigDecimal value represented by the string argument.
-
parseFloat
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts the string argument into a float value.- Specified by:
parseFloatin interfaceDatatypeConverterInterface- Parameters:
lexicalXSDFloat- A string containing lexical representation of xsd:float.- Returns:
- A float value represented by the string argument.
-
printFloat
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts a float value into a string.- Specified by:
printFloatin interfaceDatatypeConverterInterface- Parameters:
v- A float value- Returns:
- A string containing a lexical representation of xsd:float
-
parseDouble
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts the string argument into a double value.- Specified by:
parseDoublein interfaceDatatypeConverterInterface- Parameters:
lexicalXSDDouble- A string containing lexical representation of xsd:double.- Returns:
- A double value represented by the string argument.
-
parseBoolean
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts the string argument into a boolean value.- Specified by:
parseBooleanin interfaceDatatypeConverterInterface- Parameters:
lexicalXSDBoolean- A string containing lexical representation of xsd:boolean.- Returns:
- A boolean value represented by the string argument.
-
printBoolean
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts a boolean value into a string.- Specified by:
printBooleanin interfaceDatatypeConverterInterface- Parameters:
val- A boolean value- Returns:
- A string containing a lexical representation of xsd:boolean
-
parseByte
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts the string argument into a byte value.- Specified by:
parseBytein interfaceDatatypeConverterInterface- Parameters:
lexicalXSDByte- A string containing lexical representation of xsd:byte.- Returns:
- A byte value represented by the string argument.
-
printByte
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts a byte value into a string.- Specified by:
printBytein interfaceDatatypeConverterInterface- Parameters:
val- A byte value- Returns:
- A string containing a lexical representation of xsd:byte
-
parseQName
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts the string argument into a QName value.String parameter
lexicalXSDQnamemust conform to lexical value space specifed at XML Schema Part 2:Datatypes specification:QNames- Specified by:
parseQNamein interfaceDatatypeConverterInterface- 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.
-
parseDateTime
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts the string argument into a Calendar value.- Specified by:
parseDateTimein interfaceDatatypeConverterInterface- Parameters:
lexicalXSDDateTime- A string containing lexical representation of xsd:datetime.- Returns:
- A Calendar object represented by the string argument.
-
printDateTime
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts a Calendar value into a string.- Specified by:
printDateTimein interfaceDatatypeConverterInterface- Parameters:
val- A Calendar value- Returns:
- A string containing a lexical representation of xsd:dateTime
-
parseBase64Binary
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts the string argument into an array of bytes.- Specified by:
parseBase64Binaryin interfaceDatatypeConverterInterface- Parameters:
lexicalXSDBase64Binary- A string containing lexical representation of xsd:base64Binary.- Returns:
- An array of bytes represented by the string argument.
-
parseHexBinary
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts the string argument into an array of bytes.- Specified by:
parseHexBinaryin interfaceDatatypeConverterInterface- Parameters:
s- A string containing lexical representation of xsd:hexBinary.- Returns:
- An array of bytes represented by the string argument.
-
printHexBinary
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts an array of bytes into a string.- Specified by:
printHexBinaryin interfaceDatatypeConverterInterface- Parameters:
data- an array of bytes- Returns:
- A string containing a lexical representation of xsd:hexBinary
-
parseUnsignedInt
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts the string argument into a long value.- Specified by:
parseUnsignedIntin interfaceDatatypeConverterInterface- Parameters:
lexicalXSDUnsignedInt- A string containing lexical representation of xsd:unsignedInt.- Returns:
- A long value represented by the string argument.
-
printUnsignedInt
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts a long value into a string.- Specified by:
printUnsignedIntin interfaceDatatypeConverterInterface- Parameters:
val- A long value- Returns:
- A string containing a lexical representation of xsd:unsignedInt
-
parseUnsignedShort
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts the string argument into an int value.- Specified by:
parseUnsignedShortin interfaceDatatypeConverterInterface- Parameters:
lexicalXSDUnsignedShort- A string containing lexical representation of xsd:unsignedShort.- Returns:
- An int value represented by the string argument.
-
parseTime
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts the string argument into a Calendar value.- Specified by:
parseTimein interfaceDatatypeConverterInterface- Parameters:
lexicalXSDTime- A string containing lexical representation of xsd:Time.- Returns:
- A Calendar value represented by the string argument.
-
printTime
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts a Calendar value into a string.- Specified by:
printTimein interfaceDatatypeConverterInterface- Parameters:
val- A Calendar value- Returns:
- A string containing a lexical representation of xsd:time
-
parseDate
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts the string argument into a Calendar value.- Specified by:
parseDatein interfaceDatatypeConverterInterface- Parameters:
lexicalXSDDate- A string containing lexical representation of xsd:Date.- Returns:
- A Calendar value represented by the string argument.
-
printDate
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts a Calendar value into a string.- Specified by:
printDatein interfaceDatatypeConverterInterface- Parameters:
val- A Calendar value- Returns:
- A string containing a lexical representation of xsd:date
-
parseAnySimpleType
Deprecated.Description copied from interface:DatatypeConverterInterfaceReturn a string containing the lexical representation of the simple type.- Specified by:
parseAnySimpleTypein interfaceDatatypeConverterInterface- Parameters:
lexicalXSDAnySimpleType- A string containing lexical representation of the simple type.- Returns:
- A string containing the lexical representation of the simple type.
-
printString
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts the string argument into a string.- Specified by:
printStringin interfaceDatatypeConverterInterface- Parameters:
val- A string value.- Returns:
- A string containing a lexical representation of xsd:string
-
printInt
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts an int value into a string.- Specified by:
printIntin interfaceDatatypeConverterInterface- Parameters:
val- An int value- Returns:
- A string containing a lexical representation of xsd:int
-
printLong
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts a long value into a string.- Specified by:
printLongin interfaceDatatypeConverterInterface- Parameters:
val- A long value- Returns:
- A string containing a lexical representation of xsd:long
-
printDecimal
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts a BigDecimal value into a string.- Specified by:
printDecimalin interfaceDatatypeConverterInterface- Parameters:
val- A BigDecimal value- Returns:
- A string containing a lexical representation of xsd:decimal
-
printDouble
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts a double value into a string.- Specified by:
printDoublein interfaceDatatypeConverterInterface- Parameters:
v- A double value- Returns:
- A string containing a lexical representation of xsd:double
-
printQName
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts a QName instance into a string.- Specified by:
printQNamein interfaceDatatypeConverterInterface- Parameters:
val- A QName valuensc- A namespace context for interpreting a prefix within a QName.- Returns:
- A string containing a lexical representation of QName
-
printBase64Binary
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts an array of bytes into a string.- Specified by:
printBase64Binaryin interfaceDatatypeConverterInterface- Parameters:
val- an array of bytes- Returns:
- A string containing a lexical representation of xsd:base64Binary
-
printUnsignedShort
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts an int value into a string.- Specified by:
printUnsignedShortin interfaceDatatypeConverterInterface- Parameters:
val- An int value- Returns:
- A string containing a lexical representation of xsd:unsignedShort
-
printAnySimpleType
Deprecated.Description copied from interface:DatatypeConverterInterfaceConverts a string value into a string.- Specified by:
printAnySimpleTypein interfaceDatatypeConverterInterface- Parameters:
val- A string value- Returns:
- A string containing a lexical representation of xsd:AnySimpleType
-