Class JSONBuilderImpl
java.lang.Object
org.tquadrat.foundation.jsonbuilder.internal.JSONBuilderImpl
- All Implemented Interfaces:
JSONBuilder
@ClassVersion(sourceVersion="$Id: JSONBuilderImpl.java 1190 2026-04-08 13:27:20Z tquadrat $")
@API(status=INTERNAL,
since="0.25.0")
public final class JSONBuilderImpl
extends Object
implements JSONBuilder
The implementation for the interface
JSONBuilder.
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: JSONBuilderImpl.java 1190 2026-04-08 13:27:20Z tquadrat $
- Since:
- 0.25.0
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.jsonbuilder.internal.JSONBuilderImpl"
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intThe indentation that is used when aJSONValueis formatted.Fields inherited from interface JSONBuilder
DEFAULT_INDENTATION, JSONField_Unit, JSONField_Value -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal JSONArrayReturns a new empty instance ofJSONArray.final JSONObjectReturns a new empty instance ofJSONObject.final intReturns the indentation that is used when aJSONValueis formatted.final voidsetIndentation(int value) Sets the indentation that is used when aJSONValueis formatted for pretty-printing.valueOf(double value) Returns aJSONValueinstance that represents the givendoublevalue.valueOf(float value) Returns aJSONValueinstance that represents the givenfloatvalue.valueOf(int value) Returns aJSONValueinstance that represents the givenintvalue.valueOf(long value) Returns aJSONValueinstance that represents the givenlongvalue.valueOf(BigDecimal value) Returns aJSONValueinstance that represents the givenBigDecimalvalue.valueOf(BigInteger value) Returns aJSONValueinstance that represents the givenBigIntegervalue.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface JSONBuilder
copyArray, copyObject, createArray, createArray, createArray, createArray, createArray, createArray, createArray, createArray, createArray, createArray, createArray, createArray, createArray, createArray, createObject, valueOf, valueOf, valueOfNull
-
Field Details
-
m_Indentation
-
-
Constructor Details
-
JSONBuilderImpl
public JSONBuilderImpl()Creates a new instance ofJSONBuilder.
-
-
Method Details
-
createArray
Returns a new empty instance of
JSONArray.- Specified by:
createArrayin interfaceJSONBuilder- Returns:
- The new array.
-
createObject
Returns a new empty instance of
JSONObject.- Specified by:
createObjectin interfaceJSONBuilder- Returns:
- The new object.
-
getIndentation
Returns the indentation that is used when a
JSONValueis formatted. If not set explicitly through a call toJSONBuilder.setIndentation(int), the default value (2) will be returned.- Specified by:
getIndentationin interfaceJSONBuilder- Returns:
- The indentation.
- See Also:
-
setIndentation
Sets the indentation that is used when a
JSONValueis formatted for pretty-printing.- Specified by:
setIndentationin interfaceJSONBuilder- Parameters:
value- The indentation.- See Also:
-
valueOf
Returns aJSONValueinstance that represents the givenBigDecimalvalue.- Specified by:
valueOfin interfaceJSONBuilder- Parameters:
value- The value.- Returns:
- The JSON value that represents the given value.
-
valueOf
Returns aJSONValueinstance that represents the givenBigIntegervalue.- Specified by:
valueOfin interfaceJSONBuilder- Parameters:
value- The value- Returns:
- The JSON value that represents the given value.
-
valueOf
Returns aJSONValueinstance that represents the givendoublevalue.- Specified by:
valueOfin interfaceJSONBuilder- Parameters:
value- The value- Returns:
- The JSON value that represents the given value.
-
valueOf
- Specified by:
valueOfin interfaceJSONBuilder- Parameters:
value- The value- Returns:
- The JSON value that represents the given value.
-
valueOf
Returns aJSONValueinstance that represents the givenfloatvalue.- Specified by:
valueOfin interfaceJSONBuilder- Parameters:
value- The value- Returns:
- The JSON value that represents the given value.
-
valueOf
- Specified by:
valueOfin interfaceJSONBuilder- Parameters:
value- The value- Returns:
- The JSON value that represents the given value.
-
valueOf
Returns aJSONValueinstance that represents the givenintvalue.- Specified by:
valueOfin interfaceJSONBuilder- Parameters:
value- The value- Returns:
- The JSON value that represents the given value.
-
valueOf
- Specified by:
valueOfin interfaceJSONBuilder- Parameters:
value- The value- Returns:
- The JSON value that represents the given value.
-
valueOf
Returns aJSONValueinstance that represents the givenlongvalue.- Specified by:
valueOfin interfaceJSONBuilder- Parameters:
value- The value- Returns:
- The JSON value that represents the given value.
-
valueOf
- Specified by:
valueOfin interfaceJSONBuilder- Parameters:
value- The value- Returns:
- The JSON value that represents the given value.
-
valueOf
- Specified by:
valueOfin interfaceJSONBuilder- Parameters:
value- The value- Returns:
- The JSON value that represents the given value.
-
