Package com.fasterxml.jackson.databind.node

Examples of com.fasterxml.jackson.databind.node.TextNode.traverse()


    }

    public void testTextAsBinary() throws Exception
    {
        TextNode n = new TextNode("   APs=\n");
        JsonParser jp = n.traverse();
        assertNull(jp.getCurrentToken());
        assertToken(JsonToken.VALUE_STRING, jp.nextToken());
        byte[] data = jp.getBinaryValue();
        assertNotNull(data);
        assertArrayEquals(new byte[] { 0, -5 }, data);
View Full Code Here


        jp.close();
        assertTrue(jp.isClosed());

        // Also: let's verify we get an exception for garbage...
        n = new TextNode("?!??");
        jp = n.traverse();
        assertToken(JsonToken.VALUE_STRING, jp.nextToken());
        try {
            jp.getBinaryValue();
        } catch (JsonParseException e) {
            verifyException(e, "Illegal character");
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.