本文整理汇总了Java中com.intellij.psi.PsiWildcardType.createExtends方法的典型用法代码示例。如果您正苦于以下问题:Java PsiWildcardType.createExtends方法的具体用法?Java PsiWildcardType.createExtends怎么用?Java PsiWildcardType.createExtends使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.PsiWildcardType
的用法示例。
在下文中一共展示了PsiWildcardType.createExtends方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractAllElementType
import com.intellij.psi.PsiWildcardType; //导入方法依赖的package包/类
@NotNull
public static PsiType extractAllElementType(@NotNull PsiType psiType, @NotNull PsiManager psiManager, final String superClass, final int paramIndex) {
PsiType oneElementType = PsiUtil.substituteTypeParameter(psiType, superClass, paramIndex, true);
if (oneElementType instanceof PsiWildcardType) {
oneElementType = ((PsiWildcardType) oneElementType).getBound();
}
PsiType result;
final PsiClassType javaLangObject = PsiType.getJavaLangObject(psiManager, GlobalSearchScope.allScope(psiManager.getProject()));
if (null == oneElementType || Comparing.equal(javaLangObject, oneElementType)) {
result = PsiWildcardType.createUnbounded(psiManager);
} else {
result = PsiWildcardType.createExtends(psiManager, oneElementType);
}
return result;
}
示例2: adjustInferredType
import com.intellij.psi.PsiWildcardType; //导入方法依赖的package包/类
@Override
public PsiType adjustInferredType(PsiManager manager, PsiType guess, ConstraintType constraintType)
{
if(guess != null && !(guess instanceof PsiWildcardType))
{
if(constraintType == ConstraintType.SUPERTYPE)
{
return PsiWildcardType.createExtends(manager, guess);
}
else if(constraintType == ConstraintType.SUBTYPE)
{
return PsiWildcardType.createSuper(manager, guess);
}
}
return guess;
}
示例3: getType
import com.intellij.psi.PsiWildcardType; //导入方法依赖的package包/类
@Override
@NotNull
public PsiType getType() {
final GrTypeElement boundTypeElement = getBoundTypeElement();
if (boundTypeElement == null) return PsiWildcardType.createUnbounded(getManager());
if (isExtends()) return PsiWildcardType.createExtends(getManager(), boundTypeElement.getType());
if (isSuper()) return PsiWildcardType.createSuper(getManager(), boundTypeElement.getType());
LOG.error("Untested case");
return null;
}
示例4: getType
import com.intellij.psi.PsiWildcardType; //导入方法依赖的package包/类
@NotNull
public PsiType getType() {
final GrTypeElement boundTypeElement = getBoundTypeElement();
if (boundTypeElement == null) return PsiWildcardType.createUnbounded(getManager());
if (isExtends()) return PsiWildcardType.createExtends(getManager(), boundTypeElement.getType());
if (isSuper()) return PsiWildcardType.createSuper(getManager(), boundTypeElement.getType());
LOG.error("Untested case");
return null;
}
示例5: getInferredTypeWithNoConstraint
import com.intellij.psi.PsiWildcardType; //导入方法依赖的package包/类
@Override
public Pair<PsiType, ConstraintType> getInferredTypeWithNoConstraint(PsiManager psiManager, PsiType superType)
{
if(!(superType instanceof PsiWildcardType))
{
return new Pair<>(PsiWildcardType.createExtends(psiManager, superType), ConstraintType.EQUALS);
}
else
{
return Pair.create(superType, ConstraintType.SUBTYPE);
}
}