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


Java DocCommentTable类代码示例

本文整理汇总了Java中com.sun.tools.javac.tree.DocCommentTable的典型用法代码示例。如果您正苦于以下问题:Java DocCommentTable类的具体用法?Java DocCommentTable怎么用?Java DocCommentTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DocCommentTable类属于com.sun.tools.javac.tree包,在下文中一共展示了DocCommentTable类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: attach

import com.sun.tools.javac.tree.DocCommentTable; //导入依赖的package包/类
static void attach(final JCTree node, String docCommentContent, Object map_) {
	final String docCommentContent_ = docCommentContent;
	((DocCommentTable) map_).putComment(node, new Comment() {
		@Override public String getText() {
			return docCommentContent_;
		}
		
		@Override public int getSourcePos(int index) {
			return -1;
		}
		
		@Override public CommentStyle getStyle() {
			return CommentStyle.JAVADOC;
		}
		
		@Override public boolean isDeprecated() {
			return JavacHandlerUtil.nodeHasDeprecatedFlag(node);
		}
	});
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:21,代码来源:DocCommentIntegrator.java

示例2: PrettyPrinter

import com.sun.tools.javac.tree.DocCommentTable; //导入依赖的package包/类
@SuppressWarnings({"unchecked", "rawtypes"})
public PrettyPrinter(Writer out, JCCompilationUnit cu, List<CommentInfo> comments, FormatPreferences preferences) {
	this.out = out;
	this.comments = comments;
	this.compilationUnit = cu;
	this.formatPreferences = preferences;
	
	/* load doc comments */ {
		Object dc = getDocComments(compilationUnit);
		if (dc instanceof Map<?, ?>) {
			this.docComments = (Map) dc;
			this.docTable = null;
		} else if (dc instanceof DocCommentTable) {
			this.docComments = null;
			this.docTable = (DocCommentTable) dc;
		} else {
			this.docComments = null;
			this.docTable = null;
		}
	}
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:22,代码来源:PrettyPrinter.java

示例3: copyJavadoc

import com.sun.tools.javac.tree.DocCommentTable; //导入依赖的package包/类
static void copyJavadoc(JavacNode from, JCTree to, CopyJavadoc copyMode, Object dc) {
	DocCommentTable dct = (DocCommentTable) dc;
	Comment javadoc = dct.getComment(from.get());
	
	if (javadoc != null) {
		String[] filtered = copyMode.split(javadoc.getText());
		if (copyMode == CopyJavadoc.SETTER && shouldReturnThis(from)) {
			filtered[0] = addReturnsThisIfNeeded(filtered[0]);
		}
		dct.putComment(to, createJavadocComment(filtered[0], from));
		dct.putComment(from.get(), createJavadocComment(filtered[1], from));
	}
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:14,代码来源:JavacHandlerUtil.java

示例4: loadDocCommentsTable

import com.sun.tools.javac.tree.DocCommentTable; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void loadDocCommentsTable(Object dc) {
	if (dc instanceof Map<?, ?>) this.docComments = (Map) dc;
	else if (dc instanceof DocCommentTable) this.docTable = (DocCommentTable) dc;
}
 
开发者ID:mobmead,项目名称:EasyMPermission,代码行数:6,代码来源:PrettyCommentsPrinter.java


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