@Override protected MapperWrapper wrapMapper(MapperWrapper next) { Mapper m = new CompatibilityMapper(new MapperWrapper(next) { @Override public String serializedClass(Class type) { if (type != null && ImmutableMap.class.isAssignableFrom(type)) return super.serializedClass(ImmutableMap.class); else if (type != null && ImmutableList.class.isAssignableFrom(type)) return super.serializedClass(ImmutableList.class); else return super.serializedClass(type); } }); AnnotationMapper a = new AnnotationMapper(m, getConverterRegistry(), getConverterLookup(), getClassLoader(), getReflectionProvider(), getJvm()); // TODO JENKINS-19561 this is unsafe: a.autodetectAnnotations(true); mapperInjectionPoint = new MapperInjectionPoint(a); return mapperInjectionPoint; }
/** * Set the auto-detection mode of the AnnotationMapper. Note that auto-detection implies that the XStream is * configured while it is processing the XML steams. This is a potential concurrency problem. Also is it technically * not possible to detect all class aliases at deserialization. You have been warned! * * @param mode <code>true</code> if annotations are auto-detected * @since 1.3 */ public void autodetectAnnotations(final boolean mode) { if (annotationMapper != null) { annotationMapper.autodetectAnnotations(mode); } }
@Override protected MapperWrapper wrapMapper(MapperWrapper next) { Mapper m = new CompatibilityMapper(new MapperWrapper(next) { @Override public String serializedClass(Class type) { if (type != null && ImmutableMap.class.isAssignableFrom(type)) return super.serializedClass(ImmutableMap.class); else return super.serializedClass(type); } }); AnnotationMapper a = new AnnotationMapper(m, getConverterRegistry(), getClassLoader(), getReflectionProvider(), getJvm()); a.autodetectAnnotations(true); return a; }
@Override protected MapperWrapper wrapMapper(MapperWrapper next) { Mapper m = new CompatibilityMapper(new MapperWrapper(next) { @Override public String serializedClass(Class type) { if (type != null && ImmutableMap.class.isAssignableFrom(type)) return super.serializedClass(ImmutableMap.class); else return super.serializedClass(type); } }); AnnotationMapper a = new AnnotationMapper(m, getConverterRegistry(), getClassLoader(), getReflectionProvider(), getJvm()); a.autodetectAnnotations(true); return a; }
@Override protected MapperWrapper wrapMapper(MapperWrapper next) { Mapper m = new CompatibilityMapper(new MapperWrapper(next) { @Override public String serializedClass(Class type) { if (type != null && ImmutableMap.class.isAssignableFrom(type)) return super.serializedClass(ImmutableMap.class); else return super.serializedClass(type); } }); AnnotationMapper a = new AnnotationMapper(m, getConverterRegistry(), getClassLoader(), getReflectionProvider(), getJvm()); a.autodetectAnnotations(true); return a; }
@Override protected MapperWrapper wrapMapper(MapperWrapper next) { Mapper m = new CompatibilityMapper(new MapperWrapper(next) { @Override public String serializedClass(Class type) { if (type != null && ImmutableMap.class.isAssignableFrom(type)) return super.serializedClass(ImmutableMap.class); else if (type != null && ImmutableList.class.isAssignableFrom(type)) return super.serializedClass(ImmutableList.class); else return super.serializedClass(type); } }); AnnotationMapper a = new AnnotationMapper(m, getConverterRegistry(), getConverterLookup(), getClassLoader(), getReflectionProvider(), getJvm()); // TODO JENKINS-19561 this is unsafe: a.autodetectAnnotations(true); mapperInjectionPoint = new MapperInjectionPoint(a); return mapperInjectionPoint; }