Convert XML to JSON using Mule Custom Transformer -


hi working mule studio , want create custom transformer convert xml json using google gson library. in case have add java transformer component , have write custom code that. problem facing overriding method accepts input parameter object thats way think or other way accept input parameter xml string. please share code make workable.

public class transfomer extends abstracttransformer { protected object dotransform(object src, string enc) throws transformerexception { // todo auto-generated method stub
return null; } }

take @ existing transformer: https://github.com/mulesoft/mule/blob/mule-3.x/modules/xml/src/main/java/org/mule/module/xml/transformer/xmlprettyprinter.java

  • see how in constructor accepted source types registered, with: registersourcetype(datatypefactory.create(org.dom4j.document.class));
  • see how in dotransform method generic object src converted.

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -