本文整理汇总了Java中com.intellij.psi.PsiTypeParameterList类的典型用法代码示例。如果您正苦于以下问题:Java PsiTypeParameterList类的具体用法?Java PsiTypeParameterList怎么用?Java PsiTypeParameterList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PsiTypeParameterList类属于com.intellij.psi包,在下文中一共展示了PsiTypeParameterList类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: isPsiMethodCamelLanguage
import com.intellij.psi.PsiTypeParameterList; //导入依赖的package包/类
private boolean isPsiMethodCamelLanguage(PsiMethod method) {
PsiType type = method.getReturnType();
if (type != null && type instanceof PsiClassReferenceType) {
PsiClassReferenceType clazz = (PsiClassReferenceType) type;
PsiClass resolved = clazz.resolve();
if (resolved != null) {
boolean language = getCamelIdeaUtils().isCamelExpressionOrLanguage(resolved);
// try parent using some weird/nasty stub stuff which is how complex IDEA AST
// is when its parsing the Camel route builder
if (!language) {
PsiElement elem = resolved.getParent();
if (elem instanceof PsiTypeParameterList) {
elem = elem.getParent();
}
if (elem instanceof PsiClass) {
language = getCamelIdeaUtils().isCamelExpressionOrLanguage((PsiClass) elem);
}
}
return language;
}
}
return false;
}
开发者ID:camel-idea-plugin,项目名称:camel-idea-plugin,代码行数:25,代码来源:CamelDocumentationProvider.java
示例2: withParameterTypes
import com.intellij.psi.PsiTypeParameterList; //导入依赖的package包/类
public LombokLightClassBuilder withParameterTypes(@Nullable PsiTypeParameterList parameterList) {
if (parameterList != null) {
for (PsiTypeParameter typeParameter : parameterList.getTypeParameters()) {
getTypeParameterList().addParameter(typeParameter);
}
}
return this;
}
开发者ID:mplushnikov,项目名称:lombok-intellij-plugin,代码行数:9,代码来源:LombokLightClassBuilder.java
示例3: createTypeParameterList
import com.intellij.psi.PsiTypeParameterList; //导入依赖的package包/类
@Nullable
public static PsiTypeParameterList createTypeParameterList(@NotNull PsiTypeParameterList psiTypeParameterList) {
PsiTypeParameter[] psiTypeParameters = psiTypeParameterList.getTypeParameters();
if (psiTypeParameters.length > 0) {
final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(psiTypeParameterList.getProject());
final StringBuilder builder = new StringBuilder("public <");
for (PsiTypeParameter psiTypeParameter : psiTypeParameters) {
builder.append(psiTypeParameter.getName());
PsiClassType[] superTypes = psiTypeParameter.getExtendsListTypes();
if (superTypes.length > 1 || superTypes.length == 1 && !superTypes[0].equalsToText(CommonClassNames.JAVA_LANG_OBJECT)) {
builder.append(" extends ");
for (PsiClassType type : superTypes) {
if (type.equalsToText(CommonClassNames.JAVA_LANG_OBJECT)) {
continue;
}
builder.append(type.getCanonicalText()).append('&');
}
builder.deleteCharAt(builder.length() - 1);
}
builder.append(',');
}
builder.deleteCharAt(builder.length() - 1);
builder.append("> void foo(){}");
PsiMethod methodFromText = elementFactory.createMethodFromText(builder.toString(), null);
return methodFromText.getTypeParameterList();
}
return null;
}
开发者ID:mplushnikov,项目名称:lombok-intellij-plugin,代码行数:35,代码来源:PsiMethodUtil.java
示例4: rebuildTypeParameter
import com.intellij.psi.PsiTypeParameterList; //导入依赖的package包/类
private void rebuildTypeParameter(@NotNull PsiTypeParameterListOwner listOwner, @NotNull PsiTypeParameterListOwner resultOwner) {
final PsiTypeParameterList fromMethodTypeParameterList = listOwner.getTypeParameterList();
if (listOwner.hasTypeParameters() && null != fromMethodTypeParameterList) {
PsiTypeParameterList typeParameterList = PsiMethodUtil.createTypeParameterList(fromMethodTypeParameterList);
if (null != typeParameterList) {
final PsiTypeParameterList resultOwnerTypeParameterList = resultOwner.getTypeParameterList();
if (null != resultOwnerTypeParameterList) {
resultOwnerTypeParameterList.replace(typeParameterList);
}
}
}
}
开发者ID:mplushnikov,项目名称:lombok-intellij-plugin,代码行数:13,代码来源:BaseDelombokHandler.java
示例5: selectWithTypeParameters
import com.intellij.psi.PsiTypeParameterList; //导入依赖的package包/类
private static Collection<TextRange> selectWithTypeParameters(@NotNull PsiClass psiClass) {
final PsiIdentifier identifier = psiClass.getNameIdentifier();
final PsiTypeParameterList list = psiClass.getTypeParameterList();
if (identifier != null && list != null) {
return Collections.singletonList(new TextRange(identifier.getTextRange().getStartOffset(), list.getTextRange().getEndOffset()));
}
return Collections.emptyList();
}
开发者ID:consulo,项目名称:consulo-java,代码行数:9,代码来源:MethodOrClassSelectioner.java
示例6: visitTypeParameterList
import com.intellij.psi.PsiTypeParameterList; //导入依赖的package包/类
@Override
public void visitTypeParameterList(PsiTypeParameterList list) {
mVisitor.report("PsiTypeParameterList", list.getText(), list);
super.visitElement(list);
}
开发者ID:cch-robo,项目名称:Android_Lint_SRP_Practice_Example,代码行数:6,代码来源:PsiClassStructureDetector.java
示例7: createPsi
import com.intellij.psi.PsiTypeParameterList; //导入依赖的package包/类
@Override
public PsiTypeParameterList createPsi(@NotNull final PsiTypeParameterListStub stub) {
return getPsiFactory(stub).createTypeParameterList(stub);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:JavaTypeParameterListElementType.java
示例8: getTypeParameterList
import com.intellij.psi.PsiTypeParameterList; //导入依赖的package包/类
@Override
@Nullable
PsiTypeParameterList getTypeParameterList();
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:GrTypeParameterListOwner.java
示例9: getTypeParameterList
import com.intellij.psi.PsiTypeParameterList; //导入依赖的package包/类
@Nullable
PsiTypeParameterList getTypeParameterList();
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:3,代码来源:GrTypeParameterListOwner.java
注:本文中的com.intellij.psi.PsiTypeParameterList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论