Wednesday, June 8, 2016

MULE JSON Transformers


MULE JSON Transformers

JSON Primer

 JavaScript Object Notation is a lightweight data inter change format
                     
Human-Readable Syntax   [ element1, element2, element3..... ]

• Supports
1. Collections

2. Maps                                                  { "name1":"value", "name2":"value" }

JSON Transformer

• Object to JSON - receives an object and returns JSON syntax  

- uses reflection (no configuration necessary)








• JSON to Object - populates a Java object from a JSON structure

- requires at least the name of the class


JSON Example

1. JSON input enters with an order request
2. Order business logic exists in a java component                
3. After processing, a response comes back with the tax included






• XML to JAXB

- Uses the JAXB binding framework to serialize to xml or in reverse to an object

- Counterpart exists at JAXB to XML

• XML to Object

- Utilizes Xstream to convert data to and from XML and Java Objects

- Counterpart exists as Object to XML




No comments:

Post a Comment