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

Jan Bednar commented on CAMEL-13729:
------------------------------------

Well 
{code:java}
.bean(String.class, "join('\n', ${body})"){code}
Is not usable even after removing this check, because this throw ambicious 
method call exception.

Using Apache Commons StringUtils is much more suitable
{code:java}
.bean(StringUtils.class, "join(${body}, '\n')")
{code}
 

 

 

> Allow using String static methods in bean DSL
> ---------------------------------------------
>
>                 Key: CAMEL-13729
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13729
>             Project: Camel
>          Issue Type: Improvement
>    Affects Versions: 3.0.0-M3
>            Reporter: Jan Bednar
>            Priority: Minor
>
> This can be useful eg for converting List to String.
> {code:java}
> .bean(String.class, "join(${body}, '\n')")
> {code}
> Now this is not possible, because this throws exception _The bean instance is 
> a java.lang.String type: . We suppose you want to refer to a bean instance by 
> its id instead. Please use ref._
> I think, this check can be safely removed as bean language now supports 
> string as ref natively using bean("ref") . Also unit test testing this was 
> removed long time ago in CAMEL-8459 commit 
> [a547300711ce7b688be8e24dd794ce8a8eb89f79|https://github.com/apache/camel/commit/a547300711ce7b688be8e24dd794ce8a8eb89f79]
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to