當前位置: 首頁>>代碼示例>>Java>>正文


Java ClassOrInterfaceDeclaration.setComment方法代碼示例

本文整理匯總了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;
}
 
開發者ID:javaparser,項目名稱:javasymbolsolver,代碼行數:17,代碼來源:CloneVisitor.java

示例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;
}
 
開發者ID:plum-umd,項目名稱:java-sketch,代碼行數:18,代碼來源:CloneVisitor.java

示例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;
}
 
開發者ID:WPIRoboticsProjects,項目名稱:GRIP,代碼行數:27,代碼來源:Operation.java


注:本文中的com.github.javaparser.ast.body.ClassOrInterfaceDeclaration.setComment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。