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
Source File: FieldAttributeBasedDeltaFieldsProvider.java    From incubator-gobblin with Apache License 2.0 5 votes vote down vote up
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 File: ImportServiceImpl.java    From usergrid with 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 File: ImportAdmins.java    From usergrid with 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 File: Import.java    From usergrid with 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;
}