Class JsonArrayBuilderImpl
java.lang.Object
org.glassfish.json.JsonArrayBuilderImpl
- All Implemented Interfaces:
JsonArrayBuilder
JsonArrayBuilder implementation
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJsonArrayBuilderImpl(Collection<?> collection, BufferPool bufferPool) JsonArrayBuilderImpl(JsonArray array, BufferPool bufferPool) JsonArrayBuilderImpl(BufferPool bufferPool) -
Method Summary
Modifier and TypeMethodDescriptionadd(boolean value) Adds aJsonValue.TRUEorJsonValue.FALSEvalue to the array.add(double value) Adds a value to the array as aJsonNumber.add(int value) Adds a value to the array as aJsonNumber.add(int index, boolean value) Adds aJsonValue.TRUEorJsonValue.FALSEvalue to the array at the specified position.add(int index, double value) Adds a value to the array as aJsonNumberat the specified position.add(int index, int value) Adds a value to the array as aJsonNumberat the specified position.add(int index, long value) Adds a value to the array as aJsonNumberat the specified position.Adds a value to the array as aJsonStringat the specified position.add(int index, BigDecimal value) Adds a value to the array as aJsonNumberat the specified position.add(int index, BigInteger value) Adds a value to the array as aJsonNumberat the specified position.add(int index, JsonArrayBuilder builder) Adds aJsonArrayfrom an array builder to the array at the specified position.add(int index, JsonObjectBuilder builder) Adds aJsonObjectfrom an object builder to the array at the specified position.Inserts a value to the array at the specified position.add(long value) Adds a value to the array as aJsonNumber.Adds a value to the array as aJsonString.add(BigDecimal value) Adds a value to the array as aJsonNumber.add(BigInteger value) Adds a value to the array as aJsonNumber.add(JsonArrayBuilder builder) Adds aJsonArrayfrom an array builder to the array.add(JsonObjectBuilder builder) Adds aJsonObjectfrom an object builder to the array.Adds a value to the array.addAll(JsonArrayBuilder builder) Adds all elements of the array in the specified array builder to the array.addNull()Adds aJsonValue.NULLvalue to the array.addNull(int index) Adds aJsonValue.NULLvalue to the array at the specified position.private voidaddValueList(int index, JsonValue value) private voidaddValueList(JsonValue value) build()Returns the current array.private voidpopulate(Collection<?> collection) remove(int index) Remove the value in the array at the specified position.set(int index, boolean value) Replaces a value in the array with aJsonValue.TRUEorJsonValue.FALSEvalue at the specified position.set(int index, double value) Replaces a value in the array with the specified value as aJsonNumberat the specified position.set(int index, int value) Replaces a value in the array with the specified value as aJsonNumberat the specified position.set(int index, long value) Replaces a value in the array with the specified value as aJsonNumberat the specified position.Replaces a value in the array with the specified value as aJsonStringat the specified position.set(int index, BigDecimal value) Replaces a value in the array with the specified value as aJsonNumberat the specified position.set(int index, BigInteger value) Replaces a value in the array with the specified value as aJsonNumberat the specified position.set(int index, JsonArrayBuilder builder) Replaces a value in the array with the specified value as aJsonArrayfrom an array builder at the specified position.set(int index, JsonObjectBuilder builder) Replaces a value in the array with the specified value as aJsonObjectfrom an object builder at the specified position.Replaces a value in the array with the specified value at the specified position.setNull(int index) Replaces a value in the array with aJsonValue.NULLvalue at the specified position.private voidsetValueList(int index, JsonValue value) private voidvalidateValue(Object value)
-
Field Details
-
valueList
-
bufferPool
-
-
Constructor Details
-
JsonArrayBuilderImpl
JsonArrayBuilderImpl(BufferPool bufferPool) -
JsonArrayBuilderImpl
JsonArrayBuilderImpl(JsonArray array, BufferPool bufferPool) -
JsonArrayBuilderImpl
JsonArrayBuilderImpl(Collection<?> collection, BufferPool bufferPool)
-
-
Method Details
-
add
Description copied from interface:JsonArrayBuilderAdds a value to the array.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
value- the JSON value- Returns:
- this array builder
-
add
Description copied from interface:JsonArrayBuilderAdds a value to the array as aJsonString.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
value- the string value- Returns:
- this array builder
-
add
Description copied from interface:JsonArrayBuilderAdds a value to the array as aJsonNumber.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
value- the number value- Returns:
- this array builder
- See Also:
-
add
Description copied from interface:JsonArrayBuilderAdds a value to the array as aJsonNumber.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
value- the number value- Returns:
- this array builder
- See Also:
-
add
Description copied from interface:JsonArrayBuilderAdds a value to the array as aJsonNumber.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
value- the number value- Returns:
- this array builder
- See Also:
-
add
Description copied from interface:JsonArrayBuilderAdds a value to the array as aJsonNumber.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
value- the number value- Returns:
- this array builder
- See Also:
-
add
Description copied from interface:JsonArrayBuilderAdds a value to the array as aJsonNumber.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
value- the number value- Returns:
- this array builder
- See Also:
-
add
Description copied from interface:JsonArrayBuilderAdds aJsonValue.TRUEorJsonValue.FALSEvalue to the array.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
value- the boolean value- Returns:
- this array builder
-
addNull
Description copied from interface:JsonArrayBuilderAdds aJsonValue.NULLvalue to the array.- Specified by:
addNullin interfaceJsonArrayBuilder- Returns:
- this array builder
-
add
Description copied from interface:JsonArrayBuilderAdds aJsonObjectfrom an object builder to the array.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
builder- the object builder- Returns:
- this array builder
-
add
Description copied from interface:JsonArrayBuilderAdds aJsonArrayfrom an array builder to the array.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
builder- the array builder- Returns:
- this array builder
-
addAll
Description copied from interface:JsonArrayBuilderAdds all elements of the array in the specified array builder to the array.- Specified by:
addAllin interfaceJsonArrayBuilder- Parameters:
builder- the array builder- Returns:
- this array builder
-
add
Description copied from interface:JsonArrayBuilderInserts a value to the array at the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
index- the position in the arrayvalue- the JSON value- Returns:
- this array builder
-
add
Description copied from interface:JsonArrayBuilderAdds a value to the array as aJsonStringat the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
index- the position in the arrayvalue- the string value- Returns:
- this array builder
-
add
Description copied from interface:JsonArrayBuilderAdds a value to the array as aJsonNumberat the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
index- the position in the arrayvalue- the number value- Returns:
- this array builder
- See Also:
-
add
Description copied from interface:JsonArrayBuilderAdds a value to the array as aJsonNumberat the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
index- the position in the arrayvalue- the number value- Returns:
- this array builder
- See Also:
-
add
Description copied from interface:JsonArrayBuilderAdds a value to the array as aJsonNumberat the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
index- the position in the arrayvalue- the number value- Returns:
- this array builder
- See Also:
-
add
Description copied from interface:JsonArrayBuilderAdds a value to the array as aJsonNumberat the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
index- the position in the arrayvalue- the number value- Returns:
- this array builder
- See Also:
-
add
Description copied from interface:JsonArrayBuilderAdds a value to the array as aJsonNumberat the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
index- the position in the arrayvalue- the number value- Returns:
- this array builder
- See Also:
-
add
Description copied from interface:JsonArrayBuilderAdds aJsonValue.TRUEorJsonValue.FALSEvalue to the array at the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
index- the position in the arrayvalue- the boolean value- Returns:
- this array builder
-
addNull
Description copied from interface:JsonArrayBuilderAdds aJsonValue.NULLvalue to the array at the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.- Specified by:
addNullin interfaceJsonArrayBuilder- Parameters:
index- the position in the array- Returns:
- this array builder
-
add
Description copied from interface:JsonArrayBuilderAdds aJsonObjectfrom an object builder to the array at the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
index- the position in the arraybuilder- the object builder- Returns:
- this array builder
-
add
Description copied from interface:JsonArrayBuilderAdds aJsonArrayfrom an array builder to the array at the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.- Specified by:
addin interfaceJsonArrayBuilder- Parameters:
index- the position in the arraybuilder- the array builder- Returns:
- this array builder
-
set
Description copied from interface:JsonArrayBuilderReplaces a value in the array with the specified value at the specified position.- Specified by:
setin interfaceJsonArrayBuilder- Parameters:
index- the position in the arrayvalue- the JSON value- Returns:
- this array builder
-
set
Description copied from interface:JsonArrayBuilderReplaces a value in the array with the specified value as aJsonStringat the specified position.- Specified by:
setin interfaceJsonArrayBuilder- Parameters:
index- the position in the arrayvalue- the string value- Returns:
- this array builder
-
set
Description copied from interface:JsonArrayBuilderReplaces a value in the array with the specified value as aJsonNumberat the specified position.- Specified by:
setin interfaceJsonArrayBuilder- Parameters:
index- the position in the arrayvalue- the number value- Returns:
- this array builder
- See Also:
-
set
Description copied from interface:JsonArrayBuilderReplaces a value in the array with the specified value as aJsonNumberat the specified position.- Specified by:
setin interfaceJsonArrayBuilder- Parameters:
index- the position in the arrayvalue- the number value- Returns:
- this array builder
- See Also:
-
set
Description copied from interface:JsonArrayBuilderReplaces a value in the array with the specified value as aJsonNumberat the specified position.- Specified by:
setin interfaceJsonArrayBuilder- Parameters:
index- the position in the arrayvalue- the number value- Returns:
- this array builder
- See Also:
-
set
Description copied from interface:JsonArrayBuilderReplaces a value in the array with the specified value as aJsonNumberat the specified position.- Specified by:
setin interfaceJsonArrayBuilder- Parameters:
index- the position in the arrayvalue- the number value- Returns:
- this array builder
- See Also:
-
set
Description copied from interface:JsonArrayBuilderReplaces a value in the array with the specified value as aJsonNumberat the specified position.- Specified by:
setin interfaceJsonArrayBuilder- Parameters:
index- the position in the arrayvalue- the number value- Returns:
- this array builder
- See Also:
-
set
Description copied from interface:JsonArrayBuilderReplaces a value in the array with aJsonValue.TRUEorJsonValue.FALSEvalue at the specified position.- Specified by:
setin interfaceJsonArrayBuilder- Parameters:
index- the position in the arrayvalue- the boolean value- Returns:
- this array builder
-
setNull
Description copied from interface:JsonArrayBuilderReplaces a value in the array with aJsonValue.NULLvalue at the specified position.- Specified by:
setNullin interfaceJsonArrayBuilder- Parameters:
index- the position in the array- Returns:
- this array builder
-
set
Description copied from interface:JsonArrayBuilderReplaces a value in the array with the specified value as aJsonObjectfrom an object builder at the specified position.- Specified by:
setin interfaceJsonArrayBuilder- Parameters:
index- the position in the arraybuilder- the object builder- Returns:
- this array builder
-
set
Description copied from interface:JsonArrayBuilderReplaces a value in the array with the specified value as aJsonArrayfrom an array builder at the specified position.- Specified by:
setin interfaceJsonArrayBuilder- Parameters:
index- the position in the arraybuilder- the array builder- Returns:
- this array builder
-
remove
Description copied from interface:JsonArrayBuilderRemove the value in the array at the specified position. Shift any subsequent values to the left (subtracts one from their indices.- Specified by:
removein interfaceJsonArrayBuilder- Parameters:
index- the position in the array- Returns:
- this array builder
-
build
Description copied from interface:JsonArrayBuilderReturns the current array.- Specified by:
buildin interfaceJsonArrayBuilder- Returns:
- the current JSON array
-
populate
-
addValueList
-
addValueList
-
setValueList
-
validateValue
-