Package org.codehaus.jackson.map

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


        builder.setDefaultHeaders(Collections.singleton(new BasicHeader("Accept-Language", line.getOptionValue(RDAPOptions.LANG, Locale.getDefault().toString()))));

        RDAPClient rdapClient = new RDAPClient(httpClient);
        if (line.hasOption(RDAPOptions.RAW)) {
          ObjectMapper mapper = new ObjectMapper();
          System.out.println(mapper.writer().writeValueAsString(rdapClient.getDomainAsJson(query)));
        } else if (line.hasOption(RDAPOptions.PRETTY)) {
          ObjectMapper mapper = new ObjectMapper();
          System.out.println(mapper.writer(new DefaultPrettyPrinter()).writeValueAsString(rdapClient.getDomainAsJson(query)));
        }
      } catch (UnrecoverableKeyException e) {
View Full Code Here


        if (line.hasOption(RDAPOptions.RAW)) {
          ObjectMapper mapper = new ObjectMapper();
          System.out.println(mapper.writer().writeValueAsString(rdapClient.getDomainAsJson(query)));
        } else if (line.hasOption(RDAPOptions.PRETTY)) {
          ObjectMapper mapper = new ObjectMapper();
          System.out.println(mapper.writer(new DefaultPrettyPrinter()).writeValueAsString(rdapClient.getDomainAsJson(query)));
        }
      } catch (UnrecoverableKeyException e) {
        LOGGER.error(e.getMessage(), e);
      } catch (NoSuchAlgorithmException e) {
        LOGGER.error(e.getMessage(), e);
View Full Code Here

      String[] targetedFieldNames = new String[fields.size()];
      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
       */
 
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.