當前位置: 首頁>>代碼示例>>Java>>正文


Java JavaDoc2HTMLTextReader類代碼示例

本文整理匯總了Java中org.eclipse.jdt.internal.ui.text.javadoc.JavaDoc2HTMLTextReader的典型用法代碼示例。如果您正苦於以下問題:Java JavaDoc2HTMLTextReader類的具體用法?Java JavaDoc2HTMLTextReader怎麽用?Java JavaDoc2HTMLTextReader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


JavaDoc2HTMLTextReader類屬於org.eclipse.jdt.internal.ui.text.javadoc包,在下文中一共展示了JavaDoc2HTMLTextReader類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getHTMLContentReader

import org.eclipse.jdt.internal.ui.text.javadoc.JavaDoc2HTMLTextReader; //導入依賴的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
 */
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;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:32,代碼來源:JavadocContentAccess.java

示例2: convertToHTMLString

import org.eclipse.jdt.internal.ui.text.javadoc.JavaDoc2HTMLTextReader; //導入依賴的package包/類
private String convertToHTMLString(String comment) {
	JavaDoc2HTMLTextReader javaDoc2HTMLTextReader=new JavaDoc2HTMLTextReader(new StringReader(comment));
	try {
		return javaDoc2HTMLTextReader.getString();
	} catch (IOException e) {
		e.printStackTrace();
	}
	return comment;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:10,代碼來源:JavaDocBrowser.java

示例3: stripJavaComments

import org.eclipse.jdt.internal.ui.text.javadoc.JavaDoc2HTMLTextReader; //導入依賴的package包/類
private String stripJavaComments(String comment) {
	DocumentAdapter documentAdapter= new DocumentAdapter(null, fCreatedPackageFragment.getPath());
	try {
		documentAdapter.setContents(comment);
		return getString(new JavaDoc2HTMLTextReader(new JavaDocCommentReader(documentAdapter, 0, comment.length())));
	} finally {
		documentAdapter.close();
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:10,代碼來源:NewPackageWizardPage.java


注:本文中的org.eclipse.jdt.internal.ui.text.javadoc.JavaDoc2HTMLTextReader類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。