You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/07/06 21:28:11 UTC

[jira] [Commented] (SHIRO-425) Ability to set a property value with an enum in shiro.ini file

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

ASF GitHub Bot commented on SHIRO-425:
--------------------------------------

GitHub user bdemers opened a pull request:

    https://github.com/apache/shiro/pull/25

    WIP: Ability to set a property value with an enum in shiro.ini file

    SHIRO-425 (applied patch to master)
    This enum support could be limited to property only, but that might cause confusion.
    
    Currently supported via this patch:
    ```ini
    [main]
    myObject = com.foo.bar.Type
    myObject.enumProperty = ENUM_VALUE1
    ```
    
    This is really cool, but as a user I would also expect the following to work:
    ```ini
    [main]
    myObject = com.foo.bar.Type
    myObject.enumListProperty = ENUM_VALUE1, ENUM_VALUE2
    ```
    
    ```ini
    [main]
    myObject = com.foo.bar.Type
    myObject.enumMapProperty = one:ENUM_VALUE1, two:ENUM_VALUE2
    ```
    
    Granted the Map example might be a bit contrived, but less so for the list.
    
    I've added a test for this.
    
    Thoughts ?

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/bdemers/shiro enum-reflect

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/shiro/pull/25.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #25
    
----
commit e6bec6cd5ba426113cbb7c2804b9f429c6b098ac
Author: Brian Demers <bd...@apache.org>
Date:   2016-07-06T21:16:42Z

    SHIRO-425 Ability to set a property value with an enum in shiro.ini file

----


> Ability to set a property value with an enum in shiro.ini file
> --------------------------------------------------------------
>
>                 Key: SHIRO-425
>                 URL: https://issues.apache.org/jira/browse/SHIRO-425
>             Project: Shiro
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: 1.2.1
>            Reporter: Jérôme Leleu
>            Priority: Minor
>              Labels: patch, patch-with-test
>         Attachments: shiro425.patch
>
>
> If I try to set an object property value with an enum (myObject.p = ENUM_VALUE) in a shiro.ini file, I get an exception : org.apache.shiro.config.ConfigurationException: Unable to set property 'p' with value [ENUM_VALUE] on object of type myObject



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