Class PolymorphicReflectionConverter
- java.lang.Object
-
- com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter
-
- com.thoughtworks.xstream.converters.reflection.ReflectionConverter
-
- org.datadog.jenkins.plugins.datadog.util.conversion.PolymorphicReflectionConverter
-
- All Implemented Interfaces:
com.thoughtworks.xstream.converters.Converter
,com.thoughtworks.xstream.converters.ConverterMatcher
,com.thoughtworks.xstream.core.Caching
public class PolymorphicReflectionConverter extends com.thoughtworks.xstream.converters.reflection.ReflectionConverter
A subtype of reflection converter that is capable of handling polymorphic fields (when the declared field type is an interface or a parent class and its value is an instance of an implementation or a child class).When marshalling, the converter writes additional
resolves-to
attribute that contains the name of the serialized class. When unmarshalling, theAbstractReflectionConverter.instantiateNewInstance(HierarchicalStreamReader, UnmarshallingContext)
method reads the attribute and creates an instance of the correct class.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.DuplicateFieldException, com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.UnknownFieldException
-
-
Constructor Summary
Constructors Constructor Description PolymorphicReflectionConverter(com.thoughtworks.xstream.mapper.Mapper mapper, com.thoughtworks.xstream.converters.reflection.ReflectionProvider reflectionProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
marshal(Object original, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context)
-
Methods inherited from class com.thoughtworks.xstream.converters.reflection.ReflectionConverter
canConvert
-
-
-
-
Method Detail
-
marshal
public void marshal(Object original, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context)
- Specified by:
marshal
in interfacecom.thoughtworks.xstream.converters.Converter
- Overrides:
marshal
in classcom.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter
-
-