Package org.eclipse.jdt.ui
Class JavadocContentAccess
java.lang.Object
org.eclipse.jdt.ui.JavadocContentAccess
Helper needed to get the content of a Javadoc comment.
This class is not intended to be subclassed or instantiated by clients.
- Since:
- 3.1
- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Reader
getContentReader
(IMember member, boolean allowInherited) Gets a reader for an IMember's Javadoc comment content from the source attachment.static Reader
getHTMLContentReader
(IMember member, boolean allowInherited) Deprecated.static Reader
getHTMLContentReader
(IMember member, boolean allowInherited, boolean useAttachedJavadoc) Gets a reader for an IMember's Javadoc comment content from the source attachment.
-
Method Details
-
getContentReader
public static Reader getContentReader(IMember member, boolean allowInherited) throws JavaModelException Gets a reader for an IMember's Javadoc comment content from the source attachment. The content does contain only the text from the comment without the Javadoc leading star characters. Returnsnull
if the member does not contain a Javadoc comment or if no source is available.- Parameters:
member
- The member to get the Javadoc of.allowInherited
- For methods with no (Javadoc) comment, the comment of the overridden class is returned ifallowInherited
istrue
.- Returns:
- Returns a reader for the Javadoc comment content or
null
if the member does not contain a Javadoc comment or if no source is available - Throws:
JavaModelException
- is thrown when the elements javadoc can not be accessed
-
getHTMLContentReader
public static Reader getHTMLContentReader(IMember member, boolean allowInherited, boolean useAttachedJavadoc) throws JavaModelException Gets a reader for an IMember's Javadoc comment content from the source attachment. and renders the tags in HTML. Returnsnull
if the member does not contain a Javadoc comment or if no source is available.- Parameters:
member
- the member to get the Javadoc of.allowInherited
- for methods with no (Javadoc) comment, the comment of the overridden class is returned ifallowInherited
istrue
useAttachedJavadoc
- iftrue
Javadoc will be extracted from attached Javadoc if there's no source- Returns:
- a reader for the Javadoc comment content in HTML or
null
if the member does not contain a Javadoc comment or if no source is available - Throws:
JavaModelException
- is thrown when the elements Javadoc can not be accessed- Since:
- 3.2
-
getHTMLContentReader
@Deprecated public static Reader getHTMLContentReader(IMember member, boolean allowInherited) throws JavaModelException Deprecated.As of 3.2, replaced bygetHTMLContentReader(IMember, boolean, boolean)
Gets a reader for an IMember's Javadoc comment content from the source attachment. and renders the tags in HTML. Returnsnull
if the member does not contain a Javadoc comment or if no source is available.- Parameters:
member
- The member to get the Javadoc of.allowInherited
- For methods with no (Javadoc) comment, the comment of the overridden class is returned ifallowInherited
istrue
.- Returns:
- Returns a reader for the Javadoc comment content in HTML or
null
if the member does not contain a Javadoc comment or if no source is available - Throws:
JavaModelException
- is thrown when the elements javadoc can not be accessed
-
getHTMLContentReader(IMember, boolean, boolean)