本文整理汇总了Java中org.eclipse.jdt.core.IMember.getAttachedJavadoc方法的典型用法代码示例。如果您正苦于以下问题:Java IMember.getAttachedJavadoc方法的具体用法?Java IMember.getAttachedJavadoc怎么用?Java IMember.getAttachedJavadoc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.IMember
的用法示例。
在下文中一共展示了IMember.getAttachedJavadoc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHTMLContentReader
import org.eclipse.jdt.core.IMember; //导入方法依赖的package包/类
/**
* Gets a reader for an IMember's Javadoc comment content from the source attachment. and renders
* the tags in HTML. Returns <code>null</code> if the member does not contain a Javadoc comment or
* if no source is available.
*
* @param member the member to get the Javadoc of.
* @param allowInherited for methods with no (Javadoc) comment, the comment of the overridden
* class is returned if <code>allowInherited</code> is <code>true</code>
* @param useAttachedJavadoc if <code>true</code> Javadoc will be extracted from attached Javadoc
* if there's no source
* @return a reader for the Javadoc comment content in HTML or <code>null</code> if the member
* does not contain a Javadoc comment or if no source is available
* @throws org.eclipse.jdt.core.JavaModelException is thrown when the elements Javadoc can not be
* accessed
* @since 3.2
*/
public static Reader getHTMLContentReader(
IMember member, boolean allowInherited, boolean useAttachedJavadoc)
throws JavaModelException {
Reader contentReader = internalGetContentReader(member);
if (contentReader != null) return new JavaDoc2HTMLTextReader(contentReader);
if (useAttachedJavadoc
&& member.getOpenable().getBuffer() == null) { // only if no source available
String s = member.getAttachedJavadoc(null);
if (s != null) return new StringReader(s);
}
if (allowInherited && (member.getElementType() == IJavaElement.METHOD))
return findDocInHierarchy((IMethod) member, true, useAttachedJavadoc);
return null;
}
示例2: getHTMLContent
import org.eclipse.jdt.core.IMember; //导入方法依赖的package包/类
/**
* Gets an IMember's Javadoc comment content from the source or Javadoc attachment and renders the
* tags and links in HTML. Returns <code>null</code> if the member does not contain a Javadoc
* comment or if no source is available.
*
* @param member the member to get the Javadoc of
* @param useAttachedJavadoc if <code>true</code> Javadoc will be extracted from attached Javadoc
* if there's no source
* @return the Javadoc comment content in HTML or <code>null</code> if the member does not have a
* Javadoc comment or if no source is available
* @throws org.eclipse.jdt.core.JavaModelException is thrown when the element's Javadoc cannot be
* accessed
*/
public static String getHTMLContent(IMember member, boolean useAttachedJavadoc, String urlPrefix)
throws JavaModelException {
String sourceJavadoc = getHTMLContentFromSource(member, urlPrefix);
if (sourceJavadoc == null
|| sourceJavadoc.length() == 0
|| sourceJavadoc.trim().equals("{@inheritDoc}")) { // $NON-NLS-1$
if (useAttachedJavadoc) {
if (member.getOpenable().getBuffer() == null) { // only if no source available
return member.getAttachedJavadoc(null);
}
if (canInheritJavadoc(member)) {
IMethod method = (IMethod) member;
String attachedDocInHierarchy = findAttachedDocInHierarchy(method);
// Prepend "Overrides:" / "Specified by:" reference headers to make clear
// that description has been copied from super method.
if (attachedDocInHierarchy == null) return sourceJavadoc;
StringBuffer superMethodReferences = createSuperMethodReferences(method, urlPrefix);
if (superMethodReferences == null) return attachedDocInHierarchy;
superMethodReferences.append(attachedDocInHierarchy);
return superMethodReferences.toString();
}
}
}
return sourceJavadoc;
}
示例3: getHTMLContentReader
import org.eclipse.jdt.core.IMember; //导入方法依赖的package包/类
/**
* Gets a reader for an IMember's Javadoc comment content from the source
* attachment. and renders the tags in HTML. Returns <code>null</code> if
* the member does not contain a Javadoc comment or if no source is
* available.
*
* @param member
* the member to get the Javadoc of.
* @param allowInherited
* for methods with no (Javadoc) comment, the comment of the
* overridden class is returned if <code>allowInherited</code> is
* <code>true</code>
* @param useAttachedJavadoc
* if <code>true</code> Javadoc will be extracted from attached
* Javadoc if there's no source
* @return a reader for the Javadoc comment content in HTML or
* <code>null</code> 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
*/
static Reader getHTMLContentReader(IMember member, boolean allowInherited, boolean useAttachedJavadoc)
throws JavaModelException {
Reader contentReader= internalGetContentReader(member);
if (contentReader != null) {
return contentReader;
}
if (useAttachedJavadoc && member.getOpenable().getBuffer() == null) { // only if no source available
String s= member.getAttachedJavadoc(null);
if (s != null) {
return new StringReader(s);
}
}
if (allowInherited && (member.getElementType() == IJavaElement.METHOD)) {
return findDocInHierarchy((IMethod) member, useAttachedJavadoc);
}
return null;
}