Class RegistryBinder
java.lang.Object
org.simpleframework.xml.convert.RegistryBinder
The
RegistryBinder object is used acquire converters
using a binding between a type and its converter. All converters
instantiated are cached internally to ensure that the overhead
of acquiring a converter is reduced. Converters are created on
demand to ensure they are instantiated only if required.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThis is used to cache bindings between types and converters.private final ConverterFactoryThis is used to instantiate and cache the converter objects. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis is used to register a binding between a type and the converter used to serialize and deserialize it.private ConverterThis is used to acquire aConverterinstance from this binder.This is used to acquire aConverterinstance from this binder.
-
Field Details
-
factory
This is used to instantiate and cache the converter objects. -
cache
-
-
Constructor Details
-
RegistryBinder
public RegistryBinder()Constructor for theRegistryBinderobject. This is used to create bindings between classes and the converters that should be used to serialize and deserialize the instances. All converters are instantiated once and cached for reuse.
-
-
Method Details
-
lookup
This is used to acquire aConverterinstance from this binder. All instances are cached to reduce the overhead of lookups during the serialization process. Converters are lazily instantiated and so are only created if demanded.- Parameters:
type- this is the type to find the converter for- Returns:
- this returns the converter instance for the type
- Throws:
Exception
-
create
This is used to acquire aConverterinstance from this binder. All instances are cached to reduce the overhead of lookups during the serialization process. Converters are lazily instantiated and so are only created if demanded.- Parameters:
type- this is the type to find the converter for- Returns:
- this returns the converter instance for the type
- Throws:
Exception
-
bind
This is used to register a binding between a type and the converter used to serialize and deserialize it. During the serialization process the converters are retrieved and used to convert the object properties to XML.- Parameters:
type- this is the object type to bind to a converterconverter- this is the converter class to be used- Throws:
Exception
-