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


Java ConstructorDeclaration.getTypeParameters方法代码示例

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


在下文中一共展示了ConstructorDeclaration.getTypeParameters方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

import com.github.javaparser.ast.body.ConstructorDeclaration; //导入方法依赖的package包/类
@Override public void visit(final ConstructorDeclaration n, final A arg) {
	visitComment(n.getComment(), arg);
	visitAnnotations(n, arg);
	if (n.getTypeParameters() != null) {
		for (final TypeParameter t : n.getTypeParameters()) {
			t.accept(this, arg);
		}
	}
	n.getNameExpr().accept(this, arg);
	if (n.getParameters() != null) {
		for (final Parameter p : n.getParameters()) {
			p.accept(this, arg);
		}
	}
	if (n.getThrows() != null) {
		for (final ReferenceType name : n.getThrows()) {
			name.accept(this, arg);
		}
	}
	n.getBody().accept(this, arg);
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:22,代码来源:VoidVisitorAdapter.java

示例2: visit

import com.github.javaparser.ast.body.ConstructorDeclaration; //导入方法依赖的package包/类
@Override
public void visit(final ConstructorDeclaration n, final Object arg) {
    printer.printLn("ConstructorDeclaration");
    printJavaComment(n.getComment(), arg);
    printJavadoc(n.getJavaDoc(), arg);
    printMemberAnnotations(n.getAnnotations(), arg);
    printModifiers(n.getModifiers());

    printTypeParameters(n.getTypeParameters(), arg);
    if (n.getTypeParameters() != null) {
        printer.print(" ");
    }
    printer.print(n.getName());

    printer.print("(");
    if (n.getParameters() != null) {
        for (final Iterator<Parameter> i = n.getParameters().iterator(); i.hasNext(); ) {
            final Parameter p = i.next();
            p.accept(this, arg);
            if (i.hasNext()) {
                printer.print(", ");
            }
        }
    }
    printer.print(")");

    if (!isNullOrEmpty(n.getThrows())) {
        printer.print(" throws ");
        for (final Iterator<NameExpr> i = n.getThrows().iterator(); i.hasNext(); ) {
            final NameExpr name = i.next();
            name.accept(this, arg);
            if (i.hasNext()) {
                printer.print(", ");
            }
        }
    }
    printer.print(" ");
    n.getBlock().accept(this, arg);
}
 
开发者ID:pcgomes,项目名称:javaparser2jctree,代码行数:40,代码来源:ASTDumpVisitor.java

示例3: visit

import com.github.javaparser.ast.body.ConstructorDeclaration; //导入方法依赖的package包/类
@Override public void visit(final ConstructorDeclaration n, final A arg) {
	visitComment(n.getComment(), arg);
	if (n.getJavaDoc() != null) {
		n.getJavaDoc().accept(this, arg);
	}
	if (n.getAnnotations() != null) {
		for (final AnnotationExpr a : n.getAnnotations()) {
			a.accept(this, arg);
		}
	}
	if (n.getTypeParameters() != null) {
		for (final TypeParameter t : n.getTypeParameters()) {
			t.accept(this, arg);
		}
	}
	if (n.getParameters() != null) {
		for (final Parameter p : n.getParameters()) {
			p.accept(this, arg);
		}
	}
	if (n.getThrows() != null) {
		for (final NameExpr name : n.getThrows()) {
			name.accept(this, arg);
		}
	}
	n.getBlock().accept(this, arg);
}
 
开发者ID:plum-umd,项目名称:java-sketch,代码行数:28,代码来源:VoidVisitorAdapter.java

示例4: visit

import com.github.javaparser.ast.body.ConstructorDeclaration; //导入方法依赖的package包/类
@Override public void visit(final ConstructorDeclaration n, final A arg) {
    jw.write(n); 
    visitComment(n.getComment(), arg);
    if (n.getJavaDoc() != null) {
        n.getJavaDoc().accept(this, arg);
    }
    if (n.getAnnotations() != null) {
        for (final AnnotationExpr a : n.getAnnotations()) {
            a.accept(this, arg);
        }
    }
    if (n.getTypeParameters() != null) {
        for (final TypeParameter t : n.getTypeParameters()) {
            t.accept(this, arg);
        }
    }
    if (n.getParameters() != null) {
        for (final Parameter p : n.getParameters()) {
            p.accept(this, arg);
        }
    }
    if (n.getThrows() != null) {
        for (final NameExpr name : n.getThrows()) {
            name.accept(this, arg);
        }
    }
    n.getBlock().accept(this, arg);
}
 
开发者ID:plum-umd,项目名称:java-sketch,代码行数:29,代码来源:JsonVisitorAdapter.java

示例5: visit

import com.github.javaparser.ast.body.ConstructorDeclaration; //导入方法依赖的package包/类
@Override public Node visit(final ConstructorDeclaration 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<TypeParameter> typeParameters = n.getTypeParameters();
	if (typeParameters != null) {
		for (int i = 0; i < typeParameters.size(); i++) {
			typeParameters.set(i, (TypeParameter) typeParameters.get(i).accept(this, arg));
		}
		removeNulls(typeParameters);
	}
	final List<Parameter> parameters = n.getParameters();
	if (parameters != null) {
		for (int i = 0; i < parameters.size(); i++) {
			parameters.set(i, (Parameter) parameters.get(i).accept(this, arg));
		}
		removeNulls(parameters);
	}
	final List<NameExpr> throwz = n.getThrows();
	if (throwz != null) {
		for (int i = 0; i < throwz.size(); i++) {
			throwz.set(i, (NameExpr) throwz.get(i).accept(this, arg));
		}
		removeNulls(throwz);
	}
	n.setBlock((BlockStmt) n.getBlock().accept(this, arg));
	return n;
}
 
开发者ID:plum-umd,项目名称:java-sketch,代码行数:36,代码来源:ModifierVisitorAdapter.java

示例6: visit

import com.github.javaparser.ast.body.ConstructorDeclaration; //导入方法依赖的package包/类
@Override public Node visit(final ConstructorDeclaration n, final A arg) {
	visitComment(n, 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<TypeParameter> typeParameters = n.getTypeParameters();
	if (typeParameters != null) {
		for (int i = 0; i < typeParameters.size(); i++) {
			typeParameters.set(i, (TypeParameter) typeParameters.get(i).accept(this, arg));
		}
		removeNulls(typeParameters);
	}
	final List<Parameter> parameters = n.getParameters();
	if (parameters != null) {
		for (int i = 0; i < parameters.size(); i++) {
			parameters.set(i, (Parameter) parameters.get(i).accept(this, arg));
		}
		removeNulls(parameters);
	}
	final List<ReferenceType> throwz = n.getThrows();
	if (throwz != null) {
		for (int i = 0; i < throwz.size(); i++) {
			throwz.set(i, (ReferenceType) throwz.get(i).accept(this, arg));
		}
		removeNulls(throwz);
	}
	n.setBody((BlockStmt) n.getBody().accept(this, arg));
	return n;
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:34,代码来源:ModifierVisitorAdapter.java

示例7: visit

import com.github.javaparser.ast.body.ConstructorDeclaration; //导入方法依赖的package包/类
@Override public void visit(final ConstructorDeclaration n, final Object arg) {
	printJavaComment(n.getComment(), arg);
	printJavadoc(n.getJavaDoc(), arg);
	printMemberAnnotations(n.getAnnotations(), arg);
	printModifiers(n.getModifiers());

	printTypeParameters(n.getTypeParameters(), arg);
	if (n.getTypeParameters() != null) {
		printer.print(" ");
	}
	printer.print(n.getName());

	printer.print("(");
	if (n.getParameters() != null) {
		for (final Iterator<Parameter> i = n.getParameters().iterator(); i.hasNext();) {
			final Parameter p = i.next();
			p.accept(this, arg);
			if (i.hasNext()) {
				printer.print(", ");
			}
		}
	}
	printer.print(")");

	if (!isNullOrEmpty(n.getThrows())) {
		printer.print(" throws ");
		for (final Iterator<NameExpr> i = n.getThrows().iterator(); i.hasNext();) {
			final NameExpr name = i.next();
			name.accept(this, arg);
			if (i.hasNext()) {
				printer.print(", ");
			}
		}
	}
	printer.print(" ");
	n.getBlock().accept(this, arg);
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:38,代码来源:DumpVisitor.java

示例8: visit

import com.github.javaparser.ast.body.ConstructorDeclaration; //导入方法依赖的package包/类
@Override
  public JCTree visit(final ConstructorDeclaration n, final Object arg) {
      //ARG0: JCModifiers mods
      JCModifiers arg0;

      // Must convert internal modifiers
      long jcmodifier = setJCTreeModifiers(n.getModifiers(), 0);
      arg0 = new AJCModifiers(make.Modifiers(jcmodifier), null);

      //ARG1: Name name
      // Names already has the name for this
      Name arg1 = names.names.init;

      //ARG2: JCExpression restype
      JCExpression arg2 = null;

      //ARG3: List<JCTypeParameter> typaramsList
      List<JCTypeParameter> arg3 = List.<JCTypeParameter>nil();
      if (n.getTypeParameters() != null) {
          for (final TypeParameter t : n.getTypeParameters()) {
              arg3 = arg3.append((JCTypeParameter) t.accept(this, arg));
          }
      }

      //ARG4: List<JCVariableDecl> params
      List<JCVariableDecl> arg4 = List.<JCVariableDecl>nil();
      if (n.getParameters() != null) {
          for (final Parameter p : n.getParameters()) {
              arg4 = arg4.append((JCVariableDecl) p.accept(this, arg));
          }
      }

      //ARG5: List<JCExpression> thrown
      List<JCExpression> arg5 = List.<JCExpression>nil();
      if (n.getThrows() != null) {
          for (final NameExpr name : n.getThrows()) {
              arg5 = arg5.append((JCExpression) name.accept(this, arg));
          }
      }

      //ARG6: JCBlock body
      JCBlock arg6 = (JCBlock) n.getBlock().accept(this, arg);

      //ARG7: JCExpression defaultValue
      JCExpression arg7 = null;

       /* TODO - Javadoc and annotations not supported
if (n.getJavaDoc() != null) {
   JCTree result = n.getJavaDoc().accept(this, arg);
}
if (n.getAnnotations() != null) {
   for (final AnnotationExpr a : n.getAnnotations()) {
      JCTree result = a.accept(this, arg);
   }
}
       */

      return new AJCMethodDecl(make.MethodDef(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7), ((n.getComment() != null) ? n.getComment().getContent() : null));
  }
 
开发者ID:pcgomes,项目名称:javaparser2jctree,代码行数:60,代码来源:JavaParser2JCTree.java


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