addDefaultImplementation(GregorianCalendar.class, Calendar.class);
}
protected void setupConverters() {
// use different ReflectionProvider depending on JDK
final ReflectionConverter reflectionConverter;
if (JVM.is15()) {
Class annotationProvider = jvm
.loadClass("com.thoughtworks.xstream.annotations.AnnotationProvider");
dynamicallyRegisterConverter(
"com.thoughtworks.xstream.annotations.AnnotationReflectionConverter",
PRIORITY_VERY_LOW, new Class[]{
Mapper.class, ReflectionProvider.class, annotationProvider},
new Object[]{
mapper, reflectionProvider,
reflectionProvider.newInstance(annotationProvider)});
reflectionConverter = (ReflectionConverter)converterLookup
.lookupConverterForType(Object.class);
} else {
reflectionConverter = new ReflectionConverter(mapper, reflectionProvider);
registerConverter(reflectionConverter, PRIORITY_VERY_LOW);
}
registerConverter(new SerializableConverter(mapper, reflectionProvider), PRIORITY_LOW);
registerConverter(new ExternalizableConverter(mapper), PRIORITY_LOW);