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
Converts a lambda type.
The implementation maps any non-serializable lambda instance to
null
.- 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
ConstructorsConstructorDescriptionLambdaConverter
(Mapper mapper, ReflectionProvider reflectionProvider, ClassLoaderReference classLoaderReference) Constructs a LambdaConverter. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canConvert
(Class type) Determines whether the converter can marshall a particular type.void
marshal
(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 Details
-
LambdaConverter
public LambdaConverter(Mapper mapper, ReflectionProvider reflectionProvider, ClassLoaderReference classLoaderReference) Constructs a LambdaConverter.- Parameters:
mapper
-reflectionProvider
-classLoaderReference
-- Since:
- 1.4.8
-
-
Method Details
-
canConvert
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
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.
-