org.mule.module.xml.transformer.jaxb
Class JAXBContextResolver

java.lang.Object
  extended by org.mule.config.transformer.AbstractAnnotatedTransformerArgumentResolver
      extended by org.mule.module.xml.transformer.jaxb.JAXBContextResolver
All Implemented Interfaces:
Disposable, org.mule.config.transformer.TransformerArgumentResolver

public class JAXBContextResolver
extends org.mule.config.transformer.AbstractAnnotatedTransformerArgumentResolver

This resolver is used by the transform engine to inject a JAXBContext into a method that requires it. A shared JAXB context can be created for the application and stored in the registry, this will get injected into any transform methods that add JAXBContext to the method signature.

IF there is no shared JAXB context one will be created. First this resolver will attempt to create the context from the package of the the annotated class, for this to work either a jaxb.index file must be present or an ObjectFactory must be in the package. This allows for JAXB generated classes to be used easily. If this method fails a context will be created using just the annotated class to initialise the context.

Since:
3.0

Field Summary
 
Fields inherited from class org.mule.config.transformer.AbstractAnnotatedTransformerArgumentResolver
ignoredPackages, logger
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
JAXBContextResolver()
           
 
Method Summary
protected  Object createArgument(Class annotatedType, MuleContext muleContext)
           
protected  String getAnnotationsPackageName()
           
protected  Class getArgumentClass()
           
 
Methods inherited from class org.mule.config.transformer.AbstractAnnotatedTransformerArgumentResolver
dispose, findAnnotation, getMatchingClasses, getNonMatchingClasses, isNonMatching, resolve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAXBContextResolver

public JAXBContextResolver()
Method Detail

getArgumentClass

protected Class getArgumentClass()
Specified by:
getArgumentClass in class org.mule.config.transformer.AbstractAnnotatedTransformerArgumentResolver

createArgument

protected Object createArgument(Class annotatedType,
                                MuleContext muleContext)
                         throws Exception
Specified by:
createArgument in class org.mule.config.transformer.AbstractAnnotatedTransformerArgumentResolver
Throws:
Exception

getAnnotationsPackageName

protected String getAnnotationsPackageName()
Specified by:
getAnnotationsPackageName in class org.mule.config.transformer.AbstractAnnotatedTransformerArgumentResolver


Copyright © 2003-2013 MuleSoft, Inc.. All Rights Reserved.