Class DefaultMatcher
- java.lang.Object
-
- org.simpleframework.xml.transform.DefaultMatcher
-
- All Implemented Interfaces:
Matcher
class DefaultMatcher extends java.lang.Object implements Matcher
TheDefaultMatcheris a delegation object that uses several matcher implementations to correctly resolve both the stockTransformimplementations 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 MatcherarrayMatcher used to resolve transforms for array type objects.private MatchermatcherMatcher used to resolve user specified transform overrides.private MatcherprimitiveMatcher used to resolve stock transforms for primitive types.private MatcherstockMatcher used to resolve all the core Java object transforms.
-
Constructor Summary
Constructors Constructor Description DefaultMatcher(Matcher matcher)Constructor for theDefaultMatcherobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Transformmatch(java.lang.Class type)This is used to match aTransformfor the given type.private TransformmatchType(java.lang.Class type)This is used to match aTransformfor 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 theDefaultMatcherobject. This performs resolution ofTransformimplementations 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 aTransformfor 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 aTransformfor 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
-
-