Package org.lilyproject.tools.import_.json

Examples of org.lilyproject.tools.import_.json.WriteOptions


        assertNull(node.get("namespaces"));
        assertEquals("{ns}stringField", node.get("recordFilter").get("field").getTextValue());

        // Test serialization with namespace prefixes
        byte[] dataWithPrefixes = JsonFormat.serializeAsBytes(
                writer.toJson(scan, new WriteOptions(), repository));

        JsonNode nodeWithPrefixes = new ObjectMapper().readTree(dataWithPrefixes);
        assertNotNull(nodeWithPrefixes.get("namespaces"));
        assertTrue(nodeWithPrefixes.get("recordFilter").get("field").getTextValue().endsWith("$stringField"));
    }
View Full Code Here


        record.setMetadata(new QName("ns", "field2"),
                new MetadataBuilder()
                        .delete("mfield4")
                        .build());

        WriteOptions options = new WriteOptions();
        options.setUseNamespacePrefixes(false);
        ObjectNode recordNode = RecordWriter.INSTANCE.toJson(record, options, repository);

        // Go through ser/deser
        String recordJson = JsonFormat.serializeAsString(recordNode);
        recordNode = (ObjectNode)JsonFormat.deserializeNonStd(recordJson);
View Full Code Here

TOP

Related Classes of org.lilyproject.tools.import_.json.WriteOptions

Copyright © 2018 www.massapicom. 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.