Class PackageMatcher
java.lang.Object
org.simpleframework.xml.transform.PackageMatcher
- All Implemented Interfaces:
Matcher
The
PackageMatcher object is used to match the stock
transforms to Java packages. This is used to match useful types
from the java.lang and java.util packages
as well as other Java packages. This matcher groups types by their
package names and attempts to search the stock transforms for a
suitable match. If no match can be found this throws an exception.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method attempts to perform a resolution of the transform based on its package prefix.private TransformThis is used to resolveTransformimplementations that areEnumimplementations.private TransformThis is used to resolveTransformimplementations that relate to thejava.iopackage.private TransformmatchLanguage(Class type) This is used to resolveTransformimplementations that relate to thejava.langpackage.private TransformThis is used to resolveTransformimplementations that relate to thejava.mathpackage.private TransformThis is used to resolveTransformimplementations that relate to thejava.sqlpackage.private TransformThis is used to resolveTransformimplementations that relate to thejava.netpackage.private TransformmatchUtility(Class type) This is used to resolveTransformimplementations that relate to thejava.utilpackage.
-
Constructor Details
-
PackageMatcher
public PackageMatcher()Constructor for thePackageMatcherobject. The package matcher is used to resolve a transform instance to convert object types to an from strings. If a match cannot be found with this matcher then an exception is thrown.
-
-
Method Details
-
match
This method attempts to perform a resolution of the transform based on its package prefix. This allows this matcher to create a logical group of transforms within a single method based on the types package prefix. If no transform can be found then this will throw an exception. -
matchEnum
This is used to resolveTransformimplementations that areEnumimplementations. If the type is not an enumeration then this will return null.- Parameters:
type- this is the type to resolve a stock transform for- Returns:
- this will return a transform for the specified type
-
matchLanguage
This is used to resolveTransformimplementations that relate to thejava.langpackage. If the type does not resolve to a valid transform then this method will throw an exception to indicate that no stock transform exists for the specified type.- Parameters:
type- this is the type to resolve a stock transform for- Returns:
- this will return a transform for the specified type
- Throws:
Exception
-
matchMath
This is used to resolveTransformimplementations that relate to thejava.mathpackage. If the type does not resolve to a valid transform then this method will throw an exception to indicate that no stock transform exists for the specified type.- Parameters:
type- this is the type to resolve a stock transform for- Returns:
- this will return a transform for the specified type
- Throws:
Exception
-
matchUtility
This is used to resolveTransformimplementations that relate to thejava.utilpackage. If the type does not resolve to a valid transform then this method will throw an exception to indicate that no stock transform exists for the specified type.- Parameters:
type- this is the type to resolve a stock transform for- Returns:
- this will return a transform for the specified type
- Throws:
Exception
-
matchSQL
This is used to resolveTransformimplementations that relate to thejava.sqlpackage. If the type does not resolve to a valid transform then this method will throw an exception to indicate that no stock transform exists for the specified type.- Parameters:
type- this is the type to resolve a stock transform for- Returns:
- this will return a transform for the specified type
- Throws:
Exception
-
matchFile
This is used to resolveTransformimplementations that relate to thejava.iopackage. If the type does not resolve to a valid transform then this method will throw an exception to indicate that no stock transform exists for the specified type.- Parameters:
type- this is the type to resolve a stock transform for- Returns:
- this will return a transform for the specified type
- Throws:
Exception
-
matchURL
This is used to resolveTransformimplementations that relate to thejava.netpackage. If the type does not resolve to a valid transform then this method will throw an exception to indicate that no stock transform exists for the specified type.- Parameters:
type- this is the type to resolve a stock transform for- Returns:
- this will return a transform for the specified type
- Throws:
Exception
-