Finishing touches on JsonElementWriter
This commit is contained in:
parent
349c01e861
commit
70abd0ba87
@ -58,6 +58,9 @@ public final class JsonElementWriter extends JsonWriter {
|
||||
super(UNWRITABLE_WRITER);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the top level object produced by this writer.
|
||||
*/
|
||||
public JsonElement get() {
|
||||
if (!stack.isEmpty()) {
|
||||
throw new IllegalStateException("Expected one JSON element but was " + stack);
|
||||
|
@ -21,9 +21,6 @@ import java.io.IOException;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public final class JsonElementWriterTest extends TestCase {
|
||||
|
||||
// TODO: figure out what should be returned by an empty writer
|
||||
|
||||
public void testArray() throws IOException {
|
||||
JsonElementWriter writer = new JsonElementWriter();
|
||||
writer.beginArray();
|
||||
|
Loading…
Reference in New Issue
Block a user