Examples of withDefaultPrettyPrinter()


Examples of com.fasterxml.jackson.databind.ObjectWriter.withDefaultPrettyPrinter()

   
            if (_shouldRefresh(forceRefresh, now, ser)) {
                ExternalMetrics metrics = _gatherMetrics(now, full);
                ObjectWriter w = _jsonWriter;
                if (_indent.get()) {
                  w = w.withDefaultPrettyPrinter();
                }
                final byte[] raw = w.writeValueAsBytes(metrics);
                ser = new SerializedMetrics(now, raw);
                _cachedMetrics.set(ser);
            }
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectWriter.withDefaultPrettyPrinter()

    @Override
    public String dumpStatisticsAsJson() {
        ObjectWriter writer = mapper.writer();
        if (isPrettyPrint()) {
            writer = writer.withDefaultPrettyPrinter();
        }
        try {
            return writer.writeValueAsString(getMetricsRegistry());
        } catch (JsonProcessingException e) {
            throw ObjectHelper.wrapRuntimeCamelException(e);
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectWriter.withDefaultPrettyPrinter()

    }

    public String dumpStatisticsAsJsonTimeUnitSeconds() {
        ObjectWriter writer = secondsMapper.writer();
        if (isPrettyPrint()) {
            writer = writer.withDefaultPrettyPrinter();
        }
        try {
            return writer.writeValueAsString(getMetricsRegistry());
        } catch (JsonProcessingException e) {
            throw ObjectHelper.wrapRuntimeCamelException(e);
View Full Code Here

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

    public <T> int serialize(T obj, Class<T> type, OutputStream out) throws IOException {
        out = new CountingOutputStream(new BufferedOutputStream(out, getBufferSize()));
        try {
            ObjectWriter writer = _objectMapper.writerWithType(type);
            if (isPrettyPrint()) {
                writer = writer.withDefaultPrettyPrinter();
            }
            writer.writeValue(out, obj);
        } finally {
            if (isCloseEnabled()) {
                out.close();
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.