org.aksw.commons.util.reflect
Class MultiMethodContainer<T>

java.lang.Object
  extended by org.aksw.commons.util.reflect.MultiMethodContainer<T>

public class MultiMethodContainer<T>
extends Object

A container where multiple objects/classes can register their methods. The invoke method will then search for the most appropriate method. The generic indicates the return type candidate methods must be covariant with User: raven Date: 6/11/11 Time: 9:33 AM What I want at some point in time is some kind of a rule container: "Search for the method in this object, if in some other no match was found" or "If some condition is satisfied, (e.g. function name equals "foo") then let this method handle that


Constructor Summary
MultiMethodContainer()
           
 
Method Summary
 void add(Object object)
           
 void addStatic(Class<?> clazz)
           
 T invoke(String name, List<Object> args)
           
 T invoke(String name, Object[] args)
           
 void remove(Object object)
           
 void removeStatic(Class<?> clazz)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiMethodContainer

public MultiMethodContainer()
Method Detail

addStatic

public void addStatic(Class<?> clazz)

add

public void add(Object object)

removeStatic

public void removeStatic(Class<?> clazz)

remove

public void remove(Object object)

invoke

public T invoke(String name,
                List<Object> args)

invoke

public T invoke(String name,
                Object[] args)


Copyright © 2012. All Rights Reserved.