java.lang.Object
org.eclipse.yasson.internal.jsonstructure.JsonStructureBuilder
org.eclipse.yasson.internal.jsonstructure.JsonObjectBuilder
Builds
JsonObject
delegates to JsonObjectBuilder
, caches key when
written without a value.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJsonObjectBuilder
(jakarta.json.spi.JsonProvider provider) Create instance with cached provider. -
Method Summary
Modifier and TypeMethodDescription(package private) jakarta.json.JsonStructure
build()
Build and get constructedJsonStructure
.private String
(package private) void
put
(jakarta.json.JsonStructure structure) Puts anotherJsonStructure
into current.(package private) void
Puts anotherJsonStructure
into current using provided key.(package private) void
write
(boolean value) Write a value into currentJsonStructure
.(package private) void
write
(double value) Write a value into currentJsonStructure
.(package private) void
write
(int value) Write a value into currentJsonStructure
.(package private) void
write
(long value) Write a value into currentJsonStructure
.(package private) void
write
(jakarta.json.JsonValue value) Write a value into currentJsonStructure
.(package private) void
Write a value into currentJsonStructure
.(package private) void
Write a key-value pair into currentJsonObject
.(package private) void
Write a key-value pair into currentJsonObject
.(package private) void
Write a key-value pair into currentJsonObject
.(package private) void
Write a key-value pair into currentJsonObject
.(package private) void
Write a key-value pair into currentJsonObject
.(package private) void
Write a key-value pair into currentJsonObject
.(package private) void
write
(String name, BigDecimal value) Write a key-value pair into currentJsonObject
.(package private) void
write
(String name, BigInteger value) Write a key-value pair into currentJsonObject
.(package private) void
write
(BigDecimal value) Write a value into currentJsonStructure
.(package private) void
write
(BigInteger value) Write a value into currentJsonStructure
.(package private) void
Store a key for putting next value into builtJsonObject
.(package private) void
Write null into currentJsonStructure
.(package private) void
Write a null into currentJsonObject
with a given key.
-
Field Details
-
builder
private final jakarta.json.JsonObjectBuilder builder -
nextKey
-
-
Constructor Details
-
JsonObjectBuilder
JsonObjectBuilder(jakarta.json.spi.JsonProvider provider) Create instance with cached provider.- Parameters:
provider
- Json provider to create JsonObjectBuilder on.
-
-
Method Details
-
build
jakarta.json.JsonStructure build()Description copied from class:JsonStructureBuilder
Build and get constructedJsonStructure
.- Specified by:
build
in classJsonStructureBuilder
- Returns:
- JsonStructure result.
-
put
void put(jakarta.json.JsonStructure structure) Description copied from class:JsonStructureBuilder
Puts anotherJsonStructure
into current. If current isJsonObject
than last written key is used.- Specified by:
put
in classJsonStructureBuilder
-
put
Puts anotherJsonStructure
into current using provided key.- Parameters:
name
- key to put JsonStructure under.structure
- JsonStructure to put.
-
write
void write(jakarta.json.JsonValue value) Description copied from class:JsonStructureBuilder
Write a value into currentJsonStructure
. If current isJsonObject
, last stored key bywriteKey(String)
is used.- Specified by:
write
in classJsonStructureBuilder
- Parameters:
value
- A value to write.
-
write
Description copied from class:JsonStructureBuilder
Write a value into currentJsonStructure
. If current isJsonObject
, last stored key bywriteKey(String)
is used.- Specified by:
write
in classJsonStructureBuilder
- Parameters:
value
- A value to write.
-
write
Description copied from class:JsonStructureBuilder
Write a value into currentJsonStructure
. If current isJsonObject
, last stored key bywriteKey(String)
is used.- Specified by:
write
in classJsonStructureBuilder
- Parameters:
value
- A value to write.
-
write
Description copied from class:JsonStructureBuilder
Write a value into currentJsonStructure
. If current isJsonObject
, last stored key bywriteKey(String)
is used.- Specified by:
write
in classJsonStructureBuilder
- Parameters:
value
- A value to write.
-
write
void write(int value) Description copied from class:JsonStructureBuilder
Write a value into currentJsonStructure
. If current isJsonObject
, last stored key bywriteKey(String)
is used.- Specified by:
write
in classJsonStructureBuilder
- Parameters:
value
- A value to write.
-
write
void write(long value) Description copied from class:JsonStructureBuilder
Write a value into currentJsonStructure
. If current isJsonObject
, last stored key bywriteKey(String)
is used.- Specified by:
write
in classJsonStructureBuilder
- Parameters:
value
- A value to write.
-
write
void write(double value) Description copied from class:JsonStructureBuilder
Write a value into currentJsonStructure
. If current isJsonObject
, last stored key bywriteKey(String)
is used.- Specified by:
write
in classJsonStructureBuilder
- Parameters:
value
- A value to write.
-
write
void write(boolean value) Description copied from class:JsonStructureBuilder
Write a value into currentJsonStructure
. If current isJsonObject
, last stored key bywriteKey(String)
is used.- Specified by:
write
in classJsonStructureBuilder
- Parameters:
value
- A value to write.
-
writeNull
void writeNull()Description copied from class:JsonStructureBuilder
Write null into currentJsonStructure
. If current isJsonObject
, last stored key bywriteKey(String)
is used.- Specified by:
writeNull
in classJsonStructureBuilder
-
write
Write a key-value pair into currentJsonObject
.- Parameters:
name
- Key name to write value with.value
- A value to write.
-
write
Write a key-value pair into currentJsonObject
.- Parameters:
name
- Key name to write value with.value
- A value to write.
-
write
Write a key-value pair into currentJsonObject
.- Parameters:
name
- Key name to write value with.value
- A value to write.
-
write
Write a key-value pair into currentJsonObject
.- Parameters:
name
- Key name to write value with.value
- A value to write.
-
write
Write a key-value pair into currentJsonObject
.- Parameters:
name
- Key name to write value with.value
- A value to write.
-
write
Write a key-value pair into currentJsonObject
.- Parameters:
name
- Key name to write value with.value
- A value to write.
-
write
Write a key-value pair into currentJsonObject
.- Parameters:
name
- Key name to write value with.value
- A value to write.
-
write
Write a key-value pair into currentJsonObject
.- Parameters:
name
- Key name to write value with.value
- A value to write.
-
writeNull
Write a null into currentJsonObject
with a given key.- Parameters:
name
- Key name to write null with.
-
writeKey
Store a key for putting next value into builtJsonObject
.- Parameters:
key
- Key to store.
-
getNextKey
-