Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * $Id:  $
  * -------------------------------------------------------------------------------------
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
  *
  * The software in this package is published under the terms of the CPAL v1.0
  * license, a copy of which has been included with this distribution in the
  * LICENSE.txt file.
  */
package org.mule.module.json.transformers;
    private ObjectMapper mapper;
    public void init()
    {
         = new ObjectMapper();
    }
    @Transformer(sourceTypes = {InputStream.classbyte[].class})
    public Apple toApple(String inthrows IOException
    {
        return .readValue(inApple.class);
    }
    @Transformer
    public String fromApple(Apple applethrows IOException
    {
        StringWriter w = new StringWriter();
        .writeValue(wapple);
        return w.toString();
    }
New to GrepCode? Check out our FAQ X