本文整理汇总了Java中org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TType.isRawType方法的典型用法代码示例。如果您正苦于以下问题:Java TType.isRawType方法的具体用法?Java TType.isRawType怎么用?Java TType.isRawType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TType
的用法示例。
在下文中一共展示了TType.isRawType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeSupertypeElementVariables
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TType; //导入方法依赖的package包/类
private void makeSupertypeElementVariables(ConstraintVariable2 expressionCv, TType supertype) {
if (supertype.isParameterizedType() || supertype.isRawType()) {
TType[] typeArguments = null;
if (supertype.isParameterizedType()) {
typeArguments = ((ParameterizedType) supertype).getTypeArguments();
}
TypeVariable[] typeParameters =
((GenericType) supertype.getTypeDeclaration()).getTypeParameters();
for (int i = 0; i < typeParameters.length; i++) {
TypeVariable typeParameter = typeParameters[i];
TType referenceTypeArgument;
if (typeArguments == null) { // raw type
referenceTypeArgument = typeParameter.getErasure();
} else {
referenceTypeArgument = typeArguments[i];
}
if (referenceTypeArgument.isTypeVariable()) {
CollectionElementVariable2 referenceTypeArgumentCv =
getElementVariable(expressionCv, (TypeVariable) referenceTypeArgument);
if (referenceTypeArgumentCv != null) {
setElementVariable(expressionCv, referenceTypeArgumentCv, typeParameter);
continue;
}
}
makeElementVariable(
expressionCv,
typeParameter,
CollectionElementVariable2.NOT_DECLARED_TYPE_VARIABLE_INDEX);
}
}
makeElementVariablesFromSupertypes(expressionCv, supertype);
}
示例2: makeFixedSupertypeElementVariables
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TType; //导入方法依赖的package包/类
private void makeFixedSupertypeElementVariables(
ConstraintVariable2 expressionCv, TType supertype) {
if (supertype.isParameterizedType() || supertype.isRawType()) {
TType[] typeArguments = null;
if (supertype.isParameterizedType())
typeArguments = ((ParameterizedType) supertype).getTypeArguments();
TypeVariable[] typeParameters =
((GenericType) supertype.getTypeDeclaration()).getTypeParameters();
for (int i = 0; i < typeParameters.length; i++) {
TypeVariable typeParameter = typeParameters[i];
TType referenceTypeArgument;
if (typeArguments == null) { // raw type
continue; // do not consider
} else {
referenceTypeArgument = typeArguments[i];
}
if (referenceTypeArgument.isTypeVariable()) {
CollectionElementVariable2 referenceTypeArgumentCv =
getElementVariable(expressionCv, (TypeVariable) referenceTypeArgument);
setElementVariable(expressionCv, referenceTypeArgumentCv, typeParameter);
} else {
CollectionElementVariable2 elementCv =
makeElementVariable(
expressionCv,
typeParameter,
CollectionElementVariable2.NOT_DECLARED_TYPE_VARIABLE_INDEX);
createEqualsConstraint(elementCv, makeImmutableTypeVariable(referenceTypeArgument));
}
}
}
makeFixedElementVariablesFromSupertypes(expressionCv, supertype);
}
示例3: isParametricType
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TType; //导入方法依赖的package包/类
private boolean isParametricType(TType type) {
return type.isParameterizedType()
|| type.isGenericType()
|| (type.isRawType() && type.getTypeDeclaration().isGenericType());
}
示例4: isAGenericType
import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TType; //导入方法依赖的package包/类
public static boolean isAGenericType(TType type) {
return type.isGenericType()
|| type.isParameterizedType()
|| (type.isRawType() && type.getTypeDeclaration().isGenericType());
}