本文整理匯總了Java中com.github.javaparser.ast.body.ClassOrInterfaceDeclaration.setComment方法的典型用法代碼示例。如果您正苦於以下問題:Java ClassOrInterfaceDeclaration.setComment方法的具體用法?Java ClassOrInterfaceDeclaration.setComment怎麽用?Java ClassOrInterfaceDeclaration.setComment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.github.javaparser.ast.body.ClassOrInterfaceDeclaration
的用法示例。
在下文中一共展示了ClassOrInterfaceDeclaration.setComment方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: visit
import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; //導入方法依賴的package包/類
@Override
public Node visit(ClassOrInterfaceDeclaration _n, Object _arg) {
List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
List<TypeParameter> typeParameters = visit(_n.getTypeParameters(), _arg);
List<ClassOrInterfaceType> extendsList = visit(_n.getExtends(), _arg);
List<ClassOrInterfaceType> implementsList = visit(_n.getImplements(), _arg);
List<BodyDeclaration<?>> members = visit(_n.getMembers(), _arg);
Comment comment = cloneNodes(_n.getComment(), _arg);
ClassOrInterfaceDeclaration r = new ClassOrInterfaceDeclaration(
_n.getRange(),
_n.getModifiers(), annotations, _n.isInterface(), _n.getName(), typeParameters, extendsList, implementsList, members
);
r.setComment(comment);
return r;
}
示例2: visit
import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; //導入方法依賴的package包/類
@Override
public Node visit(ClassOrInterfaceDeclaration _n, Object _arg) {
JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg);
List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
List<TypeParameter> typeParameters = visit(_n.getTypeParameters(), _arg);
List<ClassOrInterfaceType> extendsList = visit(_n.getExtends(), _arg);
List<ClassOrInterfaceType> implementsList = visit(_n.getImplements(), _arg);
List<BodyDeclaration> members = visit(_n.getMembers(), _arg);
Comment comment = cloneNodes(_n.getComment(), _arg);
ClassOrInterfaceDeclaration r = new ClassOrInterfaceDeclaration(
_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
_n.getModifiers(), annotations, _n.isInterface(), _n.getName(), typeParameters, extendsList, implementsList, members
);
r.setComment(comment);
return r;
}
示例3: getClassDeclaration
import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; //導入方法依賴的package包/類
/**
* Generates the class definition for the Operation
*/
private ClassOrInterfaceDeclaration getClassDeclaration() {
ClassOrInterfaceDeclaration operation = new ClassOrInterfaceDeclaration(ModifierSet.PUBLIC,
false, getOperationClassName());
operation.setImplements(Collections.singletonList(iOperation));
operation.setJavaDoc(javadocComment);
operation.setComment(new BlockComment(
" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n"
+ " * ===== THIS CODE HAS BEEN DYNAMICALLY GENERATED! DO NOT MODIFY! ==== *\n"
+ " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * "));
operation.setMembers(socketHintDeclarationCollection
.getAllSocketHints()
.stream()
.map(SocketHintDeclaration::getDeclaration)
.filter(declaration -> declaration != null)
.collect(Collectors.toList()));
ASTHelper.addMember(operation, getNameMethod());
ASTHelper.addMember(operation, getDescriptionMethod());
ASTHelper.addMember(operation, getCategoryMethod());
ASTHelper.addMember(operation, getCreateInputSocketsMethod());
ASTHelper.addMember(operation, getCreateOutputSocketsMethod());
ASTHelper.addMember(operation, getPerformMethod());
return operation;
}