/** * @deprecated As of 1.4.9 use {@link #addImmutableType(Class, boolean)} */ public void addImmutableType(Class type) { addImmutableType(type, true); }
mapper = new ImmutableTypesMapper(mapper); if (JVM.isVersion(8)) { mapper = buildMapperDynamically("com.thoughtworks.xstream.mapper.LambdaMapper", new Class[]{Mapper.class},
private Mapper buildMapper(ClassLoader cl) { // method exists to replace the default Mapper with the ClassLoaderMapper Mapper mapper = new ClassLoaderMapper(registry, cl); // note do not use XStream11XmlFriendlyMapper mapper = new ClassAliasingMapper(mapper); mapper = new FieldAliasingMapper(mapper); mapper = new AttributeAliasingMapper(mapper); mapper = new AttributeMapper(mapper); mapper = new ImplicitCollectionMapper(mapper); mapper = new DynamicProxyMapper(mapper); if (JVM.is15()) { mapper = new EnumMapper(mapper); } mapper = new OuterClassMapper(mapper); mapper = new ArrayMapper(mapper); mapper = new DefaultImplementationsMapper(mapper); mapper = new ImmutableTypesMapper(mapper); mapper = new CachingMapper(mapper); return mapper; }
/** * Add immutable types. The value of the instances of these types will always be written into the stream even if * they appear multiple times. * <p> * Note, while a reference-keeping marshaller will not write references for immutable types into the stream, a * reference-keeping unmarshaller can still support such references in the stream for compatibility reasons at the * expense of memory consumption. Therefore declare these types only as referenceable if your already persisted * streams do contain such references. Otherwise you may waste a lot of memory during deserialization. * </p> * * @param isReferenceable <code>true</code> if support at deserialization time is required for compatibility at the * cost of a higher memory footprint, <code>false</code> otherwise * @throws InitializationException if no {@link ImmutableTypesMapper} is available * @since 1.4.9 */ public void addImmutableType(final Class type, final boolean isReferenceable) { if (immutableTypesMapper == null) { throw new com.thoughtworks.xstream.InitializationException("No " + ImmutableTypesMapper.class.getName() + " available"); } immutableTypesMapper.addImmutableType(type, isReferenceable); }
mapper = new ImmutableTypesMapper(mapper); if (JVM.is15()) { mapper = buildMapperDynamically(
/** * @deprecated As of 1.4.9 use {@link #addImmutableType(Class, boolean)} */ public void addImmutableType(Class type) { addImmutableType(type, true); }
mapper = new ImmutableTypesMapper(mapper); if (JVM.is15()) { mapper = buildMapperDynamically(ANNOTATION_MAPPER_TYPE, new Class[]{
/** * @deprecated As of 1.4.9 use {@link #addImmutableType(Class, boolean)} */ public void addImmutableType(Class type) { addImmutableType(type, true); }
mapper = new ImmutableTypesMapper(mapper); if (JVM.is15()) { mapper = buildMapperDynamically(
/** * @deprecated As of 1.4.9 use {@link #addImmutableType(Class, boolean)} */ public void addImmutableType(Class type) { addImmutableType(type, true); }
mapper = new EnumMapper(mapper); mapper = new LocalConversionMapper(mapper); mapper = new ImmutableTypesMapper(mapper); if (JVM.isVersion(8)) { mapper = buildMapperDynamically("com.thoughtworks.xstream.mapper.LambdaMapper", new Class[]{Mapper.class},
/** * @deprecated As of 1.4.9 use {@link #addImmutableType(Class, boolean)} */ @Deprecated public void addImmutableType(final Class<?> type) { addImmutableType(type, true); }
mapper = new ImmutableTypesMapper(mapper); if (JVM.isVersion(8)) { mapper = buildMapperDynamically("com.thoughtworks.xstream.mapper.LambdaMapper", new Class[]{Mapper.class},
/** * Add immutable types. The value of the instances of these types will always be written into * the stream even if they appear multiple times. * @throws InitializationException if no {@link ImmutableTypesMapper} is available */ public void addImmutableType(Class type) { if (immutableTypesMapper == null) { throw new InitializationException("No " + ImmutableTypesMapper.class.getName() + " available"); } immutableTypesMapper.addImmutableType(type); }
mapper = new ImmutableTypesMapper(mapper); if (JVM.isVersion(8)) { mapper = buildMapperDynamically("com.thoughtworks.xstream.mapper.LambdaMapper", new Class[]{Mapper.class},
@Override public void addImmutableType(final Class type) { super.addImmutableType(type); if (typeWhitelist != null) { typeWhitelist.allowType(type); } } };
mapper = new ImmutableTypesMapper(mapper); if (JVM.isVersion(8)) { mapper = buildMapperDynamically("com.thoughtworks.xstream.mapper.LambdaMapper", new Class[]{Mapper.class},
/** * Add immutable types. The value of the instances of these types will always be written into * the stream even if they appear multiple times. * @throws InitializationException if no {@link ImmutableTypesMapper} is available */ public void addImmutableType(Class type) { if (immutableTypesMapper == null) { throw new InitializationException("No " + ImmutableTypesMapper.class.getName() + " available"); } immutableTypesMapper.addImmutableType(type); }
/** * Add immutable types. The value of the instances of these types will always be written * into the stream even if they appear multiple times. * * @throws InitializationException if no {@link ImmutableTypesMapper} is available */ public void addImmutableType(Class type) { if (immutableTypesMapper == null) { throw new com.thoughtworks.xstream.InitializationException("No " + ImmutableTypesMapper.class.getName() + " available"); } immutableTypesMapper.addImmutableType(type); }
/** * Add immutable types. The value of the instances of these types will always be written * into the stream even if they appear multiple times. * * @throws InitializationException if no {@link ImmutableTypesMapper} is available */ public void addImmutableType(Class type) { if (immutableTypesMapper == null) { throw new com.thoughtworks.xstream.InitializationException("No " + ImmutableTypesMapper.class.getName() + " available"); } immutableTypesMapper.addImmutableType(type); }