Examples of createObjectNode()


Examples of org.codehaus.jackson.map.ObjectMapper.createObjectNode()

//    } catch (UnsupportedEncodingException e1) {
//      e1.printStackTrace();
//    }
    // Gets a record given id parameter and returns corresponding JSON records
    ObjectMapper mapper = new ObjectMapper();
    JsonNode rootNode = mapper.createObjectNode(); // will be of type ObjectNode
    ArrayNode jSONrecords = ((ObjectNode)rootNode).putArray("ProgramRecord");
 
    try {
      Connection conn = null;
      DriverManager.registerDriver(new AppEngineDriver());
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.createObjectNode()

      //pstmt.setString(1, "3459");
      pstmt.toString();
      ResultSet rs = pstmt.executeQuery();
      int i = 0;
      while (rs.next()) {
        JsonNode recordNode = mapper.createObjectNode(); // will be of type ObjectNode
        ((ObjectNode)recordNode).put("ProgramKey", rs.getString("program_key"));
        ((ObjectNode)recordNode).put("ProgramName", rs.getString("program_name"));
        ((ObjectNode)recordNode).put("AgencyName", rs.getString("agency_name"));
        ((ObjectNode)recordNode).put("ProgramType", rs.getString("program_type"));
        ((ObjectNode)recordNode).put("SiteGeocode", rs.getString("site_geocode"));
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.createObjectNode()

    Trie t = new TrieCache().getCachedTrie("name_last");
    //ArrayList<String> words = pt.t.returnFullWordMatches(prefix);
    ArrayList<String> words = t.returnFullWordMatches(prefix);
    System.out.println("we got " + prefix);
    ObjectMapper mapper = new ObjectMapper();
    JsonNode rootNode = mapper.createObjectNode(); // will be of type ObjectNode
    ArrayNode an = ((ObjectNode)rootNode).putArray("lastName");
    int i = 0;
    for (String word : words) {
      an.insert(i++, word);
    }
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.createObjectNode()

                try {
                    currentRecordingDoc = connector.get(ObjectNode.class, t.getRecordingID());
                } catch(Exception e) {
                    // if we are here, then we have come from an internal request, we need to create the doc
                    ObjectMapper mapper = new ObjectMapper();
                    currentRecordingDoc = mapper.createObjectNode();
                    currentRecordingDoc.put("_id", t.getRecordingID());
                    ObjectNode recordingState = currentRecordingDoc.putObject("recordingState");
                    long dt = System.currentTimeMillis();
                    recordingState.put("recorderAsked", dt);
                    recordingState.put("recorderAvailable", getRecorderUUID());
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.createObjectNode()


                        System.out.println("out");
                        // create a doc
                        ObjectMapper map = new ObjectMapper();
                        ObjectNode node = map.createObjectNode();
                        node.put("type", "com.eckoit.recordingSegment");
                        node.put("recording", currentRecordingDoc.get("_id").getTextValue());
                        node.put("startTime", t.getStartTime());
                        connector.create(node);
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.createObjectNode()

    @Produces("application/json")
    public Response getConfig(@PathParam("name") String name) throws IndexerNotFoundException, IOException {
        IndexerDefinition index = getModel().getIndexer(name);

        ObjectMapper m = new ObjectMapper();
        ObjectNode json = m.createObjectNode();
        json.put("occVersion", index.getOccVersion());
        json.put("config", new String(index.getConfiguration(), Charsets.UTF_8));

        return Response.ok(m.writeValueAsString(json), new MediaType("application", "json")).build();
    }
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.createObjectNode()

  @Override
  public String getServiceMetadataAsJsonP(ReconciliationService service, String callback, String baseServiceUrl){
   
    ObjectMapper mapper = new ObjectMapper();
    ObjectNode obj = mapper.createObjectNode();
    obj.put("name", service.getName());
    obj.put("schemaSpace", URI_SPACE);
    obj.put("identifierSpace", URI_SPACE);
   
   
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.createObjectNode()

    obj.put("schemaSpace", URI_SPACE);
    obj.put("identifierSpace", URI_SPACE);
   
   
    //view object
    ObjectNode viewObj = mapper.createObjectNode();
    viewObj.put("url", baseServiceUrl + "/view?id={{id}}");
    obj.put("view", viewObj);
   
    //preview object
    ObjectNode previewObj = mapper.createObjectNode();
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.createObjectNode()

    ObjectNode viewObj = mapper.createObjectNode();
    viewObj.put("url", baseServiceUrl + "/view?id={{id}}");
    obj.put("view", viewObj);
   
    //preview object
    ObjectNode previewObj = mapper.createObjectNode();
    previewObj.put("url", baseServiceUrl + "/preview/template?id={{id}}");
    previewObj.put("width",430);
    previewObj.put("height",300);
   
    obj.put("preview", previewObj);
View Full Code Here

Examples of org.codehaus.jackson.map.ObjectMapper.createObjectNode()

   
    obj.put("preview", previewObj);
   
    //suggest
    //Global suggest object
    ObjectNode suggestObj = mapper.createObjectNode();
       
    //type suggest (autocomplete)
    ObjectNode typeSuggestObj = mapper.createObjectNode();
    typeSuggestObj.put("service_url", baseServiceUrl);
    typeSuggestObj.put("service_path", "/suggest/type");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.