1
I have a Rest service that returns as a response the object of a class that contains the following structure:
public class LocalizacaoLinhaWrapper implements
Serializable {
...
private List<LocalizacaoLinha> linhasFavoritas;
private List<LocalizacaoLinha> linhasNaoFavoritas;
public boolean isEmpty() {
return linhasNaoFavoritas.isEmpty() && linhasNaoFavoritas.isEmpty();
}
//Getters e setters
}
I use the following command to return the answer:
LocalizacaoLinhaWrapperDTO wrapper = service.minhaConsulta()//realizo a consulta
Response.status(Status.OK).entity(localizacaoWrapper).build()
When I request this service everything is serialized correctly, however I have an intruder called empty
in my json, which was generated on account of the existence of the method LocalizacaoLinhaWrapper.isEmpty()
.
Is it possible to define that this method is despised at the time of serialization? If so, how to do it?
@Brunocésar, sim, o Provider padrão. I made an issue in the question.
– Geison Santos
I added yes, but it didn’t work. It belongs to the javax.xml.bind.annotation.Xmltransient package?
– Geison Santos
I am using Jboss7. To be exact Jboss 7.1.
– Geison Santos