Skip to content

CallThrough doesn't support custom interfaces #133

@shannong

Description

@shannong

It would be nice if Callthrough methods could be added arbitrarily to Transfuse components. If I annotate a method with @CallThrough, the generated class should call the annotated method directly (returning the value if appropriate)

For example:

public class BaseFragment extends Fragment{
    public void doSomething() {
        System.out.println("Override me!");
    }
}
@Fragment(type = BaseFragment.class)
public class TestFragment {
    @CallThrough
    public void doSomething() {
        System.out.println("Overriding doSomething in MyFragment.class");
    }
}

Would generate the following:

public class TestFragmentFragment extends BaseFragment{
    TestFragment delegate;
    @Override
    public void doSomething() {
        delegate.doSomething();
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions