org.mule.config.transformer
Class AbstractAnnotatedTransformerArgumentResolver
java.lang.Object
org.mule.config.transformer.AbstractAnnotatedTransformerArgumentResolver
- All Implemented Interfaces:
- Disposable, TransformerArgumentResolver
public abstract class AbstractAnnotatedTransformerArgumentResolver
- extends Object
- implements TransformerArgumentResolver, Disposable
An abstract resolver that can be extend to resolve/create an object based on Annotated classes. These classes can be
scanned and used to create the context. Typically this class will be used to create resolvers for binding frameworks
where the data type classes are annotated with binding information.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ignoredPackages
public static final String[] ignoredPackages
logger
protected final transient org.apache.commons.logging.Log logger
- logger used by this class
AbstractAnnotatedTransformerArgumentResolver
public AbstractAnnotatedTransformerArgumentResolver()
resolve
public <T> T resolve(Class<T> type,
DataType source,
DataType result,
MuleContext context)
throws Exception
- Specified by:
resolve in interface TransformerArgumentResolver
- Throws:
Exception
findAnnotation
protected boolean findAnnotation(Class annotatedType)
throws IOException
- Throws:
IOException
isNonMatching
protected boolean isNonMatching(DataType source,
DataType result)
dispose
public void dispose()
- Specified by:
dispose in interface Disposable
getMatchingClasses
public Set<Class> getMatchingClasses()
getNonMatchingClasses
public Set<Class> getNonMatchingClasses()
getArgumentClass
protected abstract Class<?> getArgumentClass()
- The object type that this resolver will discover or create
- Returns:
- The object type that this resolver will discover or create
createArgument
protected abstract Object createArgument(Class<?> annotatedType,
MuleContext muleContext)
throws Exception
- If the resolver cannot locate the required object of type
getArgumentClass() this method will be invoked
an instance of the object.
- Parameters:
annotatedType - the annotated object that was matchedmuleContext - the current Mule context.
- Returns:
- a new instance of the object being resolved. This method may also retain a shared instance and possible add
configuration to the instance based on this invocation
- Throws:
Exception - if the object cannot be created
getAnnotationsPackageName
protected abstract String getAnnotationsPackageName()
- This resolver scans a class for annotations in this package. Note this behaviour can be changed by overloading
the
findAnnotation(Class) method and search based on your own criteria
- Returns:
- the package of the annotation(s) to scan for
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.