本文整理汇总了Java中org.eclipse.jdt.core.dom.WildcardType.isUpperBound方法的典型用法代码示例。如果您正苦于以下问题:Java WildcardType.isUpperBound方法的具体用法?Java WildcardType.isUpperBound怎么用?Java WildcardType.isUpperBound使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.dom.WildcardType
的用法示例。
在下文中一共展示了WildcardType.isUpperBound方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
}