Is there a way to query a GsonBuilder
to find out which classes have a registered JsonSerializer
associated with it? I could probably keep track of it myself, but it would be nice if the data was already available in GsonBuilder
. Any help would be appreciated!
No, there isn't.
You can use the getAdapter()
methods in the Gson
class to get the adapter for a specific type, so you could check for any specific one ... but there's not a way to return a list of all of them.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.