我正在尝试为这个库创建一个 Xamarin Android 绑定,https://github.com/thoughtbot/expandable-recycler-view。
我尝试将以下内容添加到Metadata.xml
<attr path="/api/package[@name='com.thoughtbot.expandablerecyclerview']/interface[@name='listeners.GroupExpandCollapseListener']/class[@name='models.ExpandableGroup']/field[@name='p0']" name="managedName">p0_2</attr>
但我仍然收到错误并警告说 xpath 不匹配任何节点。
这是我试图匹配的文件和字段:
命名空间 Com.Thoughtbot.Expandablerecyclerview.Listeners {
// Metadata.xml XPath interface reference: path="/api/package[@name='com.thoughtbot.expandablerecyclerview.listeners']/interface[@name='GroupExpandCollapseListener']"
[Register ("com/thoughtbot/expandablerecyclerview/listeners/GroupExpandCollapseListener", "", "Com.Thoughtbot.Expandablerecyclerview.Listeners.IGroupExpandCollapseListenerInvoker")]
public partial interface IGroupExpandCollapseListener : IJavaObject {
// Metadata.xml XPath method reference: path="/api/package[@name='com.thoughtbot.expandablerecyclerview.listeners']/interface[@name='GroupExpandCollapseListener']/method[@name='onGroupCollapsed' and count(parameter)=1 and parameter[1][@type='com.thoughtbot.expandablerecyclerview.models.ExpandableGroup']]"
[Register ("onGroupCollapsed", "(Lcom/thoughtbot/expandablerecyclerview/models/ExpandableGroup;)V", "GetOnGroupCollapsed_Lcom_thoughtbot_expandablerecyclerview_models_ExpandableGroup_Handler:Com.Thoughtbot.Expandablerecyclerview.Listeners.IGroupExpandCollapseListenerInvoker, ExpandableRecyclerViewBindingsLibrary")]
void OnGroupCollapsed (global::Com.Thoughtbot.Expandablerecyclerview.Models.ExpandableGroup p0);
// Metadata.xml XPath method reference: path="/api/package[@name='com.thoughtbot.expandablerecyclerview.listeners']/interface[@name='GroupExpandCollapseListener']/method[@name='onGroupExpanded' and count(parameter)=1 and parameter[1][@type='com.thoughtbot.expandablerecyclerview.models.ExpandableGroup']]"
[Register ("onGroupExpanded", "(Lcom/thoughtbot/expandablerecyclerview/models/ExpandableGroup;)V", "GetOnGroupExpanded_Lcom_thoughtbot_expandablerecyclerview_models_ExpandableGroup_Handler:Com.Thoughtbot.Expandablerecyclerview.Listeners.IGroupExpandCollapseListenerInvoker, ExpandableRecyclerViewBindingsLibrary")]
void OnGroupExpanded (global::Com.Thoughtbot.Expandablerecyclerview.Models.ExpandableGroup p0);
}
public partial class GroupCollapsedEventArgs : global::System.EventArgs {
public GroupCollapsedEventArgs (global::Com.Thoughtbot.Expandablerecyclerview.Models.ExpandableGroup p0)
{
this.p0 = p0;
}
global::Com.Thoughtbot.Expandablerecyclerview.Models.ExpandableGroup p0;
public global::Com.Thoughtbot.Expandablerecyclerview.Models.ExpandableGroup P0 {
get { return p0; }
}
}
}
副本在这部分:
global::Com.Thoughtbot.Expandablerecyclerview.Models.ExpandableGroup p0;
public global::Com.Thoughtbot.Expandablerecyclerview.Models.ExpandableGroup P0 {
get { return p0; }
}
我的问题是我的 xpath 应该如何避免重复的属性定义P0
?