epydoc.markup.javadoc.ParsedJavadocDocstring

Package epydoc :: Package markup :: Module javadoc :: Class ParsedJavadocDocstring |
[show private | hide private]
[frames | no frames]

## Class ParsedJavadocDocstring

    ParsedDocstring --+
                      |
                     ParsedJavadocDocstring

An encoded version of a Javadoc docstring. Since Javadoc is a fairly simple markup language, we don't do any processing in advance; instead, we wait to split fields or resolve crossreference links until we need to.

Method Summary
| ``__init__`(self, docstring, errors)` Create a new `ParsedJavadocDocstring`.
| ``concatenate`(self, other)` Return a new parsed docstring containing the concatination of this docstring and `other`.
`ParsedDocstring` | ``summary`(self)` Return a short summary of this docstring.
`string` | ``to_plaintext`(self, docstring_linker, **options)` Translate this docstring to plaintext.
| ``_check_links`(self, errors)` Make sure that all @{link}s are valid.
Inherited from `ParsedDocstring`: `__add__`, `index_terms`, `to_latex`
Field Splitting
`(`ParsedDocstring`, list of `Field`)` | ``split_fields`(self, errors)` Split this docstring into its body and its fields.
HTML Output
`string` | ``to_html`(self, docstring_linker, **options)` Translate this docstring to HTML.

Class Variable Summary
Field Splitting
`list` | `_ARG_FIELDS`: A list of the fields that take arguments.
`SRE_Pattern` | `_FIELD_RE`: A regular expression used to search for Javadoc block tags.
HTML Output
`SRE_Pattern` | `_LINK_SPLIT_RE`: A regular expression used to search for Javadoc inline tags.
`SRE_Pattern` | `_LINK_RE`: A regular expression used to process Javadoc inline tags.

Method Details

### split_fields(self, errors=None) Split this docstring into its body and its fields. Parameters: `errors` - A list where any errors generated during splitting will be stored. If no list is specified, then errors will be ignored. (type=`list` of `ParseError`) Returns: A tuple `(body, fields)`, where `body` is the main body of this docstring, and `fields` is a list of its fields. (type=`(`ParsedDocstring`, list of `Field`)`) Overrides: `epydoc.markup.ParsedDocstring.split_fields` (inherited documentation)

### to_html(self, docstring_linker, **options) Translate this docstring to HTML. Parameters: `docstring_linker` - An HTML translator for crossreference links into and out of the docstring. (type=`DocstringLinker`) `options` - Any extra options for the output. Unknown options are ignored. Returns: An HTML fragment that encodes this docstring. (type=`string`) Overrides: `epydoc.markup.ParsedDocstring.to_html` (inherited documentation)

### __init__(self, docstring, errors=None) (Constructor) Create a new `ParsedJavadocDocstring`. Parameters: `docstring` - The docstring that should be used to construct this `ParsedJavadocDocstring`. (type=`string`) `errors` - A list where any errors generated during parsing will be stored. If no list is given, then all errors are ignored. (type=`list` of `ParseError`)

### concatenate(self, other) Returns: A new parsed docstring containing the concatination of this docstring and `other`. Raises: `ValueError` - If the two parsed docstrings are incompatible. Overrides: `epydoc.markup.ParsedDocstring.concatenate` (inherited documentation)

### summary(self) Returns: A short summary of this docstring. Typically, the summary consists of the first sentence of the docstring. (type=`ParsedDocstring`) Overrides: `epydoc.markup.ParsedDocstring.summary` (inherited documentation)

### to_plaintext(self, docstring_linker, **options) Translate this docstring to plaintext. Parameters: `docstring_linker` - A plaintext translator for crossreference links into and out of the docstring. (type=`DocstringLinker`) `options` - Any extra options for the output. Unknown options are ignored. Returns: A plaintext fragment that encodes this docstring. (type=`string`) Overrides: `epydoc.markup.ParsedDocstring.to_plaintext` (inherited documentation)

### _check_links(self, errors) Make sure that all @{link}s are valid. We need a separate method for ths because we want to do this at parse time, not html output time. Any errors found are appended to `errors`.

Class Variable Details

    ### _ARG_FIELDS A list of the fields that take arguments. Since Javadoc doesn't mark arguments in any special way, we must consult this list to decide whether the first word of a field is an argument or not. Type: `list` Value:
        ['group',
         'variable',
         'var',
         'type',
         'cvariable',
         'cvar',
         'ivariable',
         'ivar',
        ...

    ### _FIELD_RE A regular expression used to search for Javadoc block tags. Type: `SRE_Pattern` Value:
        (^\s*@\w+[\s\$])

    ### _LINK_SPLIT_RE A regular expression used to search for Javadoc inline tags. Type: `SRE_Pattern` Value:
        (\{@link(?:plain)?\s[^\}]+\})

    ### _LINK_RE A regular expression used to process Javadoc inline tags. Type: `SRE_Pattern` Value:
        \{@link(?:plain)?\s+([\w#\.]+)(?:\([^\)]*\))?(\s+.*)?\}

Generated by Epydoc 2.1 on Sat Mar 20 17:46:14 2004 | http://epydoc.sf.net