Class RegistryMatcher
- java.lang.Object
-
- org.simpleframework.xml.transform.RegistryMatcher
-
- All Implemented Interfaces:
Matcher
public class RegistryMatcher extends java.lang.Object implements Matcher
TheRegistryMatcherprovides a simple matcher backed by a registry. Registration can be done to match a type to aTransformclass 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:
Persister
-
-
Constructor Summary
Constructors Constructor Description RegistryMatcher()Constructor for theRegistryMatcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(java.lang.Class type, java.lang.Class transform)This is used to bind aTransformtype.voidbind(java.lang.Class type, Transform transform)This is used to bind aTransforminstance to the specified type.Transformmatch(java.lang.Class type)This is used to match aTransformusing the type specified.
-
-
-
Method Detail
-
bind
public void bind(java.lang.Class type, java.lang.Class transform)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
public void bind(java.lang.Class type, Transform transform)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
public Transform match(java.lang.Class type) throws java.lang.Exception
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.
-
-