Class DefaultMatcher
- java.lang.Object
-
- org.simpleframework.xml.transform.DefaultMatcher
-
- All Implemented Interfaces:
Matcher
class DefaultMatcher extends java.lang.Object implements Matcher
TheDefaultMatcher
is a delegation object that uses several matcher implementations to correctly resolve both the stockTransform
implementations and implementations that have been overridden by the user with a custom matcher. This will perform the resolution of the transform using the specified matcher, if this results in no transform then this will look for a transform within the collection of implementations.- See Also:
Transformer
-
-
Field Summary
Fields Modifier and Type Field Description private Matcher
array
Matcher used to resolve transforms for array type objects.private Matcher
matcher
Matcher used to resolve user specified transform overrides.private Matcher
primitive
Matcher used to resolve stock transforms for primitive types.private Matcher
stock
Matcher used to resolve all the core Java object transforms.
-
Constructor Summary
Constructors Constructor Description DefaultMatcher(Matcher matcher)
Constructor for theDefaultMatcher
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Transform
match(java.lang.Class type)
This is used to match aTransform
for the given type.private Transform
matchType(java.lang.Class type)
This is used to match aTransform
for the given type.
-
-
-
Field Detail
-
primitive
private Matcher primitive
Matcher used to resolve stock transforms for primitive types.
-
matcher
private Matcher matcher
Matcher used to resolve user specified transform overrides.
-
stock
private Matcher stock
Matcher used to resolve all the core Java object transforms.
-
array
private Matcher array
Matcher used to resolve transforms for array type objects.
-
-
Constructor Detail
-
DefaultMatcher
public DefaultMatcher(Matcher matcher)
Constructor for theDefaultMatcher
object. This performs resolution ofTransform
implementations using the specified matcher. If that matcher fails to resolve a suitable transform then the stock implementations are used.- Parameters:
matcher
- this is the user specified matcher object
-
-
Method Detail
-
match
public Transform match(java.lang.Class type) throws java.lang.Exception
This is used to match aTransform
for the given type. If a transform cannot be resolved this this will throw an exception to indicate that resolution of a transform failed. A transform is resolved by first searching for a transform within the user specified matcher then searching the stock transforms.
-
matchType
private Transform matchType(java.lang.Class type) throws java.lang.Exception
This is used to match aTransform
for the given type. If a transform cannot be resolved this this will throw an exception to indicate that resolution of a transform failed. A transform is resolved by first searching for a transform within the user specified matcher then searching the stock transforms.- Parameters:
type
- this is the type to resolve a transform object for- Returns:
- this returns a transform used to transform the type
- Throws:
java.lang.Exception
-
-