Jackson JSON Processor
  1. Jackson JSON Processor
  2. JACKSON-109

Add support for deserializing to generic types beyond Collection and Map

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.1
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      (from mailing list, reported by Stefan Kostopoulos)

      Currently Jackson only deserializes to generic types Map<K,V> and Collection<V> (and their sub-classes).
      But any other generic types (like MyClass<T>) are treated with no regards to generic type, as if just using basic type-erased classes.
      This should be changed so that all generic information is properly used for resolving types via generic methdods; as long as root type is given using TypeReference.

        Activity

        Hide
        Tatu Saloranta added a comment -

        Added first parts of solution – unit test to point out simplest problematic case; resolution of mapping from formal type variables into declared type – but bigger change is to pipe through this context to use when resolving field and method types.

        Show
        Tatu Saloranta added a comment - Added first parts of solution – unit test to point out simplest problematic case; resolution of mapping from formal type variables into declared type – but bigger change is to pipe through this context to use when resolving field and method types.
        Hide
        Tatu Saloranta added a comment -

        Added support for general generic types, unit tests to verify. Also improved handling of TypeVariables so that unresolved parameters will cause an exception to be thrown.

        Show
        Tatu Saloranta added a comment - Added support for general generic types, unit tests to verify. Also improved handling of TypeVariables so that unresolved parameters will cause an exception to be thrown.
        Hide
        Tatu Saloranta added a comment -

        Included in 1.1.0 release.

        Show
        Tatu Saloranta added a comment - Included in 1.1.0 release.

          People

          • Assignee:
            Tatu Saloranta
            Reporter:
            Tatu Saloranta
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: