Package argo.staj

Examples of argo.staj.JsonStreamElement.text()


        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


                        break;
                    case END_OBJECT:
                        jsonListener.endObject();
                        break;
                    case START_FIELD:
                        jsonListener.startField(jsonStreamElement.text());
                        break;
                    case END_FIELD:
                        jsonListener.endField();
                        break;
                    case NULL:
View Full Code Here

                        break;
                    case FALSE:
                        jsonListener.falseValue();
                        break;
                    case STRING:
                        jsonListener.stringValue(jsonStreamElement.text());
                        break;
                    case NUMBER:
                        jsonListener.numberValue(jsonStreamElement.text());
                        break;
                    default:
View Full Code Here

                        break;
                    case STRING:
                        jsonListener.stringValue(jsonStreamElement.text());
                        break;
                    case NUMBER:
                        jsonListener.numberValue(jsonStreamElement.text());
                        break;
                    default:
                        throw new IllegalStateException("Got a JsonStreamElement of unexpected type: " + jsonStreamElement);
                }
            }
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.