Examples of writer()


Examples of com.digiburo.backprop1b.network.PatternList.writer()

      }

      pl.add(input, output);
    }

    pl.writer(new File(TRAIN_FILENAME));
  }

  /**
   * Convert the ASCII file do an array of double suitable for input neurons
   *
 
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.writer()

        objectMapper.addMixInAnnotations(Object.class, ViewFilters.GetPathFilter.class);
        String[] ignorableFieldNames = { "possibleEndpoints", "enabledEndpoints" };
        FilterProvider filters = new SimpleFilterProvider().addFilter("Filter properties from the PathController GET",
              SimpleBeanPropertyFilter.serializeAllExcept(ignorableFieldNames));
   
        ObjectWriter writer = objectMapper.writer(filters);

        return writer.writeValueAsString(jqReturn);
    }
   
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.writer()

        if (groups != null) {
            pathOverrideService.setGroupsForPath(groups, pathId);
        }

        ObjectMapper objectMapper = new ObjectMapper();
        ObjectWriter writer = objectMapper.writer();

        return writer.writeValueAsString(PathOverrideService.getInstance().getPath(pathId, clientUUID, null));
    }

    // setOverrideArgs needs direct access to HttpServletRequest since Spring messes up array entries with commas
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.writer()

            ConfigurationBundle bundle = bundleService.export(exportBundleRequest);

            response().setContentType(MediaType.JSON_UTF_8.toString());
            response().setHeader("Content-Disposition", "attachment; filename=content_pack.json");
            ObjectMapper m = new ObjectMapper();
            ObjectWriter ow = m.writer().withDefaultPrettyPrinter();
            return ok(ow.writeValueAsString(bundle));
        } catch (IOException e) {
            flash("error", "Could not reach Graylog2 server");
        } catch (Exception e) {
            flash("error", "Unexpected error exporting configuration bundle, please try again later");
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.writer()

        objectMapper.addMixInAnnotations(Object.class, ViewFilters.GetPathFilter.class);
        String[] ignorableFieldNames = { "possibleEndpoints", "enabledEndpoints" };
        FilterProvider filters = new SimpleFilterProvider().addFilter("Filter properties from the PathController GET",
            SimpleBeanPropertyFilter.serializeAllExcept(ignorableFieldNames));
           
        ObjectWriter writer = objectMapper.writer(filters);

        return writer.writeValueAsString(jqReturn);
    }

    @RequestMapping(value = "/api/path", method = RequestMethod.POST)
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.writer()

        if(bodyFilter != null) {
            pathOverrideService.setBodyFilter(pathId, bodyFilter);
        }

        ObjectMapper objectMapper = new ObjectMapper();
        ObjectWriter writer = objectMapper.writer();

        return writer.writeValueAsString(pathOverrideService.getPath(pathId));
    }
   
    @RequestMapping(value = "/api/path/test", method = RequestMethod.GET)
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.writer()

      jsonConfig = routerController.getJsonHandler().writeValueAsString(remotingApi, debug);
    } else {
      ObjectMapper mapper = new ObjectMapper();
      mapper.addMixInAnnotations(RemotingApi.class, RemotingApiMixin.class);
      try {
        jsonConfig = mapper.writer().withDefaultPrettyPrinter().writeValueAsString(remotingApi);
      } catch (JsonProcessingException e) {
        jsonConfig = null;
        LogFactory.getLog(ApiController.class).info("serialize object to json", e);
      }
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.writer()

        ObjectMapper mapper = new ObjectMapper(new FactoryWithSchema());
        MySchema s = new MySchema();
        StringWriter sw = new StringWriter();
        //  bit ugly, but can't think of cleaner simple way to check this...
        try {
            mapper.writer(s).writeValue(sw, "Foobar");
            fail("Excpected exception");
        } catch (SchemaException e) {
            assertSame(s, e._schema);
        }
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.writer()

    }

    public void testRootViaWriterAndReader() throws Exception
    {
        ObjectMapper mapper = rootMapper();
        String json = mapper.writer().writeValueAsString(new Bean());
        assertEquals("{\"rudy\":{\"a\":3}}", json);
        Bean bean = mapper.reader(Bean.class).readValue(json);
        assertNotNull(bean);
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.writer()

        // default: no wrapping
        final Bean input = new Bean();
        String jsonUnwrapped = mapper.writeValueAsString(input);
        assertEquals("{\"a\":3}", jsonUnwrapped);
        // secondary: wrapping
        String jsonWrapped = mapper.writer(SerializationFeature.WRAP_ROOT_VALUE)
            .writeValueAsString(input);
        assertEquals("{\"rudy\":{\"a\":3}}", jsonWrapped);

        // and then similarly for readers:
        Bean result = mapper.readValue(jsonUnwrapped, Bean.class);
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.