Skip to content

Instantly share code, notes, and snippets.

@collinvandyck
Created November 20, 2012 22:01
Show Gist options
  • Select an option

  • Save collinvandyck/4121532 to your computer and use it in GitHub Desktop.

Select an option

Save collinvandyck/4121532 to your computer and use it in GitHub Desktop.
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