当前位置: 首页>>代码示例>>Java>>正文


Java IMember.getJavadocRange方法代码示例

本文整理汇总了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;
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:28,代码来源:JavadocContentAccess.java

示例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;
}
 
开发者ID:eclipse,项目名称:che,代码行数:35,代码来源:JavadocContentAccess.java

示例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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:23,代码来源:JavadocContentAccess2.java

示例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;
}
 
开发者ID:ioanaverebi,项目名称:Sparrow,代码行数:11,代码来源:ModelVisitor.java


注:本文中的org.eclipse.jdt.core.IMember.getJavadocRange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。