Skip to content

Commit

Permalink
Fix #517
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Aug 15, 2019
1 parent 2ea7b19 commit 851a379
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
6 changes: 5 additions & 1 deletion release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ JSON library.
=== Releases ===
------------------------------------------------------------------------

2.10.0.pr2

#517: Add `JsonGenerator.writeStartObject(Object, int)` (needed by CBOR, maybe Avro)
#549: Add configurability of "quote character" for JSON factory

2.10.0.pr1 (19-Jul-2019)

#433: Add Builder pattern for creating configured Stream factories
Expand All @@ -39,7 +44,6 @@ JSON library.
(reported by Alex R)
#548: ByteQuadsCanonicalizer: ArrayIndexOutOfBoundsException in addName
(reported by Alex R)
#549: Add configurability of "quote character" for JSON factory

2.9.10 (not yet released)

Expand Down
19 changes: 18 additions & 1 deletion src/main/java/com/fasterxml/jackson/core/JsonGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ public void setCurrentValue(Object v) {
*/
public abstract void writeStartArray() throws IOException;

// TODO: deprecate in 2.11 (remove from 3.0)
/**
* Method for writing start marker of an Array value, similar
* to {@link #writeStartArray()}, but also specifying how many
Expand All @@ -743,7 +744,23 @@ public void setCurrentValue(Object v) {
public void writeStartArray(int size) throws IOException {
writeStartArray();
}


/**
* @since 2.10
*/
public void writeStartArray(Object forValue) throws IOException {
writeStartArray();
setCurrentValue(forValue);
}

/**
* @since 2.10
*/
public void writeStartArray(Object forValue, int size) throws IOException {
writeStartArray(size);
setCurrentValue(forValue);
}

/**
* Method for writing closing marker of a JSON Array value
* (character ']'; plus possible white space decoration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ public JsonGenerator setPrettyPrinter(PrettyPrinter pp) {
@Override
public void writeStartArray(int size) throws IOException { delegate.writeStartArray(size); }

@Override
public void writeStartArray(Object forValue) throws IOException { delegate.writeStartArray(forValue); }

@Override
public void writeStartArray(Object forValue, int size) throws IOException { delegate.writeStartArray(forValue, size); }

@Override
public void writeEndArray() throws IOException { delegate.writeEndArray(); }

Expand Down

0 comments on commit 851a379

Please sign in to comment.