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#TRUEor name/JsonValue#FALSEpair to the JSON object associated with this object builder.Adds a name/JsonNumberpair to the JSON object associated with this object builder.Adds a name/JsonNumberpair to the JSON object associated with this object builder.Adds a name/JsonNumberpair to the JSON object associated with this object builder.Adds a name/JsonStringpair to the JSON object associated with this object builder.add(String name, BigDecimal value) Adds a name/JsonNumberpair to the JSON object associated with this object builder.add(String name, BigInteger value) Adds a name/JsonNumberpair to the JSON object associated with this object builder.add(String name, JsonArrayBuilder builder) Adds a name/JsonArraypair to the JSON object associated with this object builder.add(String name, JsonObjectBuilder builder) Adds a name/JsonObjectpair to the JSON object associated with this object builder.Adds a name/JsonValuepair 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#NULLpair to the JSON object associated with this object builder where the value isnull.build()Returns the JSON object associated with this object builder.private voidprivate voidputValueMap(String name, JsonValue value) Remove the name/value pair from the JSON object associated with this object builder if it is present.private voidvalidateName(String name) private voidvalidateValue(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:JsonObjectBuilderAdds a name/JsonValuepair 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:
addin interfaceJsonObjectBuilder- Parameters:
name- name in the name/value pairvalue- value in the name/value pair- Returns:
- this object builder
-
add
Description copied from interface:JsonObjectBuilderAdds a name/JsonStringpair 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:
addin interfaceJsonObjectBuilder- Parameters:
name- name in the name/value pairvalue- value in the name/value pair- Returns:
- this object builder
-
add
Description copied from interface:JsonObjectBuilderAdds a name/JsonNumberpair 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:
addin 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:JsonObjectBuilderAdds a name/JsonNumberpair 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:
addin 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:JsonObjectBuilderAdds a name/JsonNumberpair 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:
addin 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:JsonObjectBuilderAdds a name/JsonNumberpair 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:
addin 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:JsonObjectBuilderAdds a name/JsonNumberpair 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:
addin 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:JsonObjectBuilderAdds a name/JsonValue#TRUEor name/JsonValue#FALSEpair 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:
addin interfaceJsonObjectBuilder- Parameters:
name- name in the name/value pairvalue- value in the name/value pair- Returns:
- this object builder
-
addNull
Description copied from interface:JsonObjectBuilderAdds a name/JsonValue#NULLpair 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:
addNullin interfaceJsonObjectBuilder- Parameters:
name- name in the name/value pair- Returns:
- this object builder
-
add
Description copied from interface:JsonObjectBuilderAdds a name/JsonObjectpair to the JSON object associated with this object builder. The valueJsonObjectis built from the specified object builder. If the object contains a mapping for the specified name, this method replaces the old value with theJsonObjectfrom the specified object builder.- Specified by:
addin 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:JsonObjectBuilderAdds a name/JsonArraypair to the JSON object associated with this object builder. The valueJsonArrayis built from the specified array builder. If the object contains a mapping for the specified name, this method replaces the old value with theJsonArrayfrom the specified array builder.- Specified by:
addin 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:JsonObjectBuilderAdds 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:
addAllin interfaceJsonObjectBuilder- Parameters:
builder- the specified object builder- Returns:
- this object builder
-
remove
Description copied from interface:JsonObjectBuilderRemove the name/value pair from the JSON object associated with this object builder if it is present.- Specified by:
removein interfaceJsonObjectBuilder- Parameters:
name- the name in the name/value pair to be removed- Returns:
- this object builder
-
build
Description copied from interface:JsonObjectBuilderReturns the JSON object associated with this object builder. The iteration order for theJsonObjectis based on the order in which name/value pairs are added to the object using this builder.- Specified by:
buildin interfaceJsonObjectBuilder- Returns:
- JSON object that is being built
-
populate
-
putValueMap
-
validateName
-
validateValue
-