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


Java MultiTypeParameter.getTypes方法代码示例

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


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

示例1: visit

import com.github.javaparser.ast.body.MultiTypeParameter; //导入方法依赖的package包/类
@Override
  public JCTree visit(final MultiTypeParameter n, final Object arg) {
      //ARG0: JCModifiers mods
      JCModifiers arg0;
      long jcmodifier = setJCTreeModifiers(n.getModifiers(), 0);
      arg0 = new AJCModifiers(make.Modifiers(jcmodifier), null);

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

      //ARG1: Name name
      Name arg1 = names.fromString(n.getId().getName());

      //ARG2: JCExpression vartype
      JCExpression arg2;
      if (n.getTypes().size() > 1) {
          List<JCExpression> typelist = List.<JCExpression>nil();
          for (final com.github.javaparser.ast.type.Type type : n.getTypes()) {
              typelist = typelist.append((JCExpression) type.accept(this, arg));
          }
          arg2 = new AJCTypeUnion(make.TypeUnion(typelist), null);
      } else {
          // Get the single element
          arg2 = (JCExpression) n.getTypes().get(0).accept(this, arg);
      }


      //ARG3: JCExpression init
      JCExpression arg3 = null;

      return new AJCVariableDecl(make.VarDef(arg0, arg1, arg2, arg3), ((n.getComment() != null) ? n.getComment().getContent() : null));
  }
 
开发者ID:pcgomes,项目名称:javaparser2jctree,代码行数:38,代码来源:JavaParser2JCTree.java

示例2: doIsEquals

import com.github.javaparser.ast.body.MultiTypeParameter; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean doIsEquals(MultiTypeParameter first, MultiTypeParameter second) {

    if(!getMerger(VariableDeclaratorId.class).isEquals(first.getId(),second.getId())) return false;

    List<Type> firstTypes = first.getTypes();
    List<Type> secondTypes = second.getTypes();

    if(firstTypes == null) return secondTypes == null;
    if(secondTypes == null) return false;

    if(firstTypes.size() != secondTypes.size()) return false;

    for(Type ft : firstTypes){
        boolean found = false;
        AbstractMerger merger = getMerger(ft.getClass());
        for(Type st : secondTypes){
            if(merger.isEquals(ft, st)){
                found = true; break;
            }
        }
        if(!found) return false;
    }

    return true;
}
 
开发者ID:beihaifeiwu,项目名称:dolphin,代码行数:28,代码来源:MultiTypeParameterMerger.java

示例3: visit

import com.github.javaparser.ast.body.MultiTypeParameter; //导入方法依赖的package包/类
@Override
public Node visit(CatchClause _n, Object _arg) {
	MultiTypeParameter except = cloneNodes(_n.getExcept(), _arg);
	BlockStmt catchBlock = cloneNodes(_n.getCatchBlock(), _arg);
	Comment comment = cloneNodes(_n.getComment(), _arg);

	CatchClause r = new CatchClause(
			_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
			except.getModifiers(), except.getAnnotations(), except.getTypes(), except.getId(), catchBlock
	);
	r.setComment(comment);
	return r;
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:14,代码来源:CloneVisitor.java

示例4: visit

import com.github.javaparser.ast.body.MultiTypeParameter; //导入方法依赖的package包/类
@Override public void visit(final MultiTypeParameter n, final A arg) {
	visitComment(n.getComment(), arg);
	if (n.getAnnotations() != null) {
		for (final AnnotationExpr a : n.getAnnotations()) {
			a.accept(this, arg);
		}
	}
	for (final Type type : n.getTypes()) {
		type.accept(this, arg);
	}
	n.getId().accept(this, arg);
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:13,代码来源:VoidVisitorAdapter.java

示例5: visit

import com.github.javaparser.ast.body.MultiTypeParameter; //导入方法依赖的package包/类
@Override public Node visit(MultiTypeParameter n, A arg) {
	visit((BaseParameter) n, arg);
	List<Type> types = new LinkedList<Type>();
	for (Type type : n.getTypes()) {
		types.add((Type) type.accept(this, arg));
	}
    n.setTypes(types);
    return n;
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:10,代码来源:ModifierVisitorAdapter.java


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