当前位置: 首页>>代码示例>>Java>>正文


Java PsiUtilCore.NULL_PSI_ELEMENT属性代码示例

本文整理汇总了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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ManifestParserDefinition.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:SPIParserDefinition.java

示例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);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:PsiInvalidElementAccessException.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:HTMLParserDefinition.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:TypeOrElementOrAttributeReference.java

示例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";
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:48,代码来源:PsiInvalidElementAccessException.java

示例7: createElement

@Override
@NotNull
public PsiElement createElement(ASTNode node) {
  return PsiUtilCore.NULL_PSI_ELEMENT;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:PlainTextParserDefinition.java

示例8: NullFindUsagesHandler

private NullFindUsagesHandler() {
  super(PsiUtilCore.NULL_PSI_ELEMENT);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:FindUsagesHandler.java


注:本文中的com.intellij.psi.util.PsiUtilCore.NULL_PSI_ELEMENT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。