You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2015/03/10 23:51:39 UTC
[jira] [Commented] (CXF-6287) JAX-RS client should use Enum.value()
instead of toString()
[ https://issues.apache.org/jira/browse/CXF-6287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14355884#comment-14355884 ]
Sergey Beryozkin commented on CXF-6287:
---------------------------------------
This is not obvious to me that it should be a default behaviour - in some cases fromString() is used to recreate the enum instance so value() -> fromString would not work. I'll do a brief review of this issue a bit later on. Perhaps if no fromString() static method exists then value() can be tried...
> JAX-RS client should use Enum.value() instead of toString()
> -----------------------------------------------------------
>
> Key: CXF-6287
> URL: https://issues.apache.org/jira/browse/CXF-6287
> Project: CXF
> Issue Type: Improvement
> Components: JAX-RS
> Affects Versions: 3.0.4
> Reporter: Dhiraj Bokde
> Priority: Minor
>
> A JAX-RS endpoints that uses an JAXB enumeration as a parameter marshals it using {{toString()}} instead of its {{public String value()} method.
> This results in invalid values being marshaled for values, such as {{STATUS_UPDATE}} instead of {{status-update}}.
> This requires writing a custom enumeration ParamConverterProvider. Since all JAXB enumerations follow standard method patterns for marshaling {{public String value()}} and unmarshaling {{public static T fromValue(String value)}}, they should be handled by CXF by default.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)