Skip to content

Commit e50aaad

Browse files
committed
Merge pull request #253 from gcxRun/EmbeddedObject#243
JsonGenerator - support passing opaque datatypes
2 parents c33fcb8 + 858568c commit e50aaad

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/main/java/com/fasterxml/jackson/core/JsonGenerator.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,6 +1236,17 @@ public void writeTypeId(Object id) throws IOException {
12361236
throw new JsonGenerationException("No native support for writing Type Ids", this);
12371237
}
12381238

1239+
/**
1240+
* Method that can be called on backends that support passing opaque datatypes of
1241+
* non-JSON formats
1242+
*
1243+
* @since 2.8
1244+
*/
1245+
public void writeEmbeddedObject(Object object) throws IOException {
1246+
throw new JsonGenerationException("No native support for writing embedded objects",
1247+
this);
1248+
}
1249+
12391250
/*
12401251
/**********************************************************
12411252
/* Public API, write methods, serializing Java objects

src/main/java/com/fasterxml/jackson/core/util/JsonGeneratorDelegate.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,9 @@ public JsonGenerator setPrettyPrinter(PrettyPrinter pp) {
326326

327327
@Override
328328
public void writeTypeId(Object id) throws IOException { delegate.writeTypeId(id); }
329+
330+
@Override
331+
public void writeEmbeddedObject(Object object) throws IOException { delegate.writeEmbeddedObject(object); }
329332

330333
/*
331334
/**********************************************************

0 commit comments

Comments
 (0)