本文整理汇总了Java中com.github.javaparser.ast.comments.JavadocComment类的典型用法代码示例。如果您正苦于以下问题:Java JavadocComment类的具体用法?Java JavadocComment怎么用?Java JavadocComment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JavadocComment类属于com.github.javaparser.ast.comments包,在下文中一共展示了JavadocComment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import com.github.javaparser.ast.comments.JavadocComment; //导入依赖的package包/类
@Override
public Node visit(EnumDeclaration _n, Object _arg) {
JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg);
List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
List<ClassOrInterfaceType> implementsList = visit(_n.getImplements(), _arg);
List<EnumConstantDeclaration> entries = visit(_n.getEntries(), _arg);
List<BodyDeclaration> members = visit(_n.getMembers(), _arg);
Comment comment = cloneNodes(_n.getComment(), _arg);
EnumDeclaration r = new EnumDeclaration(
_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
_n.getModifiers(), annotations, _n.getName(), implementsList, entries, members
);
r.setComment(comment);
return r;
}
示例2: visit
import com.github.javaparser.ast.comments.JavadocComment; //导入依赖的package包/类
@Override public Node visit(final AnnotationDeclaration n, final A arg) {
if (n.getJavaDoc() != null) {
n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg));
}
final List<AnnotationExpr> annotations = n.getAnnotations();
if (annotations != null) {
for (int i = 0; i < annotations.size(); i++) {
annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg));
}
removeNulls(annotations);
}
final List<BodyDeclaration> members = n.getMembers();
if (members != null) {
for (int i = 0; i < members.size(); i++) {
members.set(i, (BodyDeclaration) members.get(i).accept(this, arg));
}
removeNulls(members);
}
return n;
}
示例3: visit
import com.github.javaparser.ast.comments.JavadocComment; //导入依赖的package包/类
@Override public Node visit(final FieldDeclaration n, final A arg) {
if (n.getJavaDoc() != null) {
n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg));
}
final List<AnnotationExpr> annotations = n.getAnnotations();
if (annotations != null) {
for (int i = 0; i < annotations.size(); i++) {
annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg));
}
removeNulls(annotations);
}
n.setType((Type) n.getType().accept(this, arg));
final List<VariableDeclarator> variables = n.getVariables();
for (int i = 0; i < variables.size(); i++) {
variables.set(i, (VariableDeclarator) variables.get(i).accept(this, arg));
}
removeNulls(variables);
return n;
}
示例4: visit
import com.github.javaparser.ast.comments.JavadocComment; //导入依赖的package包/类
@Override
public void visit(JavadocComment n, Void arg) {
if (configuration.isIgnoreComments()) return;
printer.print("/**");
printMultiLine(n.getContent());
printer.println("*/");
}
示例5: visit
import com.github.javaparser.ast.comments.JavadocComment; //导入依赖的package包/类
@Override
public void visit(final ClassOrInterfaceDeclaration n, final Void arg) {
extnds = n.getExtends().toString();
final Comment c = n.getComment();
if (c instanceof JavadocComment) {
javadoc = c.toString();
}
super.visit(n, arg);
}
示例6: visit
import com.github.javaparser.ast.comments.JavadocComment; //导入依赖的package包/类
@Override
public void visit(final MethodDeclaration n, final Void arg) {
final String signature = n.getDeclarationAsString(false, false);
methods.add(signature);
final Comment c = n.getComment();
if (c instanceof JavadocComment) {
methodJavadoc.put(signature, c.toString());
}
super.visit(n, arg);
}
示例7: description
import com.github.javaparser.ast.comments.JavadocComment; //导入依赖的package包/类
private static String description(JavadocComment comment) {
if (comment == null) {
return "";
}
String[] lines = comment.toString().split("\n");
return stream(lines).skip(1L).limit(lines.length - 2L).map(WikiGenerator::removeStars).collect(joining("\n", "", "\n"));
}
示例8: visit
import com.github.javaparser.ast.comments.JavadocComment; //导入依赖的package包/类
@Override
public void visit(final JavadocComment n, final Object arg) {
printer.printLn("JavadocComment");
printer.print("/**");
printer.print(n.getContent());
printer.printLn("*/");
}
示例9: visit
import com.github.javaparser.ast.comments.JavadocComment; //导入依赖的package包/类
@Override
public JCTree visit(final JavadocComment n, final Object arg) {
/* TODO - Not processing Javadoc
return new AJCJavadocComment( make.JavadocComment( ), ( (n.getComment()!=null)?n.getComment().getContent():null ) );
*/
System.err.println("Assigning null at:" + Thread.currentThread().getStackTrace()[1].getLineNumber());
return null;
}
示例10: doMerge
import com.github.javaparser.ast.comments.JavadocComment; //导入依赖的package包/类
@Override
public JavadocComment doMerge(JavadocComment first, JavadocComment second) {
JavadocComment comment = new JavadocComment();
if(first.getContent().length() > second.getContent().length()){
comment.setContent(first.getContent());
copyPosition(first,comment);
}else {
comment.setContent(second.getContent());
copyPosition(second,comment);
}
return comment;
}
示例11: Operation
import com.github.javaparser.ast.comments.JavadocComment; //导入依赖的package包/类
/**
* Constructs an Operation
*
* @param collector The collection of default values.
* @param definedMethod The method that this operation is wrapping
* @param className The name of the class being generated
*/
public Operation(DefaultValueCollector collector, DefinedMethod definedMethod, String className) {
this.definedMethod = definedMethod;
this.packageDec = new PackageDeclaration(new NameExpr("edu.wpi.grip.generated." + className));
this.operationParams = this.definedMethod.getFinalizedParamTypes(collector);
this.socketHintDeclarationCollection = new SocketHintDeclarationCollection(collector, this
.operationParams);
this.javadocComment = new JavadocComment(" Operation to call " +
"{@link " + className + "#" + definedMethod.getMethodName() + "} ");
}
示例12: getJavaDoc
import com.github.javaparser.ast.comments.JavadocComment; //导入依赖的package包/类
@Override
public JavadocComment getJavaDoc() {
if(getComment() instanceof JavadocComment){
return (JavadocComment) getComment();
}
return null;
}
示例13: getJavaDoc
import com.github.javaparser.ast.comments.JavadocComment; //导入依赖的package包/类
@Override
public JavadocComment getJavaDoc() {
if(getComment() instanceof JavadocComment){
return (JavadocComment) getComment();
}
return null;
}
示例14: getJavaDoc
import com.github.javaparser.ast.comments.JavadocComment; //导入依赖的package包/类
@Override
public JavadocComment getJavaDoc() {
if (getComment() instanceof JavadocComment) {
return (JavadocComment) getComment();
}
return null;
}
示例15: visit
import com.github.javaparser.ast.comments.JavadocComment; //导入依赖的package包/类
@Override public Boolean visit(final JavadocComment n1, final Node arg) {
final JavadocComment n2 = (JavadocComment) arg;
if (!objEquals(n1.getContent(), n2.getContent())) {
return false;
}
return true;
}