johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Struberg (JIRA)" <j...@apache.org>
Subject [jira] [Created] (JOHNZON-162) support 'implicit converters' for certain types
Date Fri, 16 Mar 2018 15:50:00 GMT
Mark Struberg created JOHNZON-162:
-------------------------------------

             Summary: support 'implicit converters' for certain types
                 Key: JOHNZON-162
                 URL: https://issues.apache.org/jira/browse/JOHNZON-162
             Project: Johnzon
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.1.7
            Reporter: Mark Struberg
            Assignee: Mark Struberg


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]


{quote}
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
{quote}

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



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message