Package com.thoughtworks.xstream.core
Class DefaultConverterLookup
- java.lang.Object
-
- com.thoughtworks.xstream.core.DefaultConverterLookup
-
- All Implemented Interfaces:
ConverterLookup,ConverterRegistry,Caching
public class DefaultConverterLookup extends java.lang.Object implements ConverterLookup, ConverterRegistry, Caching
The default implementation of converters lookup.
-
-
Field Summary
Fields Modifier and Type Field Description private PrioritizedListconvertersprivate java.util.MapserializationMapprivate java.util.MaptypeToConverterMap
-
Constructor Summary
Constructors Constructor Description DefaultConverterLookup()DefaultConverterLookup(Mapper mapper)Deprecated.As of 1.3, useDefaultConverterLookup()DefaultConverterLookup(java.util.Map map)Constructs a DefaultConverterLookup with a provided map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflushCache()ConverterlookupConverterForType(java.lang.Class type)Lookup a converter for a specific type.private java.lang.ObjectreadResolve()voidregisterConverter(Converter converter, int priority)private java.lang.ObjectwriteReplace()
-
-
-
Field Detail
-
converters
private final PrioritizedList converters
-
typeToConverterMap
private transient java.util.Map typeToConverterMap
-
serializationMap
private java.util.Map serializationMap
-
-
Constructor Detail
-
DefaultConverterLookup
public DefaultConverterLookup()
-
DefaultConverterLookup
public DefaultConverterLookup(java.util.Map map)
Constructs a DefaultConverterLookup with a provided map.- Parameters:
map- the map to use- Throws:
java.lang.NullPointerException- if map is null- Since:
- 1.4.11
-
DefaultConverterLookup
public DefaultConverterLookup(Mapper mapper)
Deprecated.As of 1.3, useDefaultConverterLookup()
-
-
Method Detail
-
lookupConverterForType
public Converter lookupConverterForType(java.lang.Class type)
Description copied from interface:ConverterLookupLookup a converter for a specific type.This type may be any Class, including primitive and array types. It may also be null, signifying the value to be converted is a null type.
- Specified by:
lookupConverterForTypein interfaceConverterLookup
-
registerConverter
public void registerConverter(Converter converter, int priority)
- Specified by:
registerConverterin interfaceConverterRegistry
-
flushCache
public void flushCache()
- Specified by:
flushCachein interfaceCaching
-
writeReplace
private java.lang.Object writeReplace()
-
readResolve
private java.lang.Object readResolve()
-
-