Class LambdaConverter
- java.lang.Object
-
- com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter
-
- com.thoughtworks.xstream.converters.reflection.SerializableConverter
-
- com.thoughtworks.xstream.converters.reflection.LambdaConverter
-
- All Implemented Interfaces:
Converter
,ConverterMatcher
,Caching
public class LambdaConverter extends SerializableConverter
Converts a lambda type. The implementation maps any non-serializable lambda instance tonull
.- Since:
- 1.4.8
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter
AbstractReflectionConverter.DuplicateFieldException, AbstractReflectionConverter.UnknownFieldException
-
-
Field Summary
-
Fields inherited from class com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter
mapper, reflectionProvider, serializationMembers, serializationMethodInvoker
-
-
Constructor Summary
Constructors Constructor Description LambdaConverter(Mapper mapper, ReflectionProvider reflectionProvider, ClassLoaderReference classLoaderReference)
Constructs a LambdaConverter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canConvert(java.lang.Class type)
Determines whether the converter can marshall a particular type.void
marshal(java.lang.Object original, HierarchicalStreamWriter writer, MarshallingContext context)
Convert an object to textual data.-
Methods inherited from class com.thoughtworks.xstream.converters.reflection.SerializableConverter
doMarshal, doMarshalConditionally, doUnmarshal, doUnmarshalConditionally, hierarchyFor, marshalUnserializableParent
-
Methods inherited from class com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter
canAccess, flushCache, instantiateNewInstance, marshallField, readResolve, shouldUnmarshalField, shouldUnmarshalTransientFields, unmarshal, unmarshallField
-
-
-
-
Constructor Detail
-
LambdaConverter
public LambdaConverter(Mapper mapper, ReflectionProvider reflectionProvider, ClassLoaderReference classLoaderReference)
Constructs a LambdaConverter.- Parameters:
mapper
-reflectionProvider
-classLoaderReference
-- Since:
- 1.4.8
-
-
Method Detail
-
canConvert
public boolean canConvert(java.lang.Class type)
Description copied from interface:ConverterMatcher
Determines whether the converter can marshall a particular type.- Specified by:
canConvert
in interfaceConverterMatcher
- Overrides:
canConvert
in classSerializableConverter
- Parameters:
type
- the Class representing the object type to be converted
-
marshal
public void marshal(java.lang.Object original, HierarchicalStreamWriter writer, MarshallingContext context)
Description copied from interface:Converter
Convert an object to textual data.- Specified by:
marshal
in interfaceConverter
- Overrides:
marshal
in classAbstractReflectionConverter
- Parameters:
original
- The object to be marshalled.writer
- A stream to write to.context
- A context that allows nested objects to be processed by XStream.
-
-