Theoretically, when you use
restfulie.getMediaTypes().register(new XmlMediaType().withTypes(Produto.class));
it should call xstream.processAnnotations(Produto.class);
And yes, it adds hypermedia capabilities to the Produto class serialization.
if you want to add custom converters, you should subclass the mediaType:
restfulie.getMediaTypes().register(new XmlMediaType() {
@Override
protected void configure(XStream xstream) {
xstream.registerConverter(new MyCustomConverter());
}
});
If it is possible, use the first approach.
What is the error message of the CannotResolveClassException?
[]'s