I have decided to use Simple XML serialization and was stucked with basic problem. I am trying to serialize java.util.UUID
class instance as final field in this sma
I know this is a bit aold but my chance i came to the same exception.
The actual issue is the use of the @Attribute annotation. If instead of @Attribute you put @Element the exception does not appear and the converter is used for the serialization.
I guess it will then depend on which annotation you used that you should create a Converter or use the Marker-Transform solution. Although i do not know if this is the intendent behaviour.
I have to answer by myself again :-)
Advice from Niall Gallagher, project leader of Simple XML, from support-list:
"You could use either a Converter or a Transform. I would say for a UUID a Transform with a Matcher would be the easiest option."
So, I use Transform<T>
/Matcher
and satisfied with it. This does not alter the fact that the Converter<T>
does not work for me :-)
I think i have the answer to this.
Strategy strategy = new AnnotationStrategy();
Serializer serializer = new Persister(strategy);
should register the converter and solve the problem.