Directives in your own pages¶
Generated pages are optional. These directives put Java documentation anywhere in a handwritten page. Each example shows the reStructuredText and its result. See Configuration and reference for every option.
A type with selected members¶
:members: takes entries separated by semicolons, so overloads can include their
parameter types. A bare name selects every overload.
.. java:autoclass:: demo.Widget
:members: convert(int); LABEL; count
:visibility: public
:no-index:
- public class demo.Widget implements Transformer<String>[source]
A widget with a unified Java API and handwritten guides.
Call
#convert(int)or the text overload. Types such asInstant,java.util.Map.Entry, andString#substring(int, int)link to configured external Javadoc.Preserves structure and emphasis.
Supports nested lists:
Read.
Transform.
Widget widget = new Widget(); String result = widget.convert(42); if (result.length() > 0) { System.out.println(result); }
First lineSecond lineThird lineLast line.Try query parameters.
An inline snippet:
String value = widget.convert(7); System.out.println(value);
Conversion examples¶ Call
Result
Notes
widget.convert(42)"42"Labelled "widget"; long names such as
com.example.widgets.configuration.DefaultWidgetLabelProviderstay inside the table- See also:
- Since:
1.0
Fields and constants
Methods
count is protected, so :visibility: public leaves it out.
All members but some¶
An empty :members: selects every member; :exclude-members: removes some.
.. java:autoclass:: demo.Mode
:members:
:exclude-members: values; valueOf
:no-index:
A single member¶
.. java:autofield:: demo.Widget#LABEL
:no-index:
A summary table¶
java:autosummary lists packages, types or members with links and their first
sentences, like sphinx.ext.autosummary.
.. java:autosummary::
demo
demo.Widget
demo.Shape
demo.Widget#convert(int)
Example API. |
|
A widget with a unified Java API and handwritten guides. |
|
Something with a position; only |
|
Converts a number to text. |
Package documentation¶
java:autopackage renders the comment in package-info.java. The generated
demo page uses it.
.. java:autopackage:: demo