/** * Deserialize time from text. Time values obey the rules of the time portion of a dataTime * value. This method follows standard JiBX deserializer usage requirements by accepting a * <code>null</code> input. * * @param text text to be parsed (may be <code>null</code>) * @return converted time, or <code>null</code> if passed <code>null</code> input * @throws IllegalArgumentException on parse error */ public static Time deserializeSqlTime(String text) throws IllegalArgumentException { if (text == null) { return null; } else { return new Time(parseTime(text, 0, text.length())); } }
/** * Parse general dateTime value from text. Date values are expected to be in W3C XML Schema * standard format as CCYY-MM-DDThh:mm:ss.fff, with optional leading sign and trailing time * zone. * * @param text text to be parsed * @return converted date as millisecond value * @throws IllegalArgumentException on parse error */ public static long parseDateTime(String text) throws IllegalArgumentException { // split text to convert portions separately int split = text.indexOf('T'); if (split < 0) { throw new IllegalArgumentException("Missing 'T' separator in dateTime"); } return parseDate(text.substring(0, split)) + parseTime(text, split + 1, text.length()); }
/** * Deserialize time from text. Time values obey the rules of the time * portion of a dataTime value. This method follows standard JiBX * deserializer usage requirements by accepting a <code>null</code> input. * * @param text text to be parsed (may be <code>null</code>) * * @return converted time, or <code>null</code> if passed <code>null</code> * input * * @throws IllegalArgumentException on parse error */ public static Time deserializeSqlTime(String text) throws IllegalArgumentException { if (text == null) { return null; } else { return new Time(parseTime(text, 0, text.length())); } }
/** * Deserialize time from text. Time values obey the rules of the time * portion of a dataTime value. This method follows standard JiBX * deserializer usage requirements by accepting a <code>null</code> input. * * @param text text to be parsed (may be <code>null</code>) * * @return converted time, or <code>null</code> if passed <code>null</code> * input * * @throws IllegalArgumentException on parse error */ public static Time deserializeSqlTime(String text) throws IllegalArgumentException { if (text == null) { return null; } else { return new Time(parseTime(text, 0, text.length())); } }
/** * Parse general dateTime value from text. Date values are expected to be * in W3C XML Schema standard format as CCYY-MM-DDThh:mm:ss.fff, with * optional leading sign and trailing time zone. * * @param text text to be parsed * * @return converted date as millisecond value * * @throws IllegalArgumentException on parse error */ public static long parseDateTime(String text) throws IllegalArgumentException { // split text to convert portions separately int split = text.indexOf('T'); if (split < 0) { throw new IllegalArgumentException( "Missing 'T' separator in dateTime"); } return parseDate(text.substring(0, split)) + parseTime(text, split + 1, text.length()); }
/** * Parse general dateTime value from text. Date values are expected to be * in W3C XML Schema standard format as CCYY-MM-DDThh:mm:ss.fff, with * optional leading sign and trailing time zone. * * @param text text to be parsed * * @return converted date as millisecond value * * @throws IllegalArgumentException on parse error */ public static long parseDateTime(String text) throws IllegalArgumentException { // split text to convert portions separately int split = text.indexOf('T'); if (split < 0) { throw new IllegalArgumentException( "Missing 'T' separator in dateTime"); } return parseDate(text.substring(0, split)) + parseTime(text, split + 1, text.length()); }