Created
November 20, 2012 22:01
-
-
Save collinvandyck/4121532 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.codehaus.jackson.map.ObjectMapper; | |
| import java.io.StringReader; | |
| public class Testing { | |
| private String foo; | |
| public static void main(String[] args) throws Exception { | |
| final ObjectMapper objectMapper = new ObjectMapper(); | |
| final StringReader reader = new StringReader("{\"foo\":\"bar\"}"); | |
| final Testing testing = objectMapper.readValue(reader, Testing.class); | |
| System.out.println("testing.getFoo() = " + testing.getFoo()); | |
| } | |
| public String getFoo() { | |
| return foo; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment