本文整理汇总了Java中org.eclipse.jdt.core.IMember.getJavadocRange方法的典型用法代码示例。如果您正苦于以下问题:Java IMember.getJavadocRange方法的具体用法?Java IMember.getJavadocRange怎么用?Java IMember.getJavadocRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.IMember
的用法示例。
在下文中一共展示了IMember.getJavadocRange方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: internalGetContentReader
import org.eclipse.jdt.core.IMember; //导入方法依赖的package包/类
/**
* 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.
* 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.
* @return Returns a reader for the Javadoc comment content 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.4
*/
private static Reader internalGetContentReader(IMember member) throws JavaModelException {
IBuffer buf= member.getOpenable().getBuffer();
if (buf == null) {
return null; // no source attachment found
}
ISourceRange javadocRange= member.getJavadocRange();
if (javadocRange != null) {
JavaDocCommentReader reader= new JavaDocCommentReader(buf, javadocRange.getOffset(), javadocRange.getOffset() + javadocRange.getLength() - 1);
if (!containsOnlyInheritDoc(reader, javadocRange.getLength())) {
reader.reset();
return reader;
}
}
return null;
}
示例2: internalGetContentReader
import org.eclipse.jdt.core.IMember; //导入方法依赖的package包/类
/**
* 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.
* 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.
* @return Returns a reader for the Javadoc comment content 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.4
*/
private static Reader internalGetContentReader(IMember member) throws JavaModelException {
IBuffer buf = member.getOpenable().getBuffer();
if (buf == null) {
return null; // no source attachment found
}
ISourceRange javadocRange = member.getJavadocRange();
if (javadocRange != null) {
JavaDocCommentReader reader =
new JavaDocCommentReader(
buf,
javadocRange.getOffset(),
javadocRange.getOffset() + javadocRange.getLength() - 1);
if (!containsOnlyInheritDoc(reader, javadocRange.getLength())) {
reader.reset();
return reader;
}
}
return null;
}
示例3: getHTMLContentFromSource
import org.eclipse.jdt.core.IMember; //导入方法依赖的package包/类
private static String getHTMLContentFromSource(IMember member, String urlPrefix)
throws JavaModelException {
IBuffer buf = member.getOpenable().getBuffer();
if (buf == null) {
return null; // no source attachment found
}
ISourceRange javadocRange = member.getJavadocRange();
if (javadocRange == null) {
if (canInheritJavadoc(member)) {
// Try to use the inheritDoc algorithm.
String inheritedJavadoc = javadoc2HTML(member, "/***/", urlPrefix); // $NON-NLS-1$
if (inheritedJavadoc != null && inheritedJavadoc.length() > 0) {
return inheritedJavadoc;
}
}
return null; // getJavaFxPropertyDoc(member);
}
String rawJavadoc = buf.getText(javadocRange.getOffset(), javadocRange.getLength());
return javadoc2HTML(member, rawJavadoc, urlPrefix);
}
示例4: getComments
import org.eclipse.jdt.core.IMember; //导入方法依赖的package包/类
private String getComments(ICompilationUnit unit, IMember member) {
try {
ISourceRange range = member.getJavadocRange();
if (range != null)
return unit.getSource().substring(range.getOffset(), range.getOffset() + range.getLength());
} catch (JavaModelException e1) {
e1.printStackTrace();
}
return null;
}