Search code examples
javaserializationaliasxstream

How to alias object through xstream?


I've got an object which contains list of strings. How is it possible to define that the String.class should be serialized with alias "somealias" instead of "string" through annotations?


Solution

  • @XStreamImplicit(itemFieldName="somealias")
    private List<String> content;