Class RegistryMatcher
java.lang.Object
org.simpleframework.xml.transform.RegistryMatcher
- All Implemented Interfaces:
Matcher
The
RegistryMatcher provides a simple matcher backed
by a registry. Registration can be done to match a type to a
Transform class or instance. If a transform class is
registered an instance of it is created when requested using the
default no argument constructor of the type, it is then cached so
it can be reused on future requests.- Author:
- Niall Gallagher
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis is used to bind aTransformtype.voidThis is used to bind aTransforminstance to the specified type.This is used to match aTransformusing the type specified.
-
Constructor Details
-
RegistryMatcher
public RegistryMatcher()Constructor for theRegistryMatcher. This is used to create a matcher instance that can resolve a transform by type and can also instantiate new transforms if required. It is essentially a convenience implementation.
-
-
Method Details
-
bind
This is used to bind aTransformtype. The first time a transform is requested for the specified type a new instance of thisTransformwill be instantiated.- Parameters:
type- this is the type to resolve the transform fortransform- this is the transform type to instantiate
-
bind
This is used to bind aTransforminstance to the specified type. Each time a transform is requested for this type the provided instance will be returned.- Parameters:
type- this is the type to resolve the transform fortransform- this transform instance to be used
-
match
This is used to match aTransformusing the type specified. If no transform can be acquired then this returns a null value indicating that no transform could be found.
-