Package org.glassfish.json
Class JsonObjectBuilderImpl
java.lang.Object
org.glassfish.json.JsonObjectBuilderImpl
- All Implemented Interfaces:
JsonObjectBuilder
JsonObjectBuilder impl
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
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.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
putValueMap
(String name, JsonValue value) private void
validateName
(String name) private void
validateValue
(Object value)
-
Field Details
-
valueMap
-
bufferPool
-
-
Constructor Details
-
JsonObjectBuilderImpl
JsonObjectBuilderImpl(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
-
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
-
putValueMap
-
validateName
-
validateValue
-