Class AnnotationMapper
java.lang.Object
com.thoughtworks.xstream.mapper.MapperWrapper
com.thoughtworks.xstream.mapper.AnnotationMapper
- All Implemented Interfaces:
AnnotationConfiguration, Mapper
A mapper that uses annotations to prepare the remaining mappers in the chain.
- Since:
- 1.3
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface Mapper
Mapper.ImplicitCollectionMapping, Mapper.Null -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Object[]private AttributeMapperprivate ClassAliasingMapperprivate final ConverterRegistryprivate DefaultImplementationsMapperprivate ElementIgnoringMapperprivate FieldAliasingMapperprivate ImplicitCollectionMapperprivate LocalConversionMapperprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionAnnotationMapper(Mapper wrapped, ConverterRegistry converterRegistry, ConverterLookup converterLookup, ClassLoaderReference classLoaderReference, ReflectionProvider reflectionProvider) Construct an AnnotationMapper.AnnotationMapper(Mapper wrapped, ConverterRegistry converterRegistry, ConverterLookup converterLookup, ClassLoader classLoader, ReflectionProvider reflectionProvider, JVM jvm) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddParametrizedTypes(Type type, Set<Class<?>> types) voidautodetectAnnotations(boolean mode) private ConvertercacheConverter(XStreamConverter annotation, Class targetType) defaultImplementationOf(Class type) private Class<?> getLocalConverter(Class definedIn, String fieldName) private voidprocessAliasAnnotation(Class<?> type, Set<Class<?>> types) private voidprocessAliasTypeAnnotation(Class<?> type) private voidprocessAnnotations(Class initialType) voidprocessAnnotations(Class[] initialTypes) private voidprivate voidprocessConverterAnnotations(Class<?> type) private voidprocessFieldAliasAnnotation(Field field) private voidprocessImplicitAnnotation(Field field) private voidprocessImplicitCollectionAnnotation(Class<?> type) Deprecated.private voidprivate voidprocessOmitFieldAnnotation(Field field) private voidprocessTypes(Set<Class<?>> types) private voidrealMember(Class type, String serialized) How a serialized member representation should be mapped back to a real member.serializedClass(Class type) How a class name should be represented in its serialized form.private voidprivate voidMethods inherited from class MapperWrapper
aliasForAttribute, aliasForAttribute, aliasForSystemAttribute, attributeForAlias, attributeForAlias, getConverterFromAttribute, getConverterFromAttribute, getConverterFromAttribute, getConverterFromItemType, getConverterFromItemType, getConverterFromItemType, getFieldNameForItemTypeAndName, getImplicitCollectionDefForFieldName, getItemTypeForItemFieldName, isIgnoredElement, isImmutableValueType, isReferenceable, lookupMapperOfType, realClass, serializedMember, shouldSerializeMember
-
Field Details
-
locked
private boolean locked -
arguments
-
converterRegistry
-
classAliasingMapper
-
defaultImplementationsMapper
-
implicitCollectionMapper
-
fieldAliasingMapper
-
elementIgnoringMapper
-
attributeMapper
-
localConversionMapper
-
converterCache
-
annotatedTypes
-
-
Constructor Details
-
AnnotationMapper
public AnnotationMapper(Mapper wrapped, ConverterRegistry converterRegistry, ConverterLookup converterLookup, ClassLoaderReference classLoaderReference, ReflectionProvider reflectionProvider) Construct an AnnotationMapper.- Parameters:
wrapped- the nextMapperin the chain- Since:
- 1.4.5
-
AnnotationMapper
public AnnotationMapper(Mapper wrapped, ConverterRegistry converterRegistry, ConverterLookup converterLookup, ClassLoader classLoader, ReflectionProvider reflectionProvider, JVM jvm) Deprecated.Construct an AnnotationMapper.- Parameters:
wrapped- the nextMapperin the chain- Since:
- 1.3
-
-
Method Details
-
realMember
Description copied from interface:MapperHow a serialized member representation should be mapped back to a real member.- Specified by:
realMemberin interfaceMapper- Overrides:
realMemberin classMapperWrapper
-
serializedClass
Description copied from interface:MapperHow a class name should be represented in its serialized form.- Specified by:
serializedClassin interfaceMapper- Overrides:
serializedClassin classMapperWrapper
-
defaultImplementationOf
- Specified by:
defaultImplementationOfin interfaceMapper- Overrides:
defaultImplementationOfin classMapperWrapper
-
getLocalConverter
- Specified by:
getLocalConverterin interfaceMapper- Overrides:
getLocalConverterin classMapperWrapper
-
autodetectAnnotations
public void autodetectAnnotations(boolean mode) - Specified by:
autodetectAnnotationsin interfaceAnnotationConfiguration
-
processAnnotations
- Specified by:
processAnnotationsin interfaceAnnotationConfiguration
-
processAnnotations
-
processTypes
-
addParametrizedTypes
-
processConverterAnnotations
-
processAliasAnnotation
-
processAliasTypeAnnotation
-
processImplicitCollectionAnnotation
Deprecated. -
processFieldAliasAnnotation
-
processAsAttributeAnnotation
-
processImplicitAnnotation
-
processOmitFieldAnnotation
-
processLocalConverterAnnotation
-
cacheConverter
-
getClass
-
setupMappers
private void setupMappers() -
writeObject
- Throws:
IOException
-
readObject
- Throws:
IOExceptionClassNotFoundException
-
AnnotationMapper(Mapper, ConverterRegistry, ConverterLookup, ClassLoaderReference, ReflectionProvider)