com.sun.xml.bind
public final class DatatypeConverterImpl extends Object implements 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: JAXB1.0
| Field Summary | |
|---|---|
| static DatatypeConverterInterface | theInstance
To avoid re-creating instances, we cache one instance. |
| Constructor Summary | |
|---|---|
| protected | DatatypeConverterImpl() |
| Method Summary | |
|---|---|
| static char | encode(int i) |
| static byte | encodeByte(int i) |
| static String | installHook(String s)
Just return the string passed as a parameter but
installs an instance of this class as the DatatypeConverter
implementation. |
| String | parseAnySimpleType(String lexicalXSDAnySimpleType) |
| byte[] | parseBase64Binary(String lexicalXSDBase64Binary) |
| boolean | parseBoolean(String lexicalXSDBoolean) |
| byte | parseByte(String lexicalXSDByte) |
| Calendar | parseDate(String lexicalXSDDate) |
| Calendar | parseDateTime(String lexicalXSDDateTime) |
| BigDecimal | parseDecimal(String content) |
| double | parseDouble(String lexicalXSDDouble) |
| float | parseFloat(String lexicalXSDFloat) |
| byte[] | parseHexBinary(String s) |
| int | parseInt(String s) |
| BigInteger | parseInteger(String lexicalXSDInteger) |
| long | parseLong(String lexicalXSLong) |
| QName | parseQName(String lexicalXSDQName, NamespaceContext nsc) |
| short | parseShort(String lexicalXSDShort) |
| String | parseString(String lexicalXSDString) |
| Calendar | parseTime(String lexicalXSDTime) |
| long | parseUnsignedInt(String lexicalXSDUnsignedInt) |
| int | parseUnsignedShort(String lexicalXSDUnsignedShort) |
| String | printAnySimpleType(String val) |
| String | printBase64Binary(byte[] val) |
| String | printBoolean(boolean val) |
| String | printByte(byte val) |
| String | printDate(Calendar val) |
| String | printDateTime(Calendar val) |
| String | printDecimal(BigDecimal val) |
| String | printDouble(double v) |
| String | printFloat(float v) |
| String | printHexBinary(byte[] data) |
| String | printInt(int val) |
| String | printInteger(BigInteger val) |
| String | printLong(long val) |
| String | printQName(QName val, NamespaceContext nsc) |
| String | printShort(short val) |
| String | printString(String val) |
| String | printTime(Calendar val) |
| String | printUnsignedInt(long val) |
| String | printUnsignedShort(int val) |
| static byte[] | _parseBase64Binary(String text) |
| static Boolean | _parseBoolean(CharSequence literal) |
| static byte | _parseByte(CharSequence literal) |
| static GregorianCalendar | _parseDateTime(CharSequence s) |
| static BigDecimal | _parseDecimal(CharSequence content) |
| static double | _parseDouble(CharSequence _val) |
| static float | _parseFloat(CharSequence _val) |
| static int | _parseInt(CharSequence s)
Faster but less robust String->int conversion.
|
| static BigInteger | _parseInteger(CharSequence s) |
| static long | _parseLong(CharSequence s) |
| static QName | _parseQName(CharSequence text, NamespaceContext nsc) |
| static short | _parseShort(CharSequence s) |
| static String | _printBase64Binary(byte[] input) |
| static String | _printBase64Binary(byte[] input, int offset, int len) |
| static int | _printBase64Binary(byte[] input, int offset, int len, char[] buf, int ptr)
Encodes a byte array into a char array by doing base64 encoding.
|
| static int | _printBase64Binary(byte[] input, int offset, int len, byte[] out, int ptr)
Encodes a byte array into another byte array by first doing base64 encoding
then encoding the result in ASCII.
|
| static String | _printBoolean(boolean val) |
| static String | _printByte(byte val) |
| static String | _printDate(Calendar val) |
| static String | _printDateTime(Calendar val) |
| static String | _printDecimal(BigDecimal val) |
| static String | _printDouble(double v) |
| static String | _printFloat(float v) |
| static String | _printInt(int val) |
| static String | _printInteger(BigInteger val) |
| static String | _printLong(long val) |
| static String | _printQName(QName val, NamespaceContext nsc) |
| static String | _printShort(short val) |
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 taking String is faster, presumably because JIT can inline a lot of string access (with data of 1K chars, it was twice as fast)
Returns: null if fails to convert.
Returns: the value of {@code ptr+((len+2)/3)*4}, which is the new offset in the output buffer where the further bytes should be placed.
Returns: the value of {@code ptr+((len+2)/3)*4}, which is the new offset in the output buffer where the further bytes should be placed.