You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Konrad Windszus (JIRA)" <ji...@apache.org> on 2016/07/08 11:50:11 UTC

[jira] [Commented] (SLING-5825) Add support for implicit conversion of Enum to String

    [ https://issues.apache.org/jira/browse/SLING-5825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15367577#comment-15367577 ] 

Konrad Windszus commented on SLING-5825:
----------------------------------------

[~radu.cotescu] Is there any specific reason why you convert with {{Enum.name()}}, instead of {{Enum.toString()}}? I would prefer the latter, then you could easily overwrite that (see also http://stackoverflow.com/questions/18031125/what-is-the-difference-between-enum-name-and-enum-tostring)

> Add support for implicit conversion of Enum to String
> -----------------------------------------------------
>
>                 Key: SLING-5825
>                 URL: https://issues.apache.org/jira/browse/SLING-5825
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>    Affects Versions: Scripting Sightly Engine 1.0.2
>            Reporter: Konrad Windszus
>            Assignee: Radu Cotescu
>            Priority: Minor
>             Fix For: Scripting Sightly Engine 1.0.20
>
>
> Currently Sightly does not support implicit conversion from Enum to String like in 
> {code}
> <div class="${member.inviteStatus}">...</div>
> {code}
> The class attribute will always be empty in case when {{member.inviteStatus}} is an Enum.
> Instead you have to write
> {code}
> <div class="${member.inviteStatus.toString}">...</div>
> {code}
> Sightly should implicitly convert enums to Strings if they are just given out.
> This is similar to SLING-5053.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)