XStream
  1. XStream
  2. XSTR-98

Cannot parse java.sql.Date-formatted dates

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.2
    • Component/s: Converters
    • Labels:
      None

      Description

      The current date converter (com.thoughtworks.xstream.converters.basic.DateConverter) cannot parse the standard java.sql.Date format (yyyy-MM-dd), nor is there a way to "unregister" the existing the formatter and include my own.

      For example, the following XML cannot be parsed into an object:
      <Person>
      <Name>John Doe</Name> <---- String
      <DateOfBirth>1970-02-13</DateOfBirth> <---- java.util.Date
      </Person>

      To solve the formatting issue, the fix is trivial (simply add the new format to the list of formats, on line 19).

      However, it would be useful to be able to "unregister" the default converters, so that users could add back customized versions of the basic converters, if necessary (such as this date-formatting case).

        People

        • Assignee:
          Unassigned
          Reporter:
          James Schopp
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: