Instead use java. SimpleDateFormat like this:. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow.
Learn more. Asked 9 years, 7 months ago. Active 9 years, 7 months ago. Viewed 5k times. Add a comment. Active Oldest Votes. Calendar; import java. TimeZone; import java. Parameters: val - A string value. Returns: A string containing a lexical representation of xsd:string. Parameters: val - An int value Returns: A string containing a lexical representation of xsd:int printLong public static 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 printShort public static 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 printDecimal public static String printDecimal BigDecimal val Converts a BigDecimal value into a string.
Parameters: val - A float value Returns: A string containing a lexical representation of xsd:float printDouble public static 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 printBoolean public static 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 static String printByte byte val Converts a byte value into a string.
Returns: A string containing a lexical representation of QName Throws: IllegalArgumentException - if val is null or if nsc is non-null or nsc. Parameters: val - An array of bytes Returns: A string containing a lexical representation of xsd:base64Binary Throws: IllegalArgumentException - if val is null. Parameters: val - An array of bytes Returns: A string containing a lexical representation of xsd:hexBinary Throws: IllegalArgumentException - if val is null.
Parameters: val - A long value Returns: A string containing a lexical representation of xsd:unsignedInt printUnsignedShort public static 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 printTime public static 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 Throws: IllegalArgumentException - if val is null.
Parameters: val - A Calendar value Returns: A string containing a lexical representation of xsd:date Throws: IllegalArgumentException - if val is null. All rights reserved. Use is subject to license terms. Scripting on this page tracks web page traffic, but does not change the content in any way. The javaType binding declaration can be used to customize the binding of an XML schema datatype to a Java datatype.
Customizations can involve writing a parse and print method for parsing and printing lexical representations of a XML schema datatype respectively. However, writing parse and print methods requires knowledge of the lexical representations XML Schema Part2: Datatypes specification and hence may be difficult to write. This class makes it easier to write parse and print methods. It defines static parse and print methods that provide access to a JAXB provider's implementation of parse and print methods.
These methods are invoked by custom parse and print methods. The static methods defined in the class can also be used to specify a parse or a print method in a javaType binding declaration. This step is necessary to configure the converter that should be used to perform the print and parse functionality. 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.
Since: JAXB1. Joe Fialli, Sun Microsystems Inc. Kohsuke Kawaguchi, Sun Microsystems, Inc. Ryan Shoemaker,Sun Microsystems Inc. String parseAnySimpleType java. Calendar parseDate java. Calendar parseDateTime java. BigDecimal parseDecimal java. BigInteger parseInteger java. QName parseQName java. NamespaceContext nsc Converts the string argument into a byte value. String parseString java. Calendar parseTime java. String printAnySimpleType java.
String val 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 printDate java. Calendar val Converts a Calendar value into a string.
0コメント