@@ -0,0 +1,1446 @@
+import com.fasterxml.jackson.databind.ObjectMapper;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0A/**%0A * Created by ravi on 5/27/15.%0A */%0Apublic class JacksonTest%0A%7B%0A    public static void main(String %5B%5D args)%0A    %7B%0A        String userJson = %22%7B%5C%22userId%5C%22: 100, %5C%22userName%5C%22: %5C%22Ravi%5C%22%7D%22;%0A        ObjectMapper mapper = new ObjectMapper();%0A        try%0A        %7B%0A            //Parse the json string and create UserInfo Object%0A            UserInfo user = mapper.readValue(userJson, UserInfo.class);%0A%0A            //Check if the user object gets the required values%0A            System.out.println(user.getUserId());%0A            System.out.println(user.getUserName());%0A%0A%0A            //Create json from Map%0A            Map%3CString, Object%3E userData = new HashMap%3CString, Object%3E();%0A            userData.put(%22userId%22, 101);%0A            userData.put(%22userName%22, %22Chandra%22);%0A            //write it to a file user.json in the current directory%0A            mapper.writeValue(new File(%22user.json%22), userData);%0A%0A            //try to load json from a file into Java object%0A            UserInfo user1 = mapper.readValue(new File(%22user.json%22), UserInfo.class);%0A%0A            //Test if the object got the values%0A            System.out.println(user1.getUserId());%0A            System.out.println(user1.getUserName());%0A        %7D%0A        catch (IOException e)%0A        %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%7D%0A

Basic examples