IonParser extends JsonParser { @Override public JsonToken nextToken() throws IOException, JsonParseException { currentToken = doNextToken(); return currentToken; } IonParser(IonReader reader, boolean shouldCloseReader); @Override ObjectCodec getCodec(); @Override void setCodec(ObjectCodec c); @Override Version version(); @Override void close(); @Override JsonToken nextToken(); @Override JsonToken nextValue(); @Override JsonParser skipChildren(); @Override boolean isClosed(); @Override JsonToken getCurrentToken(); @Override int getCurrentTokenId(); @Override boolean hasCurrentToken(); @Override boolean hasTokenId(int id); @Override boolean hasToken(JsonToken t); @Override String getCurrentName(); @Override JsonStreamContext getParsingContext(); @Override JsonLocation getTokenLocation(); @Override JsonLocation getCurrentLocation(); @Override void clearCurrentToken(); @Override JsonToken getLastClearedToken(); @Override void overrideCurrentName(String name); @Override String getText(); @Override char[] getTextCharacters(); @Override int getTextLength(); @Override int getTextOffset(); @Override boolean hasTextCharacters(); @Override Number getNumberValue(); @Override NumberType getNumberType(); @Override int getIntValue(); @Override long getLongValue(); @Override BigInteger getBigIntegerValue(); @Override float getFloatValue(); @Override double getDoubleValue(); @Override BigDecimal getDecimalValue(); @Override Object getEmbeddedObject(); @Override byte[] getBinaryValue(Base64Variant bv); @Override String getValueAsString(String defaultValue);  }
@Test public void testEmptySexp() throws IOException { IonParser parser = parse("()"); assertEquals(JsonToken.START_ARRAY, parser.nextToken()); assertEquals(JsonToken.END_ARRAY, parser.nextToken()); assertNull(parser.nextToken()); }
@Test public void testNulls() throws IOException { IonParser parser = parse( "null " + "null.null " + "null.bool " + "null.int " + "null.float " + "null.decimal " + "null.timestamp " + "null.string " + "null.symbol " + "null.blob " + "null.clob " + "null.struct " + "null.list " + "null.sexp" ); JsonToken token = null; int count = 0; while ((token = parser.nextToken()) != null) { assertEquals(JsonToken.VALUE_NULL, token); count++; } assertEquals(14, count); }