lucee.Componentcfboom.lang.Object
cfboom.gson.Gson
A wrapper facade to the gson project (https://www.javadoc.io/doc/com.google.code.gson/gson/).
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
loader
|
true
|
false
|
|
any
|
log
|
true
|
false
|
|
any
|
populator
|
true
|
false
|
|
any
|
wirebox
|
true
|
false
|
Constructor Summary | |
---|---|
init()
|
Method Summary | |
---|---|
any
|
fromJson(string json, string class)
This method deserializes the specified Json into an object of the specified class. |
any
|
newJsonReader(any reader)
Returns a new JSON reader configured for the settings on this Gson instance. |
any
|
newJsonWriter(any writer)
Returns a new JSON writer configured for the settings on this Gson instance. |
void
|
onDIComplete()
|
void
|
registerTypeAdapter(string type, TypeAdapter typeAdapter)
Configures Gson for custom serialization or deserialization. |
string
|
toJson(any src)
This method serializes the specified object into its equivalent Json representation. |
Methods inherited from class cfboom.lang.Object |
---|
$equals, getComponentName, getIdentityHashCode, getIdentityString, getMeta, hashCode, toString |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Property Detail |
---|
access
- publicrequired
- falsereturntype
- anyinject
- javaLoader@cfboomGsonserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- logbox:logger:{this}serializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- wirebox:populatorserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- wireboxserializable
- trueMethod Detail |
---|
This method deserializes the specified Json into an object of the specified class.
json
- the string from which the object is to be deserializedclass
- the class of the desired objectReturns a new JSON reader configured for the settings on this Gson instance.
reader
- A java.io.ReaderReturns a new JSON writer configured for the settings on this Gson instance.
writer
- A java.io.WriterConfigures Gson for custom serialization or deserialization. Overwrites any previously registered TypeAdapter with the same type.
type
- Class as defined in getComponentMeta().fullnametypeAdapter
- This object must extend cfboom.gson.TypeAdapter.This method serializes the specified object into its equivalent Json representation.
src
- the object for which Json representation is to be created setting for Gson