public class RobustReflectionConverter extends Object implements com.thoughtworks.xstream.converters.Converter
ReflectionConverter
that handle errors more gracefully.
Modifier and Type | Class and Description |
---|---|
static class |
RobustReflectionConverter.DuplicateFieldException |
Modifier and Type | Field and Description |
---|---|
protected com.thoughtworks.xstream.mapper.Mapper |
mapper |
protected com.thoughtworks.xstream.converters.reflection.ReflectionProvider |
reflectionProvider |
protected com.thoughtworks.xstream.core.util.SerializationMembers |
serializationMethodInvoker |
Constructor and Description |
---|
RobustReflectionConverter(com.thoughtworks.xstream.mapper.Mapper mapper,
com.thoughtworks.xstream.converters.reflection.ReflectionProvider reflectionProvider) |
Modifier and Type | Method and Description |
---|---|
static void |
addErrorInContext(com.thoughtworks.xstream.converters.UnmarshallingContext context,
Throwable e) |
boolean |
canConvert(Class type) |
protected void |
doMarshal(Object source,
com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
com.thoughtworks.xstream.converters.MarshallingContext context) |
Object |
doUnmarshal(Object result,
com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
com.thoughtworks.xstream.converters.UnmarshallingContext context) |
protected Object |
instantiateNewInstance(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
com.thoughtworks.xstream.converters.UnmarshallingContext context) |
void |
marshal(Object original,
com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
com.thoughtworks.xstream.converters.MarshallingContext context) |
protected void |
marshallField(com.thoughtworks.xstream.converters.MarshallingContext context,
Object newObj,
Field field) |
Object |
unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
com.thoughtworks.xstream.converters.UnmarshallingContext context) |
protected Object |
unmarshalField(com.thoughtworks.xstream.converters.UnmarshallingContext context,
Object result,
Class type,
Field field) |
protected final com.thoughtworks.xstream.converters.reflection.ReflectionProvider reflectionProvider
protected final com.thoughtworks.xstream.mapper.Mapper mapper
protected transient com.thoughtworks.xstream.core.util.SerializationMembers serializationMethodInvoker
public RobustReflectionConverter(com.thoughtworks.xstream.mapper.Mapper mapper, com.thoughtworks.xstream.converters.reflection.ReflectionProvider reflectionProvider)
public boolean canConvert(Class type)
canConvert
in interface com.thoughtworks.xstream.converters.ConverterMatcher
public void marshal(Object original, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context)
marshal
in interface com.thoughtworks.xstream.converters.Converter
protected void doMarshal(Object source, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context)
protected void marshallField(com.thoughtworks.xstream.converters.MarshallingContext context, Object newObj, Field field)
public Object unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context)
unmarshal
in interface com.thoughtworks.xstream.converters.Converter
public Object doUnmarshal(Object result, com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context)
public static void addErrorInContext(com.thoughtworks.xstream.converters.UnmarshallingContext context, Throwable e)
protected Object unmarshalField(com.thoughtworks.xstream.converters.UnmarshallingContext context, Object result, Class type, Field field)
protected Object instantiateNewInstance(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context)
Copyright © 2004–2022. All rights reserved.