|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.beandoc.output.SimpleDecorator
org.springframework.beandoc.output.JavaDocDecorator
public class JavaDocDecorator
Decorator implementation that adds JavaDoc href's to beans based on their classes. The Decorator knows about standard Java library class locations, and additional locations can be added based on a simple pattern matching strategy for the class name.
Field Summary | |
---|---|
protected static String |
ATTRIBUTE_JAVADOC
|
Fields inherited from class org.springframework.beandoc.output.SimpleDecorator |
---|
logger |
Constructor Summary | |
---|---|
JavaDocDecorator()
Default constructor adds well know locations to the JavaDoc location Map which can be used by a Transformer. |
Method Summary | |
---|---|
void |
addLocation(String classPrefix,
String url)
Add a JavaDoc location used in the output documents to link classnames to their JavaDoc pages. |
protected void |
decorateElement(org.jdom.Element element)
Each Element in each input Document is iteratively
passed to this method allowing subclasses to add or amend any attributes they
desire. |
SortedMap |
getLocations()
A SortedMap keyed by package prefixes that point to URI's
(local, remote, absolute or relative) of JavaDoc locations. |
void |
setLocations(SortedMap map)
A SortedMap keyed by package prefixes that point to URI's
(local, remote, absolute or relative) of JavaDoc locations. |
Methods inherited from class org.springframework.beandoc.output.SimpleDecorator |
---|
decorate, setFilter, setFilterNames |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String ATTRIBUTE_JAVADOC
Constructor Detail |
---|
public JavaDocDecorator()
Method Detail |
---|
protected void decorateElement(org.jdom.Element element)
SimpleDecorator
Element
in each input Document
is iteratively
passed to this method allowing subclasses to add or amend any attributes they
desire. It's possible to filter the view of the DOM, and thereby the list of
Element
s that will be passed to this method by setting a
Filter
on this instance.
decorateElement
in class SimpleDecorator
SimpleDecorator.decorateElement(org.jdom.Element)
public void setLocations(SortedMap map)
SortedMap
keyed by package prefixes that point to URI's
(local, remote, absolute or relative) of JavaDoc locations. Used to link
classnames to their javadoc locations in the HTML output. The preferred
way to modify this list programmatically is through the
addLocation(java.lang.String, java.lang.String)
convenience method.
map
- a SortedMap
of javadoc locations keyed by
package name prefixes.addLocation(String, String)
public void addLocation(String classPrefix, String url)
String.startsWith()
) will be linked to this location.
For example, adding a location where
classPrefix = com.foo.bar. url = http://our.server.com/doc/api/will cause a class in this package named
Example.class
to
be linked with an HREF of;
http://our.server.com/doc/api/com/foo/bar/Example.html
Note that the package names are used as keys in a SortedMap
which is sorted in reverse order by key length. This means you can add
package keys in any order you like, and class names will be evaluated
against the longest package names first down to the shortest. This
enables you for example to specify that
org.springframework.samples.
has a different document
location than org.springframework.
classPrefix
- the prefix, of arbitrary length, of the package and
class name to match against. May not be null (will be ignored)url
- the root of the API documentationpublic SortedMap getLocations()
SortedMap
keyed by package prefixes that point to URI's
(local, remote, absolute or relative) of JavaDoc locations. Used to link
classnames to their javadoc locations in the HTML output.
The returned underlying SortedMap
is modifiable and will,
if modified, affect subsequent calls to the BeanDocEngine
's
process()
method if you are using the tool
programmatically. The preferred way to modify this list is through the
addLocation(java.lang.String, java.lang.String)
convenience method.
SortedMap
of javadoc locations keyed by package
name prefixes.addLocation(java.lang.String, java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |