Package org.hibernate.type.format
Class StringJsonDocumentWriter
java.lang.Object
org.hibernate.type.format.StringJsonDocument
org.hibernate.type.format.StringJsonDocumentWriter
- All Implemented Interfaces:
JsonDocumentWriter
Implementation of
JsonDocumentWriter for String-based OSON document.
This implementation will receive a StringJsonDocumentWriter.JsonAppender to a serialze JSON object to it-
Field Summary
Fields inherited from class org.hibernate.type.format.StringJsonDocument
processingStates -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new StringJsonDocumentWriter.Creates a new StringJsonDocumentWriter. -
Method Summary
Modifier and TypeMethodDescriptionbooleanValue(boolean value) Adds a new JSON element boolean value.endArray()Callback to be called when the end of an array is encountered.Callback to be called when the end of an JSON object is encountered.getJson()Adds a new JSON element null value.numericValue(Number value) Adds a new JSON element numeric value.Adds a new JSON element name.serializeJsonValue(Object value, JavaType<T> javaType, JdbcType jdbcType, WrapperOptions options) Adds a JSON value to the documentCallback to be called when the start of an array is encountered.Callback to be called when the start of an JSON object is encountered.stringValue(String value) Adds a new JSON element string value.toString()
-
Constructor Details
-
StringJsonDocumentWriter
public StringJsonDocumentWriter()Creates a new StringJsonDocumentWriter. -
StringJsonDocumentWriter
Creates a new StringJsonDocumentWriter.- Parameters:
sb- the StringBuilder to receive the serialized JSON
-
-
Method Details
-
startObject
Callback to be called when the start of an JSON object is encountered.- Specified by:
startObjectin interfaceJsonDocumentWriter- Returns:
- this instance
-
endObject
Callback to be called when the end of an JSON object is encountered.- Specified by:
endObjectin interfaceJsonDocumentWriter- Returns:
- this instance
-
startArray
Callback to be called when the start of an array is encountered.- Specified by:
startArrayin interfaceJsonDocumentWriter- Returns:
- this instance
-
endArray
Callback to be called when the end of an array is encountered.- Specified by:
endArrayin interfaceJsonDocumentWriter- Returns:
- this instance
-
objectKey
Description copied from interface:JsonDocumentWriterAdds a new JSON element name.- Specified by:
objectKeyin interfaceJsonDocumentWriter- Parameters:
key- the element name.- Returns:
- this instance
-
nullValue
Description copied from interface:JsonDocumentWriterAdds a new JSON element null value.- Specified by:
nullValuein interfaceJsonDocumentWriter- Returns:
- this instance
-
numericValue
Description copied from interface:JsonDocumentWriterAdds a new JSON element numeric value.- Specified by:
numericValuein interfaceJsonDocumentWriter- Parameters:
value- the element numeric name.- Returns:
- this instance
-
booleanValue
Description copied from interface:JsonDocumentWriterAdds a new JSON element boolean value.- Specified by:
booleanValuein interfaceJsonDocumentWriter- Parameters:
value- the element boolean name.- Returns:
- this instance
-
stringValue
Description copied from interface:JsonDocumentWriterAdds a new JSON element string value.- Specified by:
stringValuein interfaceJsonDocumentWriter- Parameters:
value- the element string name.- Returns:
- this instance
-
serializeJsonValue
public <T> JsonDocumentWriter serializeJsonValue(Object value, JavaType<T> javaType, JdbcType jdbcType, WrapperOptions options) Description copied from interface:JsonDocumentWriterAdds a JSON value to the document- Specified by:
serializeJsonValuein interfaceJsonDocumentWriter- Parameters:
value- the value to be serializedjavaType- the Java type of the valuejdbcType- the JDBC type for the value to be serializedoptions- the wrapping options- Returns:
- this instance
-
getJson
-
toString
-