Examples of jsonStreamElementType()


Examples of argo.staj.JsonStreamElement.jsonStreamElementType()

        final FileReader jsonReader = new FileReader(new File(this.getClass().getResource("SimpleExample.json").getFile()));
        Set<String> fieldNames = new HashSet<String>();
        final StajParser stajParser = new StajParser(jsonReader);
        while (stajParser.hasNext()) {
            JsonStreamElement next = stajParser.next();
            if (next.jsonStreamElementType() == JsonStreamElementType.START_FIELD) {
                fieldNames.add(next.text());
            }
        }
        assertThat(fieldNames, equalTo((Set<String>) new HashSet<String>(Arrays.asList("name", "sales", "totalRoyalties", "singles"))));
    }
View Full Code Here

Examples of argo.staj.JsonStreamElement.jsonStreamElementType()

    void parse(final JsonListener jsonListener, final StajParser stajParser) throws InvalidSyntaxException {
        try {
            while (stajParser.hasNext()) {
                final JsonStreamElement jsonStreamElement = stajParser.next();
                switch (jsonStreamElement.jsonStreamElementType()) {
                    case START_DOCUMENT:
                        jsonListener.startDocument();
                        break;
                    case END_DOCUMENT:
                        jsonListener.endDocument();
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.