1
Hello I need to generate an xml with uppercase tags that would necessarily have to be final attributes in the model class to generate xml.
To do this, I’m trying to use the Java Xstream API.
However being these final tags I can not generate, a constructor or create your sets, because they are private?
Is there any way I can solve with Xstream itself or would be better other Java API to solve the problem?
Here’s the class model I’d need. If I leave the attributes unfinished, it would be strange to require my xml tags to be uppercase?
public class Metadados {
private final String NOME_USUARIO;
private final String IDADE_USUARIO;
private final String NUMERO_PROTOCOLO;
}
My XML would need to come out like this:
<NOME_USUARIO>Paulo</NOME_USUARIO>
<COD_USUARIO>36</COD_USUARIO>
<COD_PROTOCOLO>20170111092247</COD_PROTOCOLO>