Binding: Interface member of java.util.IMap not implemented

TedTaliaferroTedTaliaferro USMember
edited March 2013 in Xamarin.Android

In my java binding of the StackMob library, a class implements java.util.IMap. I am able to implement most of the interface except for methods that return an "abstract V" generic object (based on Android's java.util.Map API). These are the methods that cannot be implemented:

  • Java.Util.IMap.Get(Java.Lang.Object) - abstract V

  • Java.Util.IMap.Put(Java.Lang.Object) - abstract V

  • Java.Util.IMap.PutAll(System.Collections.IDictionary) - abstract void

  • Java.Util.IMap.Remove(Java.Lang.Object) - abstract V

  • Java.Util.IMap.Values() - abstract Collection

I get the "'Oauth.Signpost.Http.HttpParameters' does not implement interface member..." errors.

I tried this approach:

<add-node path="/api/package[@name='oauth.signpost.http']/class[implements[@name='java.util.Map']]"> 
 <method abstract="false" deprecated="not deprecated" final="false" name="Get" native="false" return="java.Lang.Object" static="false" synchronized="false" visibility="public"> 
  <parameter name="key" type="java.lang.Object"></parameter>
 </method> 
</add-node>

and this....

<add-node path="/api/package[@name='oauth.signpost.http']/class[implements[@name='java.util.Map']]"> 
 <method abstract="false" deprecated="not deprecated" final="false" name="get" native="false" return="java.Lang.Object" static="false" synchronized="false" visibility="public"> 
  <parameter name="key" type="java.lang.Object"></parameter>
 </method> 
</add-node>

and this to no avail:

<attr path="/api/package[@name='oauth.signpost.http']/class[@name='HttpParameters']/method[@name='get']" name="managedReturn">Java.Lang.Object 
</attr>

Is there another method or metadata API that can remedy this?

Posts

  • AtsushiEnomotoAtsushiEnomoto JPMember, Xamarin Team Xamurai

    java.util.Map used to be excluded from Mono.Android.dll, but the latest XA 4.7 alpha should contain that type, so you might want to simply switch to that.

  • AtsushiEnomotoAtsushiEnomoto JPMember, Xamarin Team Xamurai

    oops, never mind, that was wrong.

    You might rather want to add custom partial classes instead of trying to add metadata fixup in Metadata.xml. They can be explicitly implemented in custom C# code.

Sign In or Register to comment.