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

Java WildcardType类代码示例

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

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



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

示例1: tryToResolve

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
protected boolean tryToResolve(Type type) {
	boolean result = false;

	if (underResolution.getResolverMap().containsKey(type)) {
		result = true;
	} else {
		if (type.isPrimitiveType()) {
			result = tryToResolve((PrimitiveType)type);
		} else if (type.isQualifiedType()) {
			result = tryToResolve((QualifiedType)type);
		} else if (type.isArrayType()) {
			result = tryToResolve(((ArrayType)type).getElementType());
		} else if (type.isSimpleType()) {
			result = tryToResolve((SimpleType)type);
		} else if (type.isParameterizedType()) {
			result = tryToResolve((ParameterizedType)type);
		} else if (type.isWildcardType()) {
			result = tryToResolve((WildcardType)type);
		} else {
			CoreActivator.log(IStatus.INFO, "Type not handled " + type.toString());
		}
	}
	return result;
}
 
开发者ID:hmarchadour,项目名称:2uml,代码行数:25,代码来源:ResolverImpl.java


示例2: endVisit

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
@Override
public void endVisit(WildcardType node) {
	if (skipNode(node)) {
		return;
	}
	assignFlowInfo(node, node.getBound());
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:8,代码来源:FlowAnalyzer.java


示例3: visit

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
@Override
public boolean visit(WildcardType node) {
	this.fBuffer.append("?");//$NON-NLS-1$
	Type bound= node.getBound();
	if (bound != null) {
		if (node.isUpperBound()) {
			this.fBuffer.append(" extends ");//$NON-NLS-1$
		} else {
			this.fBuffer.append(" super ");//$NON-NLS-1$
		}
		bound.accept(this);
	}
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:15,代码来源:ASTFlattener.java


示例4: visit

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
public boolean visit(WildcardType node) {
	this.buffer.append("?");//$NON-NLS-1$
	Type bound = node.getBound();
	if (bound != null) {
		if (node.isUpperBound()) {
			this.buffer.append(" extends ");//$NON-NLS-1$
		} else {
			this.buffer.append(" super ");//$NON-NLS-1$
		}
		bound.accept(this);
	}
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:14,代码来源:NaiveASTFlattener.java


示例5: getBindingForWildCardType

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
public Binding getBindingForWildCardType(final WildcardType type) {
	Binding result = null;
	ITypeBinding binding = type.resolveBinding();
	if (binding == null) {
		if (this.logJDTBindingsIssues) {
			MoDiscoLogger.logWarning("*** WARNING : binding '" //$NON-NLS-1$
					+ type.toString() + "' unresolved.", JavaActivator //$NON-NLS-1$
					.getDefault());
		}
		result = new UnresolvedBinding(type.toString());
	} else {
		result = new Binding(binding.getQualifiedName());
	}
	return result;
}
 
开发者ID:markus1978,项目名称:srcrepo,代码行数:16,代码来源:JDTDelegateBindingFactory.java


示例6: visit

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
@Override
public boolean visit(WildcardType node) {
	//System.out.println("Found: " + node.getClass() + " " + node);
	//println();
	ASTNode parent = node.getParent();
	while (parent instanceof ParameterizedType) {
		parent = parent.getParent();
	}
	//if (parent instanceof FieldDeclaration) {
		print("JavaObject");
		return false;
	//}
	/*String ident = genId();
	additionalTemplateParams.add(ident);
	
	print(ident);
	if (node.getBound() != null) {
		StringWriter sw = new StringWriter();
		pushWriter(sw);
		node.getBound().accept(this);
		popWriter();
		String append;
		if (node.isUpperBound()) {
			append =  "is(" + ident + " : " + sw + ")";
		} else {
			append = "is(" + sw + " : " + ident + ")";
		}
		if (constraints.length() > 0) {
			constraints += " && " + append;
		} else {
			constraints = append;
		}
	}
	return false;*/
}
 
开发者ID:mrmonday,项目名称:j2d,代码行数:36,代码来源:J2dVisitor.java


示例7: getRootClassifier

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
@Override
public Classifier getRootClassifier() {
	Classifier rootClassifier;
	if (rootType.isParameterizedType()) {
		// TODO enhance this
		rootClassifier = resolverMap.get(((ParameterizedType)rootType).getType());
	} else if (rootType.isArrayType()) {
		rootClassifier = resolverMap.get(((ArrayType)rootType).getElementType());
	} else if (rootType.isWildcardType()) {
		rootClassifier = resolverMap.get(((WildcardType)rootType).getBound());
	} else {
		rootClassifier = resolverMap.get(rootType);
	}
	return rootClassifier;
}
 
开发者ID:hmarchadour,项目名称:2uml,代码行数:16,代码来源:ResolverResultImpl.java


示例8: endVisit

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void endVisit(WildcardType node) {
	logger.warn("Method endVisitWildcardType for " + node + " for " + node + " not implemented!");
	super.endVisit(node);
}
 
开发者ID:EvoSuite,项目名称:evosuite,代码行数:7,代码来源:LoggingVisitor.java


示例9: visit

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean visit(WildcardType node) {
	logger.warn("Method visitWildcardType for " + node + " not implemented!");
	return super.visit(node);
}
 
开发者ID:EvoSuite,项目名称:evosuite,代码行数:7,代码来源:LoggingVisitor.java


示例10: visit

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
@Override
public boolean visit(final WildcardType node) {
	return false;
}
 
开发者ID:Beagle-PSE,项目名称:Beagle,代码行数:5,代码来源:NotRecursingAstVisitor.java


示例11: visit

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
@Override
public boolean visit(final WildcardType node) {
	// not instrumentable, contains no instrumentable nodes
	return false;
}
 
开发者ID:Beagle-PSE,项目名称:Beagle,代码行数:6,代码来源:InstrumentableAstNodeLister.java


示例12: endVisit

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
@Override
public void endVisit(WildcardType node) {
	if (skipNode(node))
		return;
	assignFlowInfo(node, node.getBound());
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:FlowAnalyzer.java


示例13: visit

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
@Override
public boolean visit(WildcardType node) {
	if (node.subtreeMatch(fMatcher, fNodeToMatch))
		return matches(node);
	return super.visit(node);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:AstMatchingNodeFinder.java


示例14: endVisit

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
@Override
public void endVisit(WildcardType node) {
	endVisitNode(node);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:5,代码来源:GenericVisitor.java


示例15: visit

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
@Override
public boolean visit(WildcardType node) {
	return visitNode(node);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:5,代码来源:GenericVisitor.java


示例16: getFullyQualifiedName

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
private static void getFullyQualifiedName(Type type, StringBuffer buffer) {
	switch (type.getNodeType()) {
		case ASTNode.ARRAY_TYPE:
			ArrayType arrayType = (ArrayType) type;
			getFullyQualifiedName(arrayType.getElementType(), buffer);
			for (int i = 0, length = arrayType.getDimensions(); i < length; i++) {
				buffer.append('[');
				buffer.append(']');
			}
			break;
		case ASTNode.PARAMETERIZED_TYPE:
			ParameterizedType parameterizedType = (ParameterizedType) type;
			getFullyQualifiedName(parameterizedType.getType(), buffer);
			buffer.append('<');
			Iterator iterator = parameterizedType.typeArguments().iterator();
			boolean isFirst = true;
			while (iterator.hasNext()) {
				if (!isFirst)
					buffer.append(',');
				else
					isFirst = false;
				Type typeArgument = (Type) iterator.next();
				getFullyQualifiedName(typeArgument, buffer);
			}
			buffer.append('>');
			break;
		case ASTNode.PRIMITIVE_TYPE:
			buffer.append(((PrimitiveType) type).getPrimitiveTypeCode().toString());
			break;
		case ASTNode.QUALIFIED_TYPE:
			buffer.append(((QualifiedType) type).getName().getFullyQualifiedName());
			break;
		case ASTNode.SIMPLE_TYPE:
			buffer.append(((SimpleType) type).getName().getFullyQualifiedName());
			break;
		case ASTNode.WILDCARD_TYPE:
			buffer.append('?');
			WildcardType wildcardType = (WildcardType) type;
			Type bound = wildcardType.getBound();
			if (bound == null) return;
			if (wildcardType.isUpperBound()) {
				buffer.append(" extends "); //$NON-NLS-1$
			} else {
				buffer.append(" super "); //$NON-NLS-1$
			}
			getFullyQualifiedName(bound, buffer);
			break;
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:50,代码来源:Util.java


示例17: createType

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
private Type createType(String typeSig, AST ast) {
	int sigKind = Signature.getTypeSignatureKind(typeSig);
       switch (sigKind) {
           case Signature.BASE_TYPE_SIGNATURE:
               return ast.newPrimitiveType(PrimitiveType.toCode(Signature.toString(typeSig)));
           case Signature.ARRAY_TYPE_SIGNATURE:
               Type elementType = createType(Signature.getElementType(typeSig), ast);
               return ast.newArrayType(elementType, Signature.getArrayCount(typeSig));
           case Signature.CLASS_TYPE_SIGNATURE:
               String erasureSig = Signature.getTypeErasure(typeSig);

               String erasureName = Signature.toString(erasureSig);
               if (erasureSig.charAt(0) == Signature.C_RESOLVED) {
                   erasureName = addImport(erasureName);
               }
               
               Type baseType= ast.newSimpleType(ast.newName(erasureName));
               String[] typeArguments = Signature.getTypeArguments(typeSig);
               if (typeArguments.length > 0) {
                   ParameterizedType type = ast.newParameterizedType(baseType);
                   List argNodes = type.typeArguments();
                   for (int i = 0; i < typeArguments.length; i++) {
                       String curr = typeArguments[i];
                       if (containsNestedCapture(curr)) {
                           argNodes.add(ast.newWildcardType());
                       } else {
                           argNodes.add(createType(curr, ast));
                       }
                   }
                   return type;
               }
               return baseType;
           case Signature.TYPE_VARIABLE_SIGNATURE:
               return ast.newSimpleType(ast.newSimpleName(Signature.toString(typeSig)));
           case Signature.WILDCARD_TYPE_SIGNATURE:
               WildcardType wildcardType= ast.newWildcardType();
               char ch = typeSig.charAt(0);
               if (ch != Signature.C_STAR) {
                   Type bound= createType(typeSig.substring(1), ast);
                   wildcardType.setBound(bound, ch == Signature.C_EXTENDS);
               }
               return wildcardType;
           case Signature.CAPTURE_TYPE_SIGNATURE:
               return createType(typeSig.substring(1), ast);
       }
       
       return ast.newSimpleType(ast.newName("java.lang.Object"));
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:49,代码来源:JavaStatementPostfixContext.java


示例18: visit

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
@Override
public boolean visit(WildcardType node) {
	return visit((Type)node);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:5,代码来源:HierarchicalASTVisitor.java


示例19: endVisit

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
@Override
public void endVisit(WildcardType node) {
	endVisit((Type)node);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:5,代码来源:HierarchicalASTVisitor.java


示例20: visit

import org.eclipse.jdt.core.dom.WildcardType; //导入依赖的package包/类
@Override
public boolean visit(final WildcardType node) {
	return this.internalVisit(node);
}
 
开发者ID:awltech,项目名称:eclipse-i18ntools,代码行数:5,代码来源:ASTNodeFinder.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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