Uploaded image for project: 'Johnzon'
  1. Johnzon
  2. JOHNZON-162

support 'implicit converters' for certain types

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 1.1.7
    • None
    • JSON-B, Mapper
    • None

    Description

      We've got a great pull request via github https://github.com/apache/johnzon/pull/15

      While the patch is fine I want to still stretch out and implement a feature we similarly added to the ConfigJSR:

      https://github.com/eclipse/ConfigJSR/blob/master/api/src/main/java/javax/config/spi/Converter.java#L59

      If no explicit Converter and no built-in Converter could be found for a certain type,
      the {@code Config} provides an <em>Implicit Converter</em>, if

      • The target type {@code T} has a Constructor with a String parameter, or
      • The target type {@code T} has a Constructor with a CharSequence parameter, or
      • the target type {@code T} has a {@code static T valueOf(String)} method, or
      • the target type {@code T} has a {@code static T valueOf(CharSequence)} method, or
      • the target type {@code T} has a {@code static T parse(String)} method, or
      • the target type {@code T} has a {@code static T parse(CharSequence)} method

      Since all the java8 time types DO implement one of those signatures we don't need anything more.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            struberg Mark Struberg
            struberg Mark Struberg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment