Naming Parameters With Javadoc
- PDF for offline use:
Let us know how you feel about this.
This article explains how to recover parameter names in an Java Binding Project by using Javadoc generated from the Java project.
When binding an existing Java library, some metadata about the bound
API is lost. In particular the names of parameters to methods.
Parameter names will appear as
p1, etc. This is because the
.class files do not preserve the parameter names that were used
in the Java source code.
A Xamarin.Android Java binding project can provide the parameter names if it has access to the Javadoc HTML from the original library.
Integrating Javadoc HTML into a Java Binding Project
Integrating the Javadoc HTML into a Java Binding project is a manual process consisting of the following steps:
- Download the Javadoc for the library
- Edit the
.csprojfile and add a
- Clean and rebuild the project
<PropertyGroup> <JavaDocPaths>Path\To\JavaDocs</JavaDocPaths> </PropertyGroup>
Once this is done, the original Java parameter names should be present in the APIs bound by a Java Binding Project.
This article covered how use Javadoc in a Java Binding Project to provide meaning parameter names for bound APIs.