Details
-
Type: Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.2.1
-
Component/s: None
-
Labels:None
-
JDK version and platform:Sun 1.5
Description
I have converters that require intitialization via their constructors (common functionality in an AbstractConverter and text like:
public class MatrixIdConverter extends AbstractMapConverter {
public MatrixIdConverter()
}
the problem is that such a converter invoked via an @XStreamConverter(MatrixIdConverter.class) annotation does not work due to using Sun14ReflectionProvider to instantiate the converter object (AnnotationReflectionConverter.java at about line 35):
protected void marshallField(final MarshallingContext context,
Object newObj, Field field) {
XStreamConverter annotation = annotationProvider.getAnnotation(field, XStreamConverter.class);
if (annotation != null)
else
{ context.convertAnother(newObj); }}
Just because I want to use the non-constructor serialization for my XML serialization does not mean I want to avoid constructors for my converters. Is there a way to avoid this? (I.e. I would think that the code should always use pure Java reflection for instantiating "worker" objects and only use Sun14 style reflection for instantiating deserialized objects.)
revision 1042 uses java usual reflection