Xamarind Android Binding:泛型接口的实现者不会覆盖抽象方法

时间:2017-12-16 17:40:39

标签: generics xamarin binding xamarin.android

我正在为Android库创建绑定。该库具有以下类:

public interface GenericProcessListener<P, M, D> {
    void onStatusChanged(P process, M model, D processDetails);
    void onCompleted(P process, M model, D processDetails);
}

metadata.xml中,我排除了两种方法:

<remove-node path="/api/package[@name='io.mpos.transactionprovider']/interface[@name='GenericProcessListener']/method[@name='onStatusChanged']" />
<remove-node path="/api/package[@name='io.mpos.transactionprovider']/interface[@name='GenericProcessListener']/method[@name='onCompleted']" />

但是,在编译时,我收到以下错误:

Error:  error: GenericProcessListenerImplementor is not abstract and does not override abstract method onCompleted(Object,Object,Object) in GenericProcessListener

GenericProcessListenerImplementor是由Xamarin生成的类。其内容是

package mono.io.mpos.transactionprovider;

public class GenericProcessListenerImplementor
    extends java.lang.Object
    implements
        mono.android.IGCUserPeer,
        io.mpos.transactionprovider.GenericProcessListener
{
    /** @hide */
    public static final String __md_methods;
    static {
        __md_methods =
            "";
        mono.android.Runtime.register 
        ("IO.Mpos.Transactionprovider.IGenericProcessListenerImplementor, 
        MPOSBindings, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", 
        GenericProcessListenerImplementor.class, __md_methods);
    }


    public GenericProcessListenerImplementor ()
    {
        super ();
        if (getClass () == GenericProcessListenerImplementor.class)
            mono.android.TypeManager.Activate("IO.Mpos.Transactionprovider.IGenericProcessListenerImplementor, MPOSBindings, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", "", this, new java.lang.Object[] {  });
    }

    private java.util.ArrayList refList;
    public void monodroidAddReference (java.lang.Object obj)
    {
        if (refList == null)
            refList = new java.util.ArrayList ();
        refList.add (obj);
    }

    public void monodroidClearReferences ()
    {
        if (refList != null)
            refList.clear ();
    }
}

怎么办?不幸的是,我不能排除整个类,因为我需要它的子类。

0 个答案:

没有答案