title: GSON - trim string during deserialization from JSON
body: <p>I have a JSON string that is parsed using the GSON library into a Map like so:</p>
  <pre><code>static Type type = new TypeToken&lt;Map&lt;String, String&gt;&gt;() {}.getType();
  // note the trailing/leading white spaces
  String data = &quot;{'employee.name':'Bob  ','employee.country':'  Spain  '}&quot;;
  
  Map&lt;String, String&gt; parsedData = gson.fromJson(data, type);
  </code></pre>
  <p>The problem I have is, my JSON attribute values have trailing/leading whitespaces that needs to be trimmed. Ideally, I want this to be done when the data is parsed to the Map using GSON. Is something like this possible?</p>