You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Appddevvv (JIRA)" <ji...@apache.org> on 2010/06/30 05:27:58 UTC
[jira] Created: (PIVOT-558) BeanAdapter should have a putAll method
to allow multiple property set in one method call...especially useful when
setting properties from a JSON string
BeanAdapter should have a putAll method to allow multiple property set in one method call...especially useful when setting properties from a JSON string
--------------------------------------------------------------------------------------------------------------------------------------------------------
Key: PIVOT-558
URL: https://issues.apache.org/jira/browse/PIVOT-558
Project: Pivot
Issue Type: Improvement
Components: core-beans
Reporter: Appddevvv
API:
public void putAll(Map<String, ?> values)
public boolean putAll(Map<String, ?> values, boolean ignoreErrors)
where ignore errors indicates that any errors/exceptions thrown should be caught. If any are thrown or errors occur, true is returned, otherwise false.
I'll submit a patch if you accept this improvement.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
RE: [jira] Commented: (PIVOT-558) BeanAdapter should have a putAll
method to allow multiple property set in one method call...especially useful
when setting properties from a JSON string
Posted by aappddeevv <aa...@verizon.net>.
I think your comments could apply to a lot of methods though, such as
contains(), which is really just a loop and an equality check. I can't speak
to all map classes, but for BeanAdapter I found that I was doing a
multiple-value property set more than a few times. I'm not sure I would call
this a feature. I think ignoreErrors is pretty universal when doing
binding-like operations. For example, spring has the same things on their
equivalent of BeanAdapter.
-----Original Message-----
From: Greg Brown (JIRA) [mailto:jira@apache.org]
Sent: Wednesday, June 30, 2010 8:25 AM
To: dev@pivot.apache.org
Subject: [jira] Commented: (PIVOT-558) BeanAdapter should have a putAll
method to allow multiple property set in one method call...especially useful
when setting properties from a JSON string
[
https://issues.apache.org/jira/browse/PIVOT-558?page=com.atlassian.jira.plug
in.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883904#action_1
2883904 ]
Greg Brown commented on PIVOT-558:
----------------------------------
I know the JDK's Map classes provide this, but it is so easy to do in
application code that I have been reluctant to add it to Pivot's
collections:
for (String key : source) {
destination.put(key, source.get(key));
}
To me, the need for an ignoreErrors flag makes for an even a stronger
argument that this type of code belongs at the application level, since that
seems like a pretty application-specific requirement.
If we were to provide such a feature in the framework, I would want to put
it in a static method in a static Map.Util class or something similar so all
maps could take advantage of it. However, I'm not recommending either
approach because I don't think it adds sufficient value.
> BeanAdapter should have a putAll method to allow multiple property set in
one method call...especially useful when setting properties from a JSON
string
>
----------------------------------------------------------------------------
----------------------------------------------------------------------------
>
> Key: PIVOT-558
> URL: https://issues.apache.org/jira/browse/PIVOT-558
> Project: Pivot
> Issue Type: Improvement
> Components: core-beans
> Reporter: Appddevvv
>
> API:
> public void putAll(Map<String, ?> values)
> public boolean putAll(Map<String, ?> values, boolean ignoreErrors)
> where ignore errors indicates that any errors/exceptions thrown should be
caught. If any are thrown or errors occur, true is returned, otherwise
false.
> I'll submit a patch if you accept this improvement.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (PIVOT-558) BeanAdapter should have a putAll
method to allow multiple property set in one method call...especially
useful when setting properties from a JSON string
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883904#action_12883904 ]
Greg Brown commented on PIVOT-558:
----------------------------------
I know the JDK's Map classes provide this, but it is so easy to do in application code that I have been reluctant to add it to Pivot's collections:
for (String key : source) {
destination.put(key, source.get(key));
}
To me, the need for an ignoreErrors flag makes for an even a stronger argument that this type of code belongs at the application level, since that seems like a pretty application-specific requirement.
If we were to provide such a feature in the framework, I would want to put it in a static method in a static Map.Util class or something similar so all maps could take advantage of it. However, I'm not recommending either approach because I don't think it adds sufficient value.
> BeanAdapter should have a putAll method to allow multiple property set in one method call...especially useful when setting properties from a JSON string
> --------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: PIVOT-558
> URL: https://issues.apache.org/jira/browse/PIVOT-558
> Project: Pivot
> Issue Type: Improvement
> Components: core-beans
> Reporter: Appddevvv
>
> API:
> public void putAll(Map<String, ?> values)
> public boolean putAll(Map<String, ?> values, boolean ignoreErrors)
> where ignore errors indicates that any errors/exceptions thrown should be caught. If any are thrown or errors occur, true is returned, otherwise false.
> I'll submit a patch if you accept this improvement.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.