程序包 com.intellij.psi

接口 PsiNamedElement

所有超级接口:
PsiElement
所有已知子接口:
PsiNameIdentifierOwner

public interface PsiNamedElement extends PsiElement
Represents a declaration which introduces a named entity and can be renamed (for example, a class or a method). References should not implement this interface since they don't usually introduce a new entity.
另请参阅:
  • fleet.com.intellij.model.psi.PsiSymbolDeclaration
  • 字段详细资料

    • EMPTY_ARRAY

      static final PsiNamedElement[] EMPTY_ARRAY
      The empty array of PSI named elements which can be reused to avoid unnecessary allocations.
  • 方法详细资料

    • getName

      @Nullable @NlsSafe @Nullable @NlsSafe String getName()
      Returns the name of the element.
      返回:
      the element name.
    • setName

      PsiElement setName(@NlsSafe @NotNull @NlsSafe @NotNull String name) throws IncorrectOperationException
      Renames the element.
      参数:
      name - the new element name.
      返回:
      the element corresponding to this element after the renaming (either this or a different element if the renaming caused the element to be replaced).
      抛出:
      IncorrectOperationException - if the modification is not supported or not possible for some reason.