Finishing touches on JsonElementWriter

This commit is contained in:
Jesse Wilson 2011-10-01 00:42:28 +00:00
parent 349c01e861
commit 70abd0ba87
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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();