-
Notifications
You must be signed in to change notification settings - Fork 60
Metadata Cheat Sheet
Quick reference for commonly used metadata
constructs.
-
/interface
EX:/interface[@name='AuthListener']
-
/class
EX:/class[@name='MapView']
-
/method
EX:/method[@name='setTileSource']
-
/method(with parameters)
EX:/method[@name=``onCreate``and count(parameter)=2 and parameter[1][@type='com.my.CustomActivity'] and parameter[2][@type='android.os.Bundle']]"
-
/parameter
EX:/parameter[@name='p0']
-
/parameter(with type)
EX:parameter[1][@type='com.my.CustomActivity']
-
name="managedType"
- EX:Java.Lang.Object
-
name="obfuscated"
- Changes the obfuscation EX:true
/false
-
name="managedName"
- Changes the managed name EX:MyCSharpName
-
name="propertyName"
- Changes the property name EX:MyPropertyName
-
name="managedReturn"
- Changes the managed return type EX:Java.Lang.Object
-
name="argsType"
- changes the argument type EX:MyCustomErrorEventArgs
-
name="sender"
- Changes which parameter of a method should be the sender parameter when it's mapped to an event EX:true
/false
-
name="eventName"
- Changes the event name EX:MyEventName
Typically we will see characteristics of obfuscated types in our respective .jar/.aar
libraries and we must unobfuscate them for the Bindings Generator to generate the respective C# types.
<attr path="/api/package[@name='{package_name}']/class[@name='{name}']" name="obfuscated">false</attr>
Sometimes you'll run into duplicate managedNames
or you might need to normalize your generated C# classes for sanity reasons.
<attr path="/api/package[@name='{package_name}']/class[@name='{name}']" name="managedName">NewManagedName</attr>
Your class might not have the proper visibility for the Bindings Generator to traverse through as it does not generate bindings for non-public classes or derived classes. Typically switching the visibility to public
fixes this.
<attr path="/api/package[@name='{package_name}']/class[@name='{name}']" name="visibility">public</attr>
You can use <add-node>
to add just about anything to your binding which will generate in the api.xml
file. Typically you may want to add a class, change a constructor, or switch a generic type.
EX: (Creates a class with a constructor and field):
<add-node path="/api/package[@name='org.alljoyn.bus']">
<class abstract="false" deprecated="not deprecated" final="false" name="AuthListener.AuthRequest" static="true" visibility="public" extends="java.lang.Object">
<constructor deprecated="not deprecated" final="false" name="AuthListener.AuthRequest" static="false" type="org.alljoyn.bus.AuthListener.AuthRequest" visibility="public" />
<field name="p0" type="org.alljoyn.bus.AuthListener.Credentials" />
</class>
</add-node>
Typically it's easiest to just remove anything in a binding that we will not use. You can look at the class that you want to use and see everything it references to get a better idea of what you will need and what you will not.
<remove-node path="/api/package[@name='{package_name}']/class[@name='{name}']" />