public class DuckConverterFactory extends Object
| Constructor and Description |
|---|
DuckConverterFactory() |
| Modifier and Type | Method and Description |
|---|---|
static Integer |
classAffinity(Class subClass,
Class superClass)
Calculates how close is subclass to superclass in class hierarchy.
|
static boolean |
duckMap(Class theInterface,
Class theClass,
Map<Method,Method> methodMap)
Duck maps source (interface methods) to compatible target (class) methods.
|
static boolean |
duckMap(Method[] interfaceMethods,
Method[] classMethods,
Map<Method,Method> methodMap)
Duck maps source (interface methods) to compatible target (class) methods.
|
static ClassLoader |
getChildClassLoader(ClassLoader cl1,
ClassLoader cl2) |
static Class[] |
getClassInterfaces(Class sourceClass) |
static ConverterClosure |
getConverter(Class sourceClass,
Class targetInterface,
boolean lenient) |
public DuckConverterFactory()
public static ConverterClosure getConverter(Class sourceClass, Class targetInterface, boolean lenient)
sourceClass - targetInterface - lenient - If true converter is created even not all interface methods could be mapped to class methods.public static boolean duckMap(Class theInterface, Class theClass, Map<Method,Method> methodMap)
interfaceMethods - Interface methods.classMethods - Class methodsmethodMap - Method map (interface to class methods).public static boolean duckMap(Method[] interfaceMethods, Method[] classMethods, Map<Method,Method> methodMap)
interfaceMethods - Interface methods.classMethods - Class methodsmethodMap - Method map (interface to class methods).public static Integer classAffinity(Class subClass, Class superClass)
subClass - superClass - public static ClassLoader getChildClassLoader(ClassLoader cl1, ClassLoader cl2)
cl1 - cl2 - public static Class[] getClassInterfaces(Class sourceClass)
sourceClass -