本文整理汇总了Java中com.intellij.refactoring.typeCook.deductive.PsiTypeVariableFactory类的典型用法代码示例。如果您正苦于以下问题:Java PsiTypeVariableFactory类的具体用法?Java PsiTypeVariableFactory怎么用?Java PsiTypeVariableFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PsiTypeVariableFactory类属于com.intellij.refactoring.typeCook.deductive包,在下文中一共展示了PsiTypeVariableFactory类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createParameterizedType
import com.intellij.refactoring.typeCook.deductive.PsiTypeVariableFactory; //导入依赖的package包/类
private static PsiType createParameterizedType(final PsiType t,
final PsiTypeVariableFactory factory,
final boolean upper,
final PsiElement context) {
if (t == null || (upper && t.getCanonicalText().equals(CommonClassNames.JAVA_LANG_OBJECT))) {
return factory.create(context);
}
if (t instanceof PsiClassType) {
final PsiClassType.ClassResolveResult result = resolveType(t);
final PsiSubstitutor aSubst = result.getSubstitutor();
final PsiClass aClass = result.getElement();
PsiSubstitutor theSubst = PsiSubstitutor.EMPTY;
final Set<PsiTypeVariable> cluster = new HashSet<PsiTypeVariable>();
for (final PsiTypeParameter parm : aSubst.getSubstitutionMap().keySet()) {
final PsiType type = createParameterizedType(aSubst.substitute(parm), factory, false, context);
if (type instanceof PsiTypeVariable) {
cluster.add((PsiTypeVariable)type);
}
theSubst = theSubst.put(parm, type);
}
if (cluster.size() > 1) {
factory.registerCluster(cluster);
}
return JavaPsiFacade.getInstance(aClass.getProject()).getElementFactory().createType(aClass, theSubst);
}
else if (t instanceof PsiArrayType) {
return createParameterizedType(((PsiArrayType)t).getComponentType(), factory, upper, context).createArrayType();
}
return t;
}
示例2: ReductionSystem
import com.intellij.refactoring.typeCook.deductive.PsiTypeVariableFactory; //导入依赖的package包/类
public ReductionSystem(final Project project,
final Set<PsiElement> elements,
final Map<PsiElement, PsiType> types,
final PsiTypeVariableFactory factory,
final Settings settings) {
myProject = project;
myElements = elements;
myTypes = types;
myTypeVariableFactory = factory;
myBoundVariables = null;
mySettings = settings;
myCastToOperandType = new HashMap<PsiTypeCastExpression, PsiType>();
}
示例3: SystemBuilder
import com.intellij.refactoring.typeCook.deductive.PsiTypeVariableFactory; //导入依赖的package包/类
public SystemBuilder(final Project project, final Settings settings) {
myProject = project;
myManager = PsiManager.getInstance(myProject);
mySettings = settings;
myMethodCache = new HashMap<PsiElement, Boolean>();
myParameters = new HashMap<PsiParameter, PsiParameter>();
myMethods = new HashMap<PsiMethod, PsiMethod>();
myTypes = new HashMap<PsiElement, PsiType>();
myVisitedConstructions = new HashSet<PsiAnchor>();
myTypeVariableFactory = new PsiTypeVariableFactory();
}
示例4: createParameterizedType
import com.intellij.refactoring.typeCook.deductive.PsiTypeVariableFactory; //导入依赖的package包/类
private static PsiType createParameterizedType(final PsiType t,
final PsiTypeVariableFactory factory,
final boolean upper,
final PsiElement context) {
if (t == null || (upper && t.getCanonicalText().equals(CommonClassNames.JAVA_LANG_OBJECT))) {
return factory.create(context);
}
if (t instanceof PsiClassType) {
final PsiClassType.ClassResolveResult result = resolveType(t);
final PsiSubstitutor aSubst = result.getSubstitutor();
final PsiClass aClass = result.getElement();
PsiSubstitutor theSubst = PsiSubstitutor.EMPTY;
final HashSet<PsiTypeVariable> cluster = new HashSet<PsiTypeVariable>();
for (final PsiTypeParameter parm : aSubst.getSubstitutionMap().keySet()) {
final PsiType type = createParameterizedType(aSubst.substitute(parm), factory, false, context);
if (type instanceof PsiTypeVariable) {
cluster.add((PsiTypeVariable)type);
}
theSubst = theSubst.put(parm, type);
}
if (cluster.size() > 1) {
factory.registerCluster(cluster);
}
return JavaPsiFacade.getInstance(aClass.getProject()).getElementFactory().createType(aClass, theSubst);
}
else if (t instanceof PsiArrayType) {
return createParameterizedType(((PsiArrayType)t).getComponentType(), factory, upper, context).createArrayType();
}
return t;
}
示例5: ReductionSystem
import com.intellij.refactoring.typeCook.deductive.PsiTypeVariableFactory; //导入依赖的package包/类
public ReductionSystem(final Project project,
final HashSet<PsiElement> elements,
final HashMap<PsiElement, PsiType> types,
final PsiTypeVariableFactory factory,
final Settings settings) {
myProject = project;
myElements = elements;
myTypes = types;
myTypeVariableFactory = factory;
myBoundVariables = null;
mySettings = settings;
myCastToOperandType = new HashMap<PsiTypeCastExpression, PsiType>();
}
示例6: getVariableFactory
import com.intellij.refactoring.typeCook.deductive.PsiTypeVariableFactory; //导入依赖的package包/类
public PsiTypeVariableFactory getVariableFactory() {
return myTypeVariableFactory;
}