Package org.infinispan.schematic.document

Examples of org.infinispan.schematic.document.DocumentSequence


                                          boolean introspectStringValues ) {
        // Create an object so that this reader is thread safe ...
        final Tokenizer tokenizer = new Tokenizer(reader);
        ValueMatcher matcher = introspectStringValues ? DATE_VALUE_MATCHER : SIMPLE_VALUE_MATCHER;
        final Parser parser = new Parser(tokenizer, VALUE_FACTORY, matcher);
        return new DocumentSequence() {
            @Override
            public Document nextDocument() throws ParsingException {
                if (tokenizer.isFinished()) return null;
                Document doc = parser.parseDocument(false);
                // System.out.println(Json.writePretty(doc));
View Full Code Here


    }

    @Test
    public void shouldParseMultipleDocuments() throws Exception {
        InputStream stream = getClass().getClassLoader().getResourceAsStream("json/multiple-json-files.txt");
        DocumentSequence seq = reader.readMultiple(stream);
        int count = 0;
        while (true) {
            Document doc = seq.nextDocument();
            if (doc == null) break;
            ++count;
        }
        assertThat(count, is(265));
    }
View Full Code Here

TOP

Related Classes of org.infinispan.schematic.document.DocumentSequence

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.