|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.hammurapi.convert.DuckConverterFactory
public class DuckConverterFactory
Creates converters which use "duck" typing.
| Constructor Summary | |
|---|---|
DuckConverterFactory()
|
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DuckConverterFactory()
| Method Detail |
|---|
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 -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||