Java Code Examples for org.codehaus.jackson.JsonParser#setCodec()

The following examples show how to use org.codehaus.jackson.JsonParser#setCodec() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private ObjectNode getDeltaPropValue(String json) {
  try {
    JsonFactory jf = new JsonFactory();
    JsonParser jp = jf.createJsonParser(json);
    ObjectMapper objMap = new ObjectMapper(jf);
    jp.setCodec(objMap);
    return (ObjectNode) jp.readValueAsTree();
  } catch (IOException e) {
    return null;
  }
}
 
Example 2
Source Project: usergrid   File: ImportServiceImpl.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Gets the JSON parser for given file
 *
 * @param collectionFile the file for which JSON parser is required
 */
private JsonParser getJsonParserForFile(File collectionFile) throws Exception {
    JsonParser jp = jsonFactory.createJsonParser(collectionFile);
    jp.setCodec(new ObjectMapper());
    return jp;
}
 
Example 3
Source Project: usergrid   File: ImportAdmins.java    License: Apache License 2.0 4 votes vote down vote up
private JsonParser getJsonParserForFile(File organizationFile) throws Exception {
    JsonParser jp = jsonFactory.createJsonParser( organizationFile );
    jp.setCodec( new ObjectMapper() );
    return jp;
}
 
Example 4
Source Project: usergrid   File: Import.java    License: Apache License 2.0 4 votes vote down vote up
private JsonParser getJsonParserForFile( File organizationFile ) throws Exception {
    JsonParser jp = jsonFactory.createJsonParser( organizationFile );
    jp.setCodec( new ObjectMapper() );
    return jp;
}