Package org.glassfish.json
Class JsonObjectBuilderImpl
java.lang.Object
org.glassfish.json.JsonObjectBuilderImpl
- All Implemented Interfaces:
JsonObjectBuilder
JsonObjectBuilder implementation
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJsonObjectBuilderImpl
(Map<String, Object> map, BufferPool bufferPool) JsonObjectBuilderImpl
(JsonObject object, BufferPool bufferPool) JsonObjectBuilderImpl
(BufferPool bufferPool) -
Method Summary
Modifier and TypeMethodDescriptionAdds a name/JsonValue#TRUE
or name/JsonValue#FALSE
pair to the JSON object associated with this object builder.Adds a name/JsonNumber
pair to the JSON object associated with this object builder.Adds a name/JsonNumber
pair to the JSON object associated with this object builder.Adds a name/JsonNumber
pair to the JSON object associated with this object builder.Adds a name/JsonString
pair to the JSON object associated with this object builder.add
(String name, BigDecimal value) Adds a name/JsonNumber
pair to the JSON object associated with this object builder.add
(String name, BigInteger value) Adds a name/JsonNumber
pair to the JSON object associated with this object builder.add
(String name, JsonArrayBuilder builder) Adds a name/JsonArray
pair to the JSON object associated with this object builder.add
(String name, JsonObjectBuilder builder) Adds a name/JsonObject
pair to the JSON object associated with this object builder.Adds a name/JsonValue
pair to the JSON object associated with this object builder.addAll
(JsonObjectBuilder builder) Adds all name/value pairs in the JSON object associated with the specified object builder to the JSON object associated with this object builder.Adds a name/JsonValue#NULL
pair to the JSON object associated with this object builder where the value isnull
.build()
Returns the JSON object associated with this object builder.private void
private void
putValueMap
(String name, JsonValue value) Remove the name/value pair from the JSON object associated with this object builder if it is present.private void
validateName
(String name) private void
validateValue
(Object value)
-
Field Details
-
valueMap
-
bufferPool
-
-
Constructor Details
-
JsonObjectBuilderImpl
JsonObjectBuilderImpl(BufferPool bufferPool) -
JsonObjectBuilderImpl
JsonObjectBuilderImpl(JsonObject object, BufferPool bufferPool) -
JsonObjectBuilderImpl
JsonObjectBuilderImpl(Map<String, Object> map, BufferPool bufferPool)
-
-
Method Details
-
add
Description copied from interface:JsonObjectBuilder
Adds a name/JsonValue
pair to the JSON object associated with this object builder. If the object contains a mapping for the specified name, this method replaces the old value with the specified value.- Specified by:
add
in interfaceJsonObjectBuilder
- Parameters:
name
- name in the name/value pairvalue
- value in the name/value pair- Returns:
- this object builder
-
add
Description copied from interface:JsonObjectBuilder
Adds a name/JsonString
pair to the JSON object associated with this object builder. If the object contains a mapping for the specified name, this method replaces the old value with the specified value.- Specified by:
add
in interfaceJsonObjectBuilder
- Parameters:
name
- name in the name/value pairvalue
- value in the name/value pair- Returns:
- this object builder
-
add
Description copied from interface:JsonObjectBuilder
Adds a name/JsonNumber
pair to the JSON object associated with this object builder. If the object contains a mapping for the specified name, this method replaces the old value with the specified value.- Specified by:
add
in interfaceJsonObjectBuilder
- Parameters:
name
- name in the name/value pairvalue
- value in the name/value pair- Returns:
- this object builder
- See Also:
-
add
Description copied from interface:JsonObjectBuilder
Adds a name/JsonNumber
pair to the JSON object associated with this object builder. If the object contains a mapping for the specified name, this method replaces the old value with the specified value.- Specified by:
add
in interfaceJsonObjectBuilder
- Parameters:
name
- name in the name/value pairvalue
- value in the name/value pair- Returns:
- this object builder
- See Also:
-
add
Description copied from interface:JsonObjectBuilder
Adds a name/JsonNumber
pair to the JSON object associated with this object builder. If the object contains a mapping for the specified name, this method replaces the old value with the specified value.- Specified by:
add
in interfaceJsonObjectBuilder
- Parameters:
name
- name in the name/value pairvalue
- value in the name/value pair- Returns:
- this object builder
- See Also:
-
add
Description copied from interface:JsonObjectBuilder
Adds a name/JsonNumber
pair to the JSON object associated with this object builder. If the object contains a mapping for the specified name, this method replaces the old value with the specified value.- Specified by:
add
in interfaceJsonObjectBuilder
- Parameters:
name
- name in the name/value pairvalue
- value in the name/value pair- Returns:
- this object builder
- See Also:
-
add
Description copied from interface:JsonObjectBuilder
Adds a name/JsonNumber
pair to the JSON object associated with this object builder. If the object contains a mapping for the specified name, this method replaces the old value with the specified value.- Specified by:
add
in interfaceJsonObjectBuilder
- Parameters:
name
- name in the name/value pairvalue
- value in the name/value pair- Returns:
- this object builder
- See Also:
-
add
Description copied from interface:JsonObjectBuilder
Adds a name/JsonValue#TRUE
or name/JsonValue#FALSE
pair to the JSON object associated with this object builder. If the object contains a mapping for the specified name, this method replaces the old value with the specified value.- Specified by:
add
in interfaceJsonObjectBuilder
- Parameters:
name
- name in the name/value pairvalue
- value in the name/value pair- Returns:
- this object builder
-
addNull
Description copied from interface:JsonObjectBuilder
Adds a name/JsonValue#NULL
pair to the JSON object associated with this object builder where the value isnull
. If the object contains a mapping for the specified name, this method replaces the old value withnull
.- Specified by:
addNull
in interfaceJsonObjectBuilder
- Parameters:
name
- name in the name/value pair- Returns:
- this object builder
-
add
Description copied from interface:JsonObjectBuilder
Adds a name/JsonObject
pair to the JSON object associated with this object builder. The valueJsonObject
is built from the specified object builder. If the object contains a mapping for the specified name, this method replaces the old value with theJsonObject
from the specified object builder.- Specified by:
add
in interfaceJsonObjectBuilder
- Parameters:
name
- name in the name/value pairbuilder
- the value is the object associated with this builder- Returns:
- this object builder
-
add
Description copied from interface:JsonObjectBuilder
Adds a name/JsonArray
pair to the JSON object associated with this object builder. The valueJsonArray
is built from the specified array builder. If the object contains a mapping for the specified name, this method replaces the old value with theJsonArray
from the specified array builder.- Specified by:
add
in interfaceJsonObjectBuilder
- Parameters:
name
- the name in the name/value pairbuilder
- the value is the object array with this builder- Returns:
- this object builder
-
addAll
Description copied from interface:JsonObjectBuilder
Adds all name/value pairs in the JSON object associated with the specified object builder to the JSON object associated with this object builder. The newly added name/value pair will replace any existing name/value pair with the same name.- Specified by:
addAll
in interfaceJsonObjectBuilder
- Parameters:
builder
- the specified object builder- Returns:
- this object builder
-
remove
Description copied from interface:JsonObjectBuilder
Remove the name/value pair from the JSON object associated with this object builder if it is present.- Specified by:
remove
in interfaceJsonObjectBuilder
- Parameters:
name
- the name in the name/value pair to be removed- Returns:
- this object builder
-
build
Description copied from interface:JsonObjectBuilder
Returns the JSON object associated with this object builder. The iteration order for theJsonObject
is based on the order in which name/value pairs are added to the object using this builder.- Specified by:
build
in interfaceJsonObjectBuilder
- Returns:
- JSON object that is being built
-
populate
-
putValueMap
-
validateName
-
validateValue
-