V5.2packagesynopsis
packagesynopsis — The syntax summary for a package definition.
Synopsis
packagesynopsis ::=
- Sequence of:
info
? (db.titleforbidden.info)- Zero or more of:
- Zero or more of:
package
- Zero or more of:
- Zero or more of:
synopsisinfo
- Synopsis elements
Attributes
Common attributes and common linking attributes.
Additional attributes:
- language
- packageref
Additional Constraints
- If this element is the root element, it must have a version attribute.
Description
A packagesynopsis
contains the syntax summary of a
programming language “package”. In some languages (e.g., C#), what
DocBook chooses to identify with the packagesynopsis
tag is
referred to as a namespace. This is to avoid confusion with the XML
concept of “namespace”, and because other languages (e.g., Java) call
these things packages.
Packages, in this sense, are generally wrappers (either explicitly or implicitly) for a collection of classes, methods, functions, etc.
Processing expectations
For the most part, the processing application is expected to generate all of the parentheses, semicolons, commas, and so on required in the rendered synopsis.
Attributes
Common attributes and common linking attributes.
- any attribute
Any attribute in any other explicit namespace
- language
Identifies the language (i.e. programming language) of the content
- packageref
Identifies the package to which this synopsis (logically) belongs
Parents
These elements contain packagesynopsis
: abstract
, acknowledgements
, annotation
, answer
, appendix
, article
, bibliodiv
, bibliography
, bibliolist
, blockquote
, callout
, calloutlist
, caption
(db.caption), caution
, chapter
, colophon
, constraintdef
, cover
, danger
, dedication
, entry
, example
, figure
, footnote
, glossary
, glossdef
, glossdiv
, glosslist
, important
, index
, indexdiv
, informalexample
, informalfigure
, itemizedlist
, legalnotice
, listitem
, meta
(db.meta.content), msgexplan
, msgtext
, note
, orderedlist
, packagesynopsis
, para
, partintro
, preface
, procedure
, qandadiv
, qandaset
, question
, refsect1
, refsect2
, refsect3
, refsection
, refsynopsisdiv
, result
, revdescription
, sect1
, sect2
, sect3
, sect4
, sect5
, section
, setindex
, sidebar
, simplesect
, step
, taskprerequisites
, taskrelated
, tasksummary
, td
, textobject
, th
, tip
, toc
, tocdiv
, topic
, variablelist
, warning
.
Children
The following elements occur in packagesynopsis
: classsynopsis
, cmdsynopsis
, constructorsynopsis
, destructorsynopsis
, enumsynopsis
, fieldsynopsis
, funcsynopsis
, info
(db.titleforbidden.info), macrosynopsis
, methodsynopsis
, modifier
, package
, packagesynopsis
, synopsisinfo
, typedefsynopsis
, unionsynopsis
.
Examples
A Java package containing a single class.
1 |<packagesynopsis xmlns="http://docbook.org/ns/docbook" version="5.0"
|language="java">
|<package>org.example.packages</package>
|<classsynopsis>
5 |<ooclass>
|<modifier>public</modifier>
|<classname>MyClass</classname>
|</ooclass>
|<fieldsynopsis>
10 |<modifier>public</modifier>
|<modifier>static</modifier>
|<modifier>final</modifier>
|<type>int</type>
|<varname>BASE</varname>
15 |<initializer>0</initializer>
|</fieldsynopsis>
|<constructorsynopsis>
|<modifier>public</modifier>
|<methodname>MyClass</methodname>
20 |<void/>
|</constructorsynopsis>
|<methodsynopsis>
|<modifier>public</modifier>
|<void/>
25 |<methodname>dwim</methodname>
|<methodparam>
|<type>int</type>
|<parameter>scope</parameter>
|</methodparam>
30 |</methodsynopsis>
|</classsynopsis>
||
</packagesynopsis>
package org.example.packages
;
public class MyClass { public static final int BASE = 0; public MyClass(); public dwim(int scope); }