|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.util.NullObjectFactory
A factory that can produce a dummy implementation of an interface, on the fly. Probably not a good idea for you to use it.
Nested Class Summary | |
static class |
NullObjectFactory.NullInvocationHandler
Routes all interface calls to null (returns empty strings and other zero-values for methods with return types). |
Method Summary | |
static java.lang.Object |
create(java.lang.Class ifc)
Creates a NullObject implementing the passed interface. |
static java.lang.Object |
create(java.lang.Class ifc,
java.lang.reflect.InvocationHandler handler)
Creates a NullObject implementing the passed interface, with methods handled by the passed InvocationHandler. |
static void |
main(java.lang.String[] args)
Tests it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.lang.Object create(java.lang.Class ifc)
ifc
- an interface to create a proxy for
java.lang.IllegalArgumentException
- if interface is nullpublic static java.lang.Object create(java.lang.Class ifc, java.lang.reflect.InvocationHandler handler)
ifc
- an interface to create a proxy forhandler
- an InvocationHandler that will handle
all the methods called on the proxy.
java.lang.IllegalArgumentException
- if interface or
handler is nullpublic static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |