本文整理汇总了Java中com.intellij.psi.PsiAnnotation.EMPTY_ARRAY属性的典型用法代码示例。如果您正苦于以下问题:Java PsiAnnotation.EMPTY_ARRAY属性的具体用法?Java PsiAnnotation.EMPTY_ARRAY怎么用?Java PsiAnnotation.EMPTY_ARRAY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.psi.PsiAnnotation
的用法示例。
在下文中一共展示了PsiAnnotation.EMPTY_ARRAY属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findInferredAnnotations
@NotNull
public PsiAnnotation[] findInferredAnnotations(@NotNull final PsiModifierListOwner listOwner)
{
if(!(listOwner instanceof PsiCompiledElement))
{
return PsiAnnotation.EMPTY_ARRAY;
}
return CachedValuesManager.getCachedValue(listOwner, new CachedValueProvider<PsiAnnotation[]>()
{
@Nullable
@Override
public Result<PsiAnnotation[]> compute()
{
return CachedValueProvider.Result.create(ProjectBytecodeAnalysis.this.collectInferredAnnotations(listOwner), listOwner);
}
});
}
示例2: toPsi
/**
* Converts inferred parameter annotations to Psi annotations
*
* @param parameterAnnotations inferred parameter annotations
* @return Psi annotations
*/
private PsiAnnotation[] toPsi(ParameterAnnotations parameterAnnotations)
{
if(parameterAnnotations.notNull)
{
return new PsiAnnotation[]{
getNotNullAnnotation()
};
}
else if(parameterAnnotations.nullable)
{
return new PsiAnnotation[]{
getNullableAnnotation()
};
}
return PsiAnnotation.EMPTY_ARRAY;
}
示例3: getAnnotations
@NotNull
private PsiAnnotation[] getAnnotations(@NotNull Project project, PsiModifierListOwner owner)
{
PsiAnnotation[] annotations = ExternalAnnotationsManager.getInstance(project).findExternalAnnotations(owner);
if(annotations == null)
{
return PsiAnnotation.EMPTY_ARRAY;
}
else
{
JavaPsiFacade facade = JavaPsiFacade.getInstance(project);
return Arrays.stream(annotations).filter(anno ->
{
String qualifiedName = anno.getQualifiedName();
return qualifiedName != null && facade.findClass(qualifiedName, owner.getResolveScope()) != null;
}).toArray(PsiAnnotation[]::new);
}
}
示例4: getAnnotations
@Override
public PsiAnnotation[] getAnnotations()
{
PsiAnnotation[] result = PsiAnnotation.EMPTY_ARRAY;
if( !_annotations.isEmpty() )
{
Collection<PsiAnnotation> annotations = _annotations.values();
result = annotations.toArray( new PsiAnnotation[annotations.size()] );
}
return result;
}
示例5: getAnnotations
@Override
@NotNull
public PsiAnnotation[] getAnnotations() {
PsiAnnotation[] result = PsiAnnotation.EMPTY_ARRAY;
if (!myAnnotations.isEmpty()) {
Collection<PsiAnnotation> annotations = myAnnotations.values();
result = annotations.toArray(new PsiAnnotation[annotations.size()]);
}
return result;
}
示例6: GrPsiTypeStub
public GrPsiTypeStub() {
super(PsiAnnotation.EMPTY_ARRAY);
}