public class JsonMapperResolver extends AbstractAnnotatedTransformerArgumentResolver
ObjectMapper
into a method that requires it.
A shared ObjectMapper context can be created for the application and stored in the registry, this will get injected
into any transform methods that add ObjectMapper
to the method signature.
If there is no shared Object Mapper one will be created for the transformer using the return type as the Json root element.Modifier and Type | Field and Description |
---|---|
static String |
ANNOTATIONS_PACKAGE_NAME |
ignoredPackages, logger
PHASE_NAME
Constructor and Description |
---|
JsonMapperResolver() |
Modifier and Type | Method and Description |
---|---|
protected Object |
createArgument(Class<?> annotatedType,
MuleContext context)
If the resolver cannot locate the required object of type
AbstractAnnotatedTransformerArgumentResolver.getArgumentClass() this method will be invoked
an instance of the object. |
protected String |
getAnnotationsPackageName()
This resolver scans a class for annotations in this package.
|
protected Class<?> |
getArgumentClass()
The object type that this resolver will discover or create
|
dispose, findAnnotation, getMatchingClasses, getNonMatchingClasses, isNonMatching, resolve
public static final String ANNOTATIONS_PACKAGE_NAME
protected Class<?> getArgumentClass()
getArgumentClass
in class AbstractAnnotatedTransformerArgumentResolver
protected Object createArgument(Class<?> annotatedType, MuleContext context) throws Exception
AbstractAnnotatedTransformerArgumentResolver.getArgumentClass()
this method will be invoked
an instance of the object.createArgument
in class AbstractAnnotatedTransformerArgumentResolver
annotatedType
- the annotated object that was matchedcontext
- the current Mule context.Exception
- if the object cannot be createdprotected String getAnnotationsPackageName()
AbstractAnnotatedTransformerArgumentResolver.findAnnotation(Class)
method and search based on your own criteriagetAnnotationsPackageName
in class AbstractAnnotatedTransformerArgumentResolver
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.