本文整理汇总了Java中org.eclipse.jdt.core.dom.BlockComment类的典型用法代码示例。如果您正苦于以下问题:Java BlockComment类的具体用法?Java BlockComment怎么用?Java BlockComment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BlockComment类属于org.eclipse.jdt.core.dom包,在下文中一共展示了BlockComment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
public boolean visit(BlockComment node) {
int startLineNumber = compilationUnit.getLineNumber(node.getStartPosition());
int endLineNumber = compilationUnit.getLineNumber(node.getStartPosition() + node.getLength());
//System.out.println("dd " + startLineNumber + " " + endLineNumber);
//System.out.println("ee " + startLine + " " + endLine + "\n");
if ((startLineNumber >= startLine && endLineNumber <= endLine) ||
startLine - 1 == endLineNumber) {
// Build the comment char by char
StringBuilder comment = new StringBuilder();
for (int i = node.getStartPosition(); i < node.getStartPosition() + node.getLength(); i++) {
comment.append(source[i]);
}
if (comment.capacity() > 0) {
String str = comment.toString().replaceAll("\\n\\s+", "\n ");
if (str != null) {
CommentMap cMap = new CommentMap(str, startLineNumber, endLineNumber, 2);
cMapList.add(cMap);
}
}
}
return true;
}
示例2: visit
import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public boolean visit(BlockComment node) {
//System.out.println("Found: " + node.getClass());
//println("");
//println(node.getStartPosition() + " " + node.getLength());
String comment = new String(Arrays.copyOfRange(sourceCode,
node.getStartPosition(),
node.getStartPosition() + node.getLength()));
print(comment);
return false;
}
示例3: endVisit
import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void endVisit(BlockComment node) {
logger.warn("Method endVisitBlockComment for " + node + " for " + node + " not implemented!");
super.endVisit(node);
}
示例4: visit
import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean visit(BlockComment node) {
logger.warn("Method visitBlockComment for " + node + " for " + node + " not implemented!");
return super.visit(node);
}
示例5: visit
import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public boolean visit(final BlockComment node) {
return false;
}
示例6: visit
import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public boolean visit(final BlockComment node) {
// not instrumentable, contains no instrumentable nodes
return false;
}
示例7: visit
import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public boolean visit(BlockComment node) {
if (node.subtreeMatch(fMatcher, fNodeToMatch))
return matches(node);
return super.visit(node);
}
示例8: endVisit
import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public void endVisit(BlockComment node) {
endVisitNode(node);
}
示例9: visit
import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public boolean visit(BlockComment node) {
return visitNode(node);
}
示例10: modifyCompilationUnit
import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public void modifyCompilationUnit(CompilationUnit astRoot,
IProgressMonitor monitor) throws JavaModelException, CoreException,
BadLocationException {
final ICompilationUnit adapter = (ICompilationUnit) astRoot
.getJavaElement().getAdapter(IOpenable.class);
modifiedDocument = false;
if (adapter != null) {
document = new Document(adapter.getSource());
List<Comment> commentList = astRoot.getCommentList();
offset = 0;
for (Comment comment : commentList) {
comment.accept(new ASTVisitor() {
@Override
public boolean visit(BlockComment node) {
int startPosition = node.getStartPosition();
int endPosition = startPosition + node.getLength();
try {
int lineOfOffset = document
.getLineOfOffset(startPosition - offset);
startPosition = document
.getLineOffset(lineOfOffset);
int replaceLength = endPosition - startPosition
+ LINE_DELIMITER_LENGTH - offset;
if (startPosition > -1
&& document
.get()
.substring(
startPosition,
startPosition
+ replaceLength)
.contains(NON_JAVADOC_COMMENT)) {
int replaceStart = startPosition
- LINE_DELIMITER_LENGTH;
document.replace(replaceStart, replaceLength,
EMPTY_STRING);
offset = endPosition - startPosition
+ LINE_DELIMITER_LENGTH;
modifiedDocument = true;
}
} catch (BadLocationException e) {
e.printStackTrace();
}
return super.visit(node);
}
});
}
if (modifiedDocument) {
adapter.getBuffer().setContents(document.get());
adapter.save(monitor, true);
}
}
}
示例11: visit
import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public boolean visit(BlockComment node) {
return visit((Comment)node);
}
示例12: endVisit
import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public void endVisit(BlockComment node) {
endVisit((Comment)node);
}
示例13: visit
import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public boolean visit(BlockComment node) {
this.fBuffer.append("/* */");//$NON-NLS-1$
return false;
}
示例14: visit
import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
public boolean visit(BlockComment node) {
printIndent();
this.buffer.append("/* */");//$NON-NLS-1$
return false;
}
示例15: visit
import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public boolean visit(final BlockComment node) {
return this.internalVisit(node);
}