• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java InitializerDeclaration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: visit

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
@Override
  public JCTree visit(final InitializerDeclaration n, final Object arg) {
      //ARG0: long flags
      long arg0 = ModifierSet.STATIC;

       /* TODO - Ignoring javadoc 
if (n.getJavaDoc() != null) {
      JCTree result = n.getJavaDoc().accept(this, arg);
}
       */

      //ARG1: List<JCStatement> stats
      List<JCStatement> arg1 = List.<JCStatement>nil();
      if (n.getBlock().getStmts() != null) {
          for (final Statement s : n.getBlock().getStmts()) {
              arg1 = arg1.append((JCStatement) s.accept(this, arg));
          }
      }
      return new AJCBlock(make.Block(arg0, arg1), ((n.getComment() != null) ? n.getComment().getContent() : null));
  }
 
开发者ID:pcgomes,项目名称:javaparser2jctree,代码行数:21,代码来源:JavaParser2JCTree.java


示例2: visit

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
@Override
public void visit(final InitializerDeclaration n, final Object arg) {
    printer.printLn("InitializerDeclaration");
    printJavaComment(n.getComment(), arg);
    printJavadoc(n.getJavaDoc(), arg);
    if (n.isStatic()) {
        printer.print("static ");
    }
    n.getBlock().accept(this, arg);
}
 
开发者ID:pcgomes,项目名称:javaparser2jctree,代码行数:11,代码来源:ASTDumpVisitor.java


示例3: doMerge

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
@Override public InitializerDeclaration doMerge(InitializerDeclaration first, InitializerDeclaration second) {

        InitializerDeclaration id = new InitializerDeclaration();

        id.setJavaDoc(mergeSingle(first.getJavaDoc(),second.getJavaDoc()));
        id.setStatic(first.isStatic());
        id.setAnnotations(mergeCollections(first.getAnnotations(),second.getAnnotations()));
        id.setBlock(mergeSingle(first.getBlock(),second.getBlock()));

        return id;
    }
 
开发者ID:beihaifeiwu,项目名称:dolphin,代码行数:12,代码来源:InitializerDeclarationMerger.java


示例4: visit

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
@Override public Boolean visit(final InitializerDeclaration n1, final Node arg) {
	final InitializerDeclaration n2 = (InitializerDeclaration) arg;

	if (!nodeEquals(n1.getBlock(), n2.getBlock())) {
		return Boolean.FALSE;
	}

	if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) {
		return Boolean.FALSE;
	}

	return Boolean.TRUE;
}
 
开发者ID:plum-umd,项目名称:java-sketch,代码行数:14,代码来源:EqualsVisitor.java


示例5: visit

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
@Override
public Node visit(InitializerDeclaration _n, Object _arg) {
	JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg);
	BlockStmt block = cloneNodes(_n.getBlock(), _arg);
	Comment comment = cloneNodes(_n.getComment(), _arg);

	InitializerDeclaration r = new InitializerDeclaration(
			_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
			 _n.isStatic(), block
	);
	r.setComment(comment);
	return r;
}
 
开发者ID:plum-umd,项目名称:java-sketch,代码行数:14,代码来源:CloneVisitor.java


示例6: visit

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
@Override public void visit(final InitializerDeclaration n, final Object arg) {
printJavaComment(n.getComment(), arg);
printJavadoc(n.getJavaDoc(), arg);
if (n.isStatic()) {
    printer.print("static ");
}
n.getBlock().accept(this, arg);
   }
 
开发者ID:plum-umd,项目名称:java-sketch,代码行数:9,代码来源:DumpVisitor.java


示例7: visit

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
@Override public void visit(final InitializerDeclaration n, final A arg) {
	visitComment(n.getComment(), arg);
	if (n.getJavaDoc() != null) {
		n.getJavaDoc().accept(this, arg);
	}
	n.getBlock().accept(this, arg);
}
 
开发者ID:plum-umd,项目名称:java-sketch,代码行数:8,代码来源:VoidVisitorAdapter.java


示例8: visit

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
@Override public void visit(final InitializerDeclaration n, final A arg) {
    jw.write(n); 
    visitComment(n.getComment(), arg);
    if (n.getJavaDoc() != null) {
        n.getJavaDoc().accept(this, arg);
    }
    n.getBlock().accept(this, arg);
}
 
开发者ID:plum-umd,项目名称:java-sketch,代码行数:9,代码来源:JsonVisitorAdapter.java


示例9: visit

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
@Override public Node visit(final InitializerDeclaration n, final A arg) {
	if (n.getJavaDoc() != null) {
		n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg));
	}
	n.setBlock((BlockStmt) n.getBlock().accept(this, arg));
	return n;
}
 
开发者ID:plum-umd,项目名称:java-sketch,代码行数:8,代码来源:ModifierVisitorAdapter.java


示例10: visit

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
@Override public Boolean visit(final InitializerDeclaration n1, final Node arg) {
	final InitializerDeclaration n2 = (InitializerDeclaration) arg;

	if (!nodeEquals(n1.getBlock(), n2.getBlock())) {
		return false;
	}

	if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) {
		return false;
	}

	return true;
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:14,代码来源:EqualsVisitor.java


示例11: visit

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
@Override
public Node visit(InitializerDeclaration _n, Object _arg) {
	BlockStmt block = cloneNodes(_n.getBlock(), _arg);
	Comment comment = cloneNodes(_n.getComment(), _arg);

	InitializerDeclaration r = new InitializerDeclaration(
			_n.getRange(),
			 _n.isStatic(), block
	);
	r.setComment(comment);
	return r;
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:13,代码来源:CloneVisitor.java


示例12: addInitializer

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
default BlockStmt addInitializer() {
    BlockStmt block = new BlockStmt();
    InitializerDeclaration initializerDeclaration = new InitializerDeclaration(false, block);
    getMembers().add(initializerDeclaration);
    initializerDeclaration.setParentNode((Node) this);
    return block;
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:8,代码来源:NodeWithMembers.java


示例13: addStaticInitializer

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
default BlockStmt addStaticInitializer() {
    BlockStmt block = new BlockStmt();
    InitializerDeclaration initializerDeclaration = new InitializerDeclaration(true, block);
    getMembers().add(initializerDeclaration);
    initializerDeclaration.setParentNode((Node) this);
    return block;
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:8,代码来源:NodeWithMembers.java


示例14: visit

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
@Override public void visit(final InitializerDeclaration n, final Object arg) {
	printJavaComment(n.getComment(), arg);
	printJavadoc(n.getJavaDoc(), arg);
	if (n.isStatic()) {
		printer.print("static ");
	}
	n.getBlock().accept(this, arg);
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:9,代码来源:DumpVisitor.java


示例15: visit

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public Node visit(final InitializerDeclaration expr, final Context ctx) {
  /**
   * extends + initializer
   *
   * class App extends Jooby {
   * {
   * ...
   * }
   * }
   */
  Node node = expr.getParentNode();
  if (node instanceof ClassOrInterfaceDeclaration) {
    List<ClassOrInterfaceType> extendList = ((ClassOrInterfaceDeclaration) node).getExtends();
    if (extendList.size() > 0) {
      Class type = (Class) extendList.get(0).accept(new TypeCollector(), ctx);
      while (type != Object.class) {
        if (type.getTypeName().equals("org.jooby.Jooby")) {
          return expr;
        }
        type = type.getSuperclass();
      }
    }
  }
  return null;
}
 
开发者ID:jooby-project,项目名称:jooby,代码行数:28,代码来源:AppCollector.java


示例16: visit

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
@Override
public Node visit(
    InitializerDeclaration n, Map<Node, Node> arg
) {
  if (arg.containsKey(n)) {
    return arg.get(n);
  }
  return super.visit(n, arg);
}
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:10,代码来源:ConcreteModifierVisitor.java


示例17: removeStaticFieldsAndInitialisers

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
private static void removeStaticFieldsAndInitialisers(ClassOrInterfaceDeclaration node) {
    // Remove all the static initialisers
    for (InitializerDeclaration child : node.getChildNodesByType(InitializerDeclaration.class)) {
        child.remove();
    }

    // Remove all static fields
    for (FieldDeclaration field : node.getFields()) {
        if (field.getModifiers().contains(Modifier.STATIC)) {
            field.remove();
            continue;
        }
    }
}
 
开发者ID:JCTools,项目名称:JCTools,代码行数:15,代码来源:JavaParsingAtomicArrayQueueGenerator.java


示例18: visit

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
@Override
public void visit(InitializerDeclaration n, Script arg) {
}
 
开发者ID:Nosorog,项目名称:nosorog-core,代码行数:4,代码来源:NoOpVisitor.java


示例19: visit

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
@Override public void visit(final InitializerDeclaration n, final A arg) {
	visitComment(n.getComment(), arg);
	n.getBlock().accept(this, arg);
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:5,代码来源:VoidVisitorAdapter.java


示例20: visit

import com.github.javaparser.ast.body.InitializerDeclaration; //导入依赖的package包/类
@Override public Node visit(final InitializerDeclaration n, final A arg) {
	visitComment(n, arg);
	n.setBlock((BlockStmt) n.getBlock().accept(this, arg));
	return n;
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:6,代码来源:ModifierVisitorAdapter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FifoSchedulerInfo类代码示例发布时间:2022-05-22
下一篇:
Java CSSNorm类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap