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


Java BlockComment类代码示例

本文整理汇总了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;
}
 
开发者ID:e32wong,项目名称:clocom,代码行数:27,代码来源:CommentVisitor.java

示例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;
}
 
开发者ID:mrmonday,项目名称:j2d,代码行数:12,代码来源:J2dVisitor.java

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

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

示例5: visit

import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public boolean visit(final BlockComment node) {
	return false;
}
 
开发者ID:Beagle-PSE,项目名称:Beagle,代码行数:5,代码来源:NotRecursingAstVisitor.java

示例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;
}
 
开发者ID:Beagle-PSE,项目名称:Beagle,代码行数:6,代码来源:InstrumentableAstNodeLister.java

示例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);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:AstMatchingNodeFinder.java

示例8: endVisit

import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public void endVisit(BlockComment node) {
	endVisitNode(node);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:5,代码来源:GenericVisitor.java

示例9: visit

import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public boolean visit(BlockComment node) {
	return visitNode(node);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:5,代码来源:GenericVisitor.java

示例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);
		}
	}
}
 
开发者ID:vogellacompany,项目名称:codemodify,代码行数:56,代码来源:NonJavaDocRemover.java

示例11: visit

import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public boolean visit(BlockComment node) {
	return visit((Comment)node);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:5,代码来源:HierarchicalASTVisitor.java

示例12: endVisit

import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public void endVisit(BlockComment node) {
	endVisit((Comment)node);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:5,代码来源:HierarchicalASTVisitor.java

示例13: visit

import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public boolean visit(BlockComment node) {
	this.fBuffer.append("/* */");//$NON-NLS-1$
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:6,代码来源:ASTFlattener.java

示例14: visit

import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
public boolean visit(BlockComment node) {
	printIndent();
	this.buffer.append("/* */");//$NON-NLS-1$
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:6,代码来源:NaiveASTFlattener.java

示例15: visit

import org.eclipse.jdt.core.dom.BlockComment; //导入依赖的package包/类
@Override
public boolean visit(final BlockComment node) {
	return this.internalVisit(node);
}
 
开发者ID:awltech,项目名称:eclipse-i18ntools,代码行数:5,代码来源:ASTNodeFinder.java


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