本文整理汇总了Java中com.intellij.psi.util.PsiUtilCore.NULL_PSI_ELEMENT属性的典型用法代码示例。如果您正苦于以下问题:Java PsiUtilCore.NULL_PSI_ELEMENT属性的具体用法?Java PsiUtilCore.NULL_PSI_ELEMENT怎么用?Java PsiUtilCore.NULL_PSI_ELEMENT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.psi.util.PsiUtilCore
的用法示例。
在下文中一共展示了PsiUtilCore.NULL_PSI_ELEMENT属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createElement
@NotNull
@Override
public PsiElement createElement(ASTNode node) {
IElementType type = node.getElementType();
if (type instanceof ManifestElementType) {
return ((ManifestElementType)type).createPsi(node);
}
return PsiUtilCore.NULL_PSI_ELEMENT;
}
示例2: createElement
@NotNull
@Override
public PsiElement createElement(ASTNode node) {
final IElementType elementType = node.getElementType();
if (elementType == SPIElementTypes.PROVIDERS_LIST) {
return new SPIClassProvidersElementList(node);
}
if (elementType == SPIElementTypes.PROVIDER) {
return new SPIClassProviderReferenceElement(node);
}
if (elementType == SPIElementTypes.PACK) {
return new SPIPackageOrClassReferenceElement(node);
}
return PsiUtilCore.NULL_PSI_ELEMENT;
}
示例3: PsiInvalidElementAccessException
public PsiInvalidElementAccessException(@Nullable PsiElement element, @Nullable String message, @Nullable Throwable cause) {
super(null, cause);
myElementReference = new SoftReference<PsiElement>(element);
if (element == null) {
myMessage = message;
myDiagnostic = Attachment.EMPTY_ARRAY;
}
else if (element == PsiUtilCore.NULL_PSI_ELEMENT) {
myMessage = "NULL_PSI_ELEMENT ;" + message;
myDiagnostic = Attachment.EMPTY_ARRAY;
}
else {
boolean recursiveInvocation = Boolean.TRUE.equals(element.getUserData(REPORTING_EXCEPTION));
element.putUserData(REPORTING_EXCEPTION, Boolean.TRUE);
try {
Object trace = recursiveInvocation ? null : findInvalidationTrace(element.getNode());
myMessage = getMessageWithReason(element, message, recursiveInvocation, trace);
if (trace == null) {
myDiagnostic = Attachment.EMPTY_ARRAY;
}
else {
String diagnostic = trace instanceof Throwable ? ExceptionUtil.getThrowableText((Throwable)trace) : trace.toString();
myDiagnostic = new Attachment[]{new Attachment("diagnostic.txt", diagnostic)};
}
}
finally {
element.putUserData(REPORTING_EXCEPTION, null);
}
}
}
示例4: createElement
@Override
@NotNull
public PsiElement createElement(ASTNode node) {
if (node.getElementType() == XmlElementType.HTML_EMBEDDED_CONTENT) {
return new HtmlEmbeddedContentImpl(node);
}
return PsiUtilCore.NULL_PSI_ELEMENT;
}
示例5: resolve
@Override
@Nullable
public PsiElement resolve() {
final PsiElement psiElement = ResolveCache
.getInstance(getElement().getProject()).resolveWithCaching(this, MyResolver.INSTANCE, false, false);
return psiElement != PsiUtilCore.NULL_PSI_ELEMENT ? psiElement:null;
}
示例6: reason
@NonNls
@NotNull
private static String reason(@NotNull PsiElement root) {
if (root == PsiUtilCore.NULL_PSI_ELEMENT) return "NULL_PSI_ELEMENT";
PsiElement element = root instanceof PsiFile ? root : root.getParent();
if (element == null) {
String m = "parent is null";
if (root instanceof StubBasedPsiElement) {
StubElement stub = ((StubBasedPsiElement)root).getStub();
while (stub != null) {
m += "\n each stub=" + stub;
if (stub instanceof PsiFileStub) {
m += "; fileStub.psi=" + stub.getPsi() + "; reason=" + ((PsiFileStub)stub).getInvalidationReason();
}
stub = stub.getParentStub();
}
}
return m;
}
while (element != null && !(element instanceof PsiFile)) element = element.getParent();
PsiFile file = (PsiFile)element;
if (file == null) return "containing file is null";
FileViewProvider provider = file.getViewProvider();
VirtualFile vFile = provider.getVirtualFile();
if (!vFile.isValid()) return vFile + " is invalid";
if (!provider.isPhysical()) {
PsiElement context = file.getContext();
if (context != null && !context.isValid()) {
return "invalid context: " + reason(context);
}
}
PsiManager manager = file.getManager();
if (manager.getProject().isDisposed()) return "project is disposed";
Language language = file.getLanguage();
if (language != provider.getBaseLanguage()) return "File language:" + language + " != Provider base language:" + provider.getBaseLanguage();
FileViewProvider p = manager.findViewProvider(vFile);
if (provider != p) return "different providers: " + provider + "(" + id(provider) + "); " + p + "(" + id(p) + ")";
if (!provider.isPhysical()) return "non-physical provider: " + provider; // "dummy" file?
return "psi is outdated";
}
示例7: createElement
@Override
@NotNull
public PsiElement createElement(ASTNode node) {
return PsiUtilCore.NULL_PSI_ELEMENT;
}
示例8: NullFindUsagesHandler
private NullFindUsagesHandler() {
super(PsiUtilCore.NULL_PSI_ELEMENT);
}