0
I’m having the need to serialize and deserialize an attribute that your Json reference has a different name. For example, in the Json I’m receiving there is a field text
and would like the value of this attribute to be filled in my attribute called descricao
.
This would not normally happen since the Gson framework relates fields and attributes with equal names, that is, Gson will search in my Java class an attribute text
to enter the attribute value text
from Json, but my case is different.
I also wonder if it is possible to do the same but when serializing an object, for example taking the value that is in the field descricao
and inserting into an element text
json.
Is all this possible? If so, how could it be done?
Consider adding line breaks to your question for easy reading.
– lazyFox
Added line breaks, @lazyFox. Thank you for the suggestion.
– Tássio Auad