Package com.fasterxml.jackson.databind

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


    @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

    }

    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

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.