Class CGLIBEnhancedConverter
java.lang.Object
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter
com.thoughtworks.xstream.converters.reflection.SerializableConverter
com.thoughtworks.xstream.converters.reflection.CGLIBEnhancedConverter
- All Implemented Interfaces:
Converter, ConverterMatcher, Caching
Converts a proxy created by the CGLIB
Enhancer. Such a proxy is recreated while
deserializing the proxy. The converter does only work, if- the DefaultNamingPolicy is used for the proxy's name
- the proxy uses a factory or only one Callback is registered
- a possible super class has at least a protected default constructor
- Since:
- 1.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classprivate static final classNested classes/interfaces inherited from class AbstractReflectionConverter
AbstractReflectionConverter.DuplicateFieldException, AbstractReflectionConverter.UnknownFieldException -
Field Summary
FieldsFields inherited from class AbstractReflectionConverter
mapper, reflectionProvider, serializationMembers, serializationMethodInvoker -
Constructor Summary
ConstructorsConstructorDescriptionCGLIBEnhancedConverter(Mapper mapper, ReflectionProvider reflectionProvider) Deprecated.CGLIBEnhancedConverter(Mapper mapper, ReflectionProvider reflectionProvider, ClassLoaderReference classLoaderReference) Construct a CGLIBEnhancedConverter.CGLIBEnhancedConverter(Mapper mapper, ReflectionProvider reflectionProvider, ClassLoader classLoader) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanConvert(Class type) Determines whether the converter can marshall a particular type.private Objectprivate MapcreateCallbackIndexMap(net.sf.cglib.proxy.Factory source) private Object[]createNullArguments(Class[] parameterTypes) private net.sf.cglib.proxy.CallbackcreateReverseEngineeredCallbackOfProperType(net.sf.cglib.proxy.Callback callback, int index, Map callbackIndexMap) private net.sf.cglib.proxy.Callback[]getCallbacks(Object source) protected ListhierarchyFor(Class type) voidmarshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) Convert an object to textual data.private voidreadCallback(HierarchicalStreamReader reader, UnmarshallingContext context, List callbacksToEnhance, List callbacks) protected Objectunmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) Convert textual data back into an object.Methods inherited from class SerializableConverter
doMarshal, doMarshalConditionally, doUnmarshal, doUnmarshalConditionally, marshalUnserializableParentMethods inherited from class AbstractReflectionConverter
canAccess, flushCache, instantiateNewInstance, marshallField, shouldUnmarshalField, shouldUnmarshalTransientFields, unmarshallField
-
Field Details
-
DEFAULT_NAMING_MARKER
-
CALLBACK_MARKER
-
fieldCache
-
-
Constructor Details
-
CGLIBEnhancedConverter
public CGLIBEnhancedConverter(Mapper mapper, ReflectionProvider reflectionProvider, ClassLoaderReference classLoaderReference) Construct a CGLIBEnhancedConverter.- Parameters:
mapper- the mapper chain instancereflectionProvider- the reflection providerclassLoaderReference- the reference to theClassLoaderof the XStream instance- Since:
- 1.4.5
-
CGLIBEnhancedConverter
public CGLIBEnhancedConverter(Mapper mapper, ReflectionProvider reflectionProvider, ClassLoader classLoader) Deprecated. -
CGLIBEnhancedConverter
Deprecated.
-
-
Method Details
-
canConvert
Description copied from interface:ConverterMatcherDetermines whether the converter can marshall a particular type.- Specified by:
canConvertin interfaceConverterMatcher- Overrides:
canConvertin classSerializableConverter- Parameters:
type- the Class representing the object type to be converted
-
marshal
Description copied from interface:ConverterConvert an object to textual data.- Specified by:
marshalin interfaceConverter- Overrides:
marshalin classAbstractReflectionConverter- Parameters:
source- The object to be marshalled.writer- A stream to write to.context- A context that allows nested objects to be processed by XStream.
-
getCallbacks
-
createCallbackIndexMap
-
createNullArguments
-
createReverseEngineeredCallbackOfProperType
private net.sf.cglib.proxy.Callback createReverseEngineeredCallbackOfProperType(net.sf.cglib.proxy.Callback callback, int index, Map callbackIndexMap) -
unmarshal
Description copied from interface:ConverterConvert textual data back into an object.- Specified by:
unmarshalin interfaceConverter- Overrides:
unmarshalin classAbstractReflectionConverter- Parameters:
reader- The stream to read the text from.context-- Returns:
- The resulting object.
-
readCallback
private void readCallback(HierarchicalStreamReader reader, UnmarshallingContext context, List callbacksToEnhance, List callbacks) -
create
-
hierarchyFor
- Overrides:
hierarchyForin classSerializableConverter
-
readResolve
- Overrides:
readResolvein classAbstractReflectionConverter
-
CGLIBEnhancedConverter(Mapper, ReflectionProvider, ClassLoaderReference)