|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectovm.polyd.PolyD
public abstract class PolyD
The main class of PolyD: use the methods of this class to build new dispatchers.
Normally, a new dispatcher is simply built by constructing
the desired interface and bodies, using annotations, and calling the
static method PolyD.build(...)
.
A number of auxiliary variations on the main mechanism are also offered, and documented below. For more information, please consult the manual available online at http://www.ovmj.org/polyd.
Dispatching
,
Invocation
Method Summary | ||
---|---|---|
static
|
build(java.lang.Class<T> interf,
java.lang.Object... bodies)
Creates a new dispatcher. |
|
static
|
buildFromDescriptor(java.lang.Class<T> interf,
java.lang.Object... bodies)
Creates a new dispatcher from a registered Descriptor . |
|
static
|
buildSpecial(java.lang.Class<T> interf,
java.lang.Class<K> body,
java.lang.Object[] args,
java.lang.Class[] argsClasses)
Deprecated. Use build(java.lang.Class instead. |
|
static
|
buildSpecialFromDescriptor(java.lang.Class<T> interf,
java.lang.Class<K> body)
Deprecated. Use buildFromDescriptor(java.lang.Class instead. |
|
static
|
buildSpecialFromDescriptor(java.lang.Class<T> interf,
java.lang.Class<K> body,
java.lang.Object[] args,
java.lang.Class[] argsClasses)
Deprecated. Use buildFromDescriptor(java.lang.Class instead. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T,K extends T> T build(java.lang.Class<T> interf, java.lang.Object... bodies)
This is the main method of PolyD, used to build a dispatcher using the annotation-based mechanism. Just define the desired interface and implementing bodies, and use this method to build your new dispatcher. Normally, this is the only method of this class that you will require.
This method is not available in the pre-5.0 version of PolyD.
interf
- the interface that defines the available messagesbodies
- the list of objects belonging to the implementing classes
public static <T,K extends T> K buildSpecial(java.lang.Class<T> interf, java.lang.Class<K> body, java.lang.Object[] args, java.lang.Class[] argsClasses)
build(java.lang.Class, java.lang.Object...)
instead.
Descriptor
.
This method could be removed from future versions of PolyD,
and its use is not recommended.This method is not available in the pre-5.0 version of PolyD.
interf
- the interface used to build the new dispatcherbody
- the class of the single body (that must implement interf
)args
- the arguments used to create a new instance of body
argsClasses
- the classes of the arguments used to create the new instance
public static <T,K extends T> T buildFromDescriptor(java.lang.Class<T> interf, java.lang.Object... bodies)
Descriptor
.
This method is not normally necessary, and it is mainly of use in
the pre-5.0 version of PolyD. The preferred approach, in
that case, is building a Descriptor
and then using
a Factory
. However, sometimes it might not be
practical to deal with factories in the client code.
In those cases, after a Descriptor
has been registered this
method can be used to generate new matching dispatchers
without using a Factory
.
interf
- the interface that defines the available messagesbodies
- the list of objects belonging to the implementing classes
Descriptor
,
Factory
public static <T,K extends T> K buildSpecialFromDescriptor(java.lang.Class<T> interf, java.lang.Class<K> body)
buildFromDescriptor(java.lang.Class, java.lang.Object...)
instead.
Descriptor
.
A new instance of body
will be created without passing
any arguments to the constructor. This method could be removed from
future versions of PolyD, and its use is not recommended.
interf
- the interface used to build the new dispatcherbody
- the class of the single body (that must implement interf
)
public static <T,K extends T> K buildSpecialFromDescriptor(java.lang.Class<T> interf, java.lang.Class<K> body, java.lang.Object[] args, java.lang.Class[] argsClasses)
buildFromDescriptor(java.lang.Class, java.lang.Object...)
instead.
Descriptor
.
This method could be removed from future versions of PolyD,
and its use is not recommended.
interf
- the interface used to build the new dispatcherbody
- the class of the single body (that must implement interf
)args
- the arguments used to create a new instance of body
argsClasses
- the classes of the arguments used to create the new instance
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |