Search code examples
javaxmlxstream

XStream ProcessAnnotations


I am using XStream to convert an array in java to xml. I am adding this line to use annotations.

 XStream xStream = new XStream();
xStream.processAnnotations(CollectionConverter.class);

But it says processAnnotations is undefined for xStream. I have xstream.jar in the build path. What Am I missing?


Solution

  • XStream processAnnotations method has been introduced in XStream version 1.3, for older versions Annotations.configureAliases(XStream xstream, Class<?>... topLevelClasses) method can be used instead.