You can use the library GSON
//Instancia o gson
Gson gson = new Gson();
//Usa o método gson.fromJson para trans formar o json (primeiro argumento) em uma classe (segundo argumento)
ApiSumario apiSumario = gson.fromJson(json, ApiSumario.class);
Classes:
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"Sumario"
})
public class Example {
@JsonProperty("Sumario")
public Sumario sumario;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"Termo",
"Tipo",
"Editora",
"Autor",
"Numero",
"Ultima Atualizacao",
"Time Zone"
})
public class Sumario {
@JsonProperty("Termo")
public String termo;
@JsonProperty("Tipo")
public String tipo;
@JsonProperty("Editora")
public String editora;
@JsonProperty("Autor")
public String autor;
@JsonProperty("Numero")
public String numero;
@JsonProperty("Ultima Atualizacao")
public String ultimaAtualizacao;
@JsonProperty("Time Zone")
public String timeZone;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}
Example using lib retrofit: https://code.tutsplus.com/tutorials/getting-started-with-retrofit-2--cms-27792
– Igor Oliveira