You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Zdeněk Obst (JIRA)" <ji...@apache.org> on 2010/06/02 16:25:38 UTC

[jira] Created: (BEANUTILS-376) Supporting indexed (mapped) properties of Map objects

Supporting indexed (mapped) properties of Map objects
-----------------------------------------------------

                 Key: BEANUTILS-376
                 URL: https://issues.apache.org/jira/browse/BEANUTILS-376
             Project: Commons BeanUtils
          Issue Type: Improvement
          Components: Bean / Property Utils
         Environment: JDK1.5_22, WinXP
            Reporter: Zdeněk Obst
            Priority: Minor


So far, BeanUtils does not support indexed or mapped properties of Map object (PropertyUtilsBean.getPropertyOfMapBean(Map bean, String propertyName) )
and throw IllegalArgumentException.

For instance if you have Map<String, String[]> and you want to get property by calling propName[0] (or propName(0)), method isIndexed (isMapped) of DefaultResolver returns true which raises previously mentioned exception. From my point of view it seems that method gets data which needs and is possible to parse propertyName to get desired result.

E.g. something similar to:
if  (resolver.isIndexed(propertyName)) {
   String name = resolver.getProperty(propertyName);
   int idx = Integer.valueOf(resolver.getIndex(propertyName)); // handle NumberFormat exception by your way
   return bean.get(name)[idx]; // handle ArrayIndexOutOfBounds exception by your way
}

I was a bit surprised that I didn't find this issue in existing ones. I'm sorry if there is any which I omitted. 
Is it possible that this funcionality will be provided in any future release? Thank you

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (BEANUTILS-376) Supporting indexed (mapped) properties of Map objects

Posted by "Zdeněk Obst (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BEANUTILS-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zdeněk Obst updated BEANUTILS-376:
----------------------------------

    Description: 
So far, BeanUtils does not support indexed or mapped properties of Map object (PropertyUtilsBean.getPropertyOfMapBean(Map bean, String propertyName) )
and throw IllegalArgumentException.

For instance if you have Map<String, String[]> and you want to get property by calling propName[0] (or propName(0)), method isIndexed (isMapped) of DefaultResolver returns true which raises previously mentioned exception. From my point of view it seems that method gets data which needs and is possible to parse propertyName to get desired result.

E.g. something similar to:
{code}
if (resolver.isIndexed(propertyName)) {
   String name = resolver.getProperty(propertyName);
   int idx = Integer.valueOf(resolver.getIndex(propertyName)); // handle NumberFormat exception by your way
   return ((Object[]) bean.get(name))[idx]; // handle ArrayIndexOutOfBounds and ClassCast exception by your way
}
{code}

I was a bit surprised that I didn't find this issue in existing ones. I'm sorry if there is any which I omitted. 
Is it possible that this funcionality will be provided in any future release? Thank you

  was:
So far, BeanUtils does not support indexed or mapped properties of Map object (PropertyUtilsBean.getPropertyOfMapBean(Map bean, String propertyName) )
and throw IllegalArgumentException.

For instance if you have Map<String, String[]> and you want to get property by calling propName[0] (or propName(0)), method isIndexed (isMapped) of DefaultResolver returns true which raises previously mentioned exception. From my point of view it seems that method gets data which needs and is possible to parse propertyName to get desired result.

E.g. something similar to:
{code}
if (resolver.isIndexed(propertyName)) {
   String name = resolver.getProperty(propertyName);
   int idx = Integer.valueOf(resolver.getIndex(propertyName)); // handle NumberFormat exception by your way
   Map<Object, Object[]>) castMap = (Map<Object, Object[]>) bean; // handle ClassCast exception by your way
   return castMap.get(name)[idx]; // handle ArrayIndexOutOfBounds exception by your way
}
{code}

I was a bit surprised that I didn't find this issue in existing ones. I'm sorry if there is any which I omitted. 
Is it possible that this funcionality will be provided in any future release? Thank you


> Supporting indexed (mapped) properties of Map objects
> -----------------------------------------------------
>
>                 Key: BEANUTILS-376
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-376
>             Project: Commons BeanUtils
>          Issue Type: Improvement
>          Components: Bean / Property Utils
>         Environment: JDK1.5_22, WinXP
>            Reporter: Zdeněk Obst
>            Priority: Minor
>
> So far, BeanUtils does not support indexed or mapped properties of Map object (PropertyUtilsBean.getPropertyOfMapBean(Map bean, String propertyName) )
> and throw IllegalArgumentException.
> For instance if you have Map<String, String[]> and you want to get property by calling propName[0] (or propName(0)), method isIndexed (isMapped) of DefaultResolver returns true which raises previously mentioned exception. From my point of view it seems that method gets data which needs and is possible to parse propertyName to get desired result.
> E.g. something similar to:
> {code}
> if (resolver.isIndexed(propertyName)) {
>    String name = resolver.getProperty(propertyName);
>    int idx = Integer.valueOf(resolver.getIndex(propertyName)); // handle NumberFormat exception by your way
>    return ((Object[]) bean.get(name))[idx]; // handle ArrayIndexOutOfBounds and ClassCast exception by your way
> }
> {code}
> I was a bit surprised that I didn't find this issue in existing ones. I'm sorry if there is any which I omitted. 
> Is it possible that this funcionality will be provided in any future release? Thank you

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (BEANUTILS-376) Supporting indexed (mapped) properties of Map objects

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BEANUTILS-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908024#action_12908024 ] 

Niall Pemberton commented on BEANUTILS-376:
-------------------------------------------

Property Utils already supports this (in getNestedProperty() and getProperty() methods rather than getPropertyOfMapBean()) - you can see examples in the test case:

Example of Mapped-Indexed properties:
    * http://tinyurl.com/39j58zg
    * http://tinyurl.com/34p9wmf

Example of Mapped-Map properties:
    * http://tinyurl.com/35frsbl

These features were added in BeanUtils 1.8.0 - see BEANUTILS-43 and BEANUTILS-113

> Supporting indexed (mapped) properties of Map objects
> -----------------------------------------------------
>
>                 Key: BEANUTILS-376
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-376
>             Project: Commons BeanUtils
>          Issue Type: Improvement
>          Components: Bean / Property Utils
>         Environment: JDK1.5_22, WinXP
>            Reporter: Zdeněk Obst
>            Priority: Minor
>
> So far, BeanUtils does not support indexed or mapped properties of Map object (PropertyUtilsBean.getPropertyOfMapBean(Map bean, String propertyName) )
> and throw IllegalArgumentException.
> For instance if you have Map<String, String[]> and you want to get property by calling propName[0] (or propName(0)), method isIndexed (isMapped) of DefaultResolver returns true which raises previously mentioned exception. From my point of view it seems that method gets data which needs and is possible to parse propertyName to get desired result.
> E.g. something similar to:
> {code}
> if (resolver.isIndexed(propertyName)) {
>    String name = resolver.getProperty(propertyName);
>    int idx = Integer.valueOf(resolver.getIndex(propertyName)); // handle NumberFormat exception by your way
>    return ((Object[]) bean.get(name))[idx]; // handle ArrayIndexOutOfBounds and ClassCast exception by your way
> }
> {code}
> I was a bit surprised that I didn't find this issue in existing ones. I'm sorry if there is any which I omitted. 
> Is it possible that this funcionality will be provided in any future release? Thank you

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (BEANUTILS-376) Supporting indexed (mapped) properties of Map objects

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BEANUTILS-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton resolved BEANUTILS-376.
---------------------------------------

    Resolution: Duplicate

> Supporting indexed (mapped) properties of Map objects
> -----------------------------------------------------
>
>                 Key: BEANUTILS-376
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-376
>             Project: Commons BeanUtils
>          Issue Type: Improvement
>          Components: Bean / Property Utils
>         Environment: JDK1.5_22, WinXP
>            Reporter: Zdeněk Obst
>            Priority: Minor
>
> So far, BeanUtils does not support indexed or mapped properties of Map object (PropertyUtilsBean.getPropertyOfMapBean(Map bean, String propertyName) )
> and throw IllegalArgumentException.
> For instance if you have Map<String, String[]> and you want to get property by calling propName[0] (or propName(0)), method isIndexed (isMapped) of DefaultResolver returns true which raises previously mentioned exception. From my point of view it seems that method gets data which needs and is possible to parse propertyName to get desired result.
> E.g. something similar to:
> {code}
> if (resolver.isIndexed(propertyName)) {
>    String name = resolver.getProperty(propertyName);
>    int idx = Integer.valueOf(resolver.getIndex(propertyName)); // handle NumberFormat exception by your way
>    return ((Object[]) bean.get(name))[idx]; // handle ArrayIndexOutOfBounds and ClassCast exception by your way
> }
> {code}
> I was a bit surprised that I didn't find this issue in existing ones. I'm sorry if there is any which I omitted. 
> Is it possible that this funcionality will be provided in any future release? Thank you

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (BEANUTILS-376) Supporting indexed (mapped) properties of Map objects

Posted by "Zdeněk Obst (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BEANUTILS-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zdeněk Obst updated BEANUTILS-376:
----------------------------------

    Description: 
So far, BeanUtils does not support indexed or mapped properties of Map object (PropertyUtilsBean.getPropertyOfMapBean(Map bean, String propertyName) )
and throw IllegalArgumentException.

For instance if you have Map<String, String[]> and you want to get property by calling propName[0] (or propName(0)), method isIndexed (isMapped) of DefaultResolver returns true which raises previously mentioned exception. From my point of view it seems that method gets data which needs and is possible to parse propertyName to get desired result.

E.g. something similar to:
{code}
if (resolver.isIndexed(propertyName)) {
   String name = resolver.getProperty(propertyName);
   int idx = Integer.valueOf(resolver.getIndex(propertyName)); // handle NumberFormat exception by your way
   Map<Object, Object[]>) castMap = (Map<Object, Object[]>) bean; // handle ClassCast exception by your way
   return castMap.get(name)[idx]; // handle ArrayIndexOutOfBounds exception by your way
}
{code}

I was a bit surprised that I didn't find this issue in existing ones. I'm sorry if there is any which I omitted. 
Is it possible that this funcionality will be provided in any future release? Thank you

  was:
So far, BeanUtils does not support indexed or mapped properties of Map object (PropertyUtilsBean.getPropertyOfMapBean(Map bean, String propertyName) )
and throw IllegalArgumentException.

For instance if you have Map<String, String[]> and you want to get property by calling propName[0] (or propName(0)), method isIndexed (isMapped) of DefaultResolver returns true which raises previously mentioned exception. From my point of view it seems that method gets data which needs and is possible to parse propertyName to get desired result.

E.g. something similar to:
{code}
if  (resolver.isIndexed(propertyName)) {
   String name = resolver.getProperty(propertyName);
   int idx = Integer.valueOf(resolver.getIndex(propertyName)); // handle NumberFormat exception by your way
   return bean.get(name)[idx]; // handle ArrayIndexOutOfBounds exception by your way
}
{code}

I was a bit surprised that I didn't find this issue in existing ones. I'm sorry if there is any which I omitted. 
Is it possible that this funcionality will be provided in any future release? Thank you


> Supporting indexed (mapped) properties of Map objects
> -----------------------------------------------------
>
>                 Key: BEANUTILS-376
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-376
>             Project: Commons BeanUtils
>          Issue Type: Improvement
>          Components: Bean / Property Utils
>         Environment: JDK1.5_22, WinXP
>            Reporter: Zdeněk Obst
>            Priority: Minor
>
> So far, BeanUtils does not support indexed or mapped properties of Map object (PropertyUtilsBean.getPropertyOfMapBean(Map bean, String propertyName) )
> and throw IllegalArgumentException.
> For instance if you have Map<String, String[]> and you want to get property by calling propName[0] (or propName(0)), method isIndexed (isMapped) of DefaultResolver returns true which raises previously mentioned exception. From my point of view it seems that method gets data which needs and is possible to parse propertyName to get desired result.
> E.g. something similar to:
> {code}
> if (resolver.isIndexed(propertyName)) {
>    String name = resolver.getProperty(propertyName);
>    int idx = Integer.valueOf(resolver.getIndex(propertyName)); // handle NumberFormat exception by your way
>    Map<Object, Object[]>) castMap = (Map<Object, Object[]>) bean; // handle ClassCast exception by your way
>    return castMap.get(name)[idx]; // handle ArrayIndexOutOfBounds exception by your way
> }
> {code}
> I was a bit surprised that I didn't find this issue in existing ones. I'm sorry if there is any which I omitted. 
> Is it possible that this funcionality will be provided in any future release? Thank you

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (BEANUTILS-376) Supporting indexed (mapped) properties of Map objects

Posted by "Zdeněk Obst (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BEANUTILS-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zdeněk Obst updated BEANUTILS-376:
----------------------------------

    Description: 
So far, BeanUtils does not support indexed or mapped properties of Map object (PropertyUtilsBean.getPropertyOfMapBean(Map bean, String propertyName) )
and throw IllegalArgumentException.

For instance if you have Map<String, String[]> and you want to get property by calling propName[0] (or propName(0)), method isIndexed (isMapped) of DefaultResolver returns true which raises previously mentioned exception. From my point of view it seems that method gets data which needs and is possible to parse propertyName to get desired result.

E.g. something similar to:
{code}
if  (resolver.isIndexed(propertyName)) {
   String name = resolver.getProperty(propertyName);
   int idx = Integer.valueOf(resolver.getIndex(propertyName)); // handle NumberFormat exception by your way
   return bean.get(name)[idx]; // handle ArrayIndexOutOfBounds exception by your way
}
{code}

I was a bit surprised that I didn't find this issue in existing ones. I'm sorry if there is any which I omitted. 
Is it possible that this funcionality will be provided in any future release? Thank you

  was:
So far, BeanUtils does not support indexed or mapped properties of Map object (PropertyUtilsBean.getPropertyOfMapBean(Map bean, String propertyName) )
and throw IllegalArgumentException.

For instance if you have Map<String, String[]> and you want to get property by calling propName[0] (or propName(0)), method isIndexed (isMapped) of DefaultResolver returns true which raises previously mentioned exception. From my point of view it seems that method gets data which needs and is possible to parse propertyName to get desired result.

E.g. something similar to:
if  (resolver.isIndexed(propertyName)) {
   String name = resolver.getProperty(propertyName);
   int idx = Integer.valueOf(resolver.getIndex(propertyName)); // handle NumberFormat exception by your way
   return bean.get(name)[idx]; // handle ArrayIndexOutOfBounds exception by your way
}

I was a bit surprised that I didn't find this issue in existing ones. I'm sorry if there is any which I omitted. 
Is it possible that this funcionality will be provided in any future release? Thank you


> Supporting indexed (mapped) properties of Map objects
> -----------------------------------------------------
>
>                 Key: BEANUTILS-376
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-376
>             Project: Commons BeanUtils
>          Issue Type: Improvement
>          Components: Bean / Property Utils
>         Environment: JDK1.5_22, WinXP
>            Reporter: Zdeněk Obst
>            Priority: Minor
>
> So far, BeanUtils does not support indexed or mapped properties of Map object (PropertyUtilsBean.getPropertyOfMapBean(Map bean, String propertyName) )
> and throw IllegalArgumentException.
> For instance if you have Map<String, String[]> and you want to get property by calling propName[0] (or propName(0)), method isIndexed (isMapped) of DefaultResolver returns true which raises previously mentioned exception. From my point of view it seems that method gets data which needs and is possible to parse propertyName to get desired result.
> E.g. something similar to:
> {code}
> if  (resolver.isIndexed(propertyName)) {
>    String name = resolver.getProperty(propertyName);
>    int idx = Integer.valueOf(resolver.getIndex(propertyName)); // handle NumberFormat exception by your way
>    return bean.get(name)[idx]; // handle ArrayIndexOutOfBounds exception by your way
> }
> {code}
> I was a bit surprised that I didn't find this issue in existing ones. I'm sorry if there is any which I omitted. 
> Is it possible that this funcionality will be provided in any future release? Thank you

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.