Code example for Method

Methods: setAccessiblegetName

0
    public ObserverMethodListener(Object instance, Method method) {
        this.instance = instance;
        this.method = method;
        //This descriptor is used in the equals and hashcode method to compare 
        //methods between super-classes, subclasses and interface declarations. 
        this.descriptor = method.getName() + ':' + RuntimeSupport.makeDescriptor(method);
        method.setAccessible(true);
    } 
 
    public void onEvent(Object event) {
        try { 
            method.invoke(instance, event);
        } catch (InvocationTargetException e) {
            Ln.e(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        } 
    } 
 
    public Object getInstance() {
        return instance;