How to implement a customize decoder same as Mapping but return Integer?

24 views
Skip to first unread message

Rod Zhong

unread,
Jan 9, 2024, 9:40:42 PMJan 9
to Smooks Users
Hi Smooks users.

I am wondering is there an example to show how to implement a customize decoder so i can reference? 

taking the Smooks document section Java Bean decoder "Mapping".  it accepts a string as input and return another mapped String as output. 

However, in my case, I need to accept String as input but return Integer. How can I achieve it?
<jb:decodParam name="Dublin">123</jb:decodeParam>
use the existed Mapping decoder it return 123 as string value "123". 
<jb:value property="name" decoder="Mapping" data="history/@warehouse"> <jb:decodeParam name="1">Dublin</jb:decodeParam> <jb:decodeParam name="2">Belfast</jb:decodeParam> <jb:decodeParam name="3">Cork</jb:decodeParam> </jb:value>

Claude Mamo

unread,
Jan 10, 2024, 3:27:10 AMJan 10
to smook...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Smooks Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/277ce2f7-954f-4758-839f-02509a8775a1n%40googlegroups.com.

Rod Zhong

unread,
Jan 10, 2024, 11:11:59 PMJan 10
to Smooks Users
Dear Claude

Thank you for help.  I have succussed to implement a customized decoder.

Regards
Rod 

Reply all
Reply to author
Forward
0 new messages