Package org.codehaus.jackson.map

Examples of org.codehaus.jackson.map.ObjectWriter.writeValueAsString()


      if (application.getDefectTracker() != null &&
          application.getDefectTracker().getId() == null) {
        application.setDefectTracker(null);
      }

      return writer.writeValueAsString(FormRestResponse.failure("Errors", result));

    } else {
      application.setOrganization(organizationService.loadById(application.getOrganization().getId()));
      applicationService.storeApplication(application);
            vulnerabilityService.updateOrgsVulnerabilityReport();
View Full Code Here


            vulnerabilityService.updateOrgsVulnerabilityReport();
      String user = SecurityContextHolder.getContext().getAuthentication().getName();
     
      log.debug("The Application " + application.getName() + " (id=" + application.getId() + ") has been edited by user " + user);

            return writer.writeValueAsString(RestResponse.success(application));
    }
  }
 
  @RequestMapping(value="/wafAjax", method = RequestMethod.POST)
  public @ResponseBody RestResponse<Waf> processSubmitAjaxWaf(@PathVariable("appId") int appId,
View Full Code Here

        ObjectWriter writer = ControllerUtils.getObjectWriter(AllViews.TableRow.class);

        Map<String, Object> map = new HashMap<>();
    map.put("scanList", scans);
    map.put("numScans", scanCount);
        return writer.writeValueAsString(RestResponse.success(map));
  }
 

}
View Full Code Here

            restResponse = RestResponse.success(map);
        }

        ObjectWriter writer = ControllerUtils.getObjectWriter(AllViews.TableRow.class);

        return writer.writeValueAsString(restResponse);
    }


    @RequestMapping("/delete")
    @PreAuthorize("hasRole('ROLE_CAN_MANAGE_TEAMS')")
View Full Code Here

      for (int i = 0; i < fields.size(); i++) {
        targetedFieldNames[i] = fields.get(i).getName();
      }
      filters.addFilter("PropertyFilter", SimpleBeanPropertyFilter.filterOutAllExcept(targetedFieldNames));
      ObjectWriter objectWriter = objectMapper.writer(filters);
      String json = objectWriter.writeValueAsString(entity);

      /*
       * Encode property the custom way
       */
      List<java.lang.reflect.Field> customEncodedProperties = ClassUtil.getAnnotatedFields(entity, com.apitrary.orm.core.annotations.Codec.class);
View Full Code Here

        mapper.configure(SerializationConfig.Feature.DEFAULT_VIEW_INCLUSION, false);

        ObjectWriter writer = mapper.writerWithView(view);

        try {
            return writer.writeValueAsString(RestResponse.success(object));
        } catch (IOException e) {
            throw new RuntimeException("Unable to write JSON Object.", e);
        }
    }
}
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.