Examples of copyCurrentEvent()


Examples of com.fasterxml.jackson.databind.util.TokenBuffer.copyCurrentEvent()

    {
        // First, copy events from known good source (StringReader)
        JsonParser jp = createParserUsingReader(SAMPLE_DOC_JSON_SPEC);
        TokenBuffer tb = new TokenBuffer(null, false);
        while (jp.nextToken() != null) {
            tb.copyCurrentEvent(jp);
        }
        jp.close();
        // Then serialize as String
        String str = serializeAsString(tb);
        tb.close();
View Full Code Here

Examples of org.codehaus.jackson.JsonGenerator.copyCurrentEvent()

        JsonParser rap = JacksonRootAddingParser.createRootAddingParser(p, "root");
        StringWriter sw = new StringWriter();
        JsonGenerator g = factory.createJsonGenerator(sw);
        rap.nextToken();
        while (rap.hasCurrentToken()) {
            g.copyCurrentEvent(rap);
            rap.nextToken();
        }
        g.flush();
        System.out.println(sw);
        assertEquals("{\"root\":" + expr + "}", sw.toString());
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.