com.intellij.psi
Interface PsiNamedElement

All Superinterfaces:
Iconable, PsiElement, UserDataHolder
All Known Subinterfaces:
CssClass, CssFile, CssIdSelector, HtmlTag, ImplicitVariable, JspFile, JspImplicitVariable, PsiAnnotationMethod, PsiAnonymousClass, PsiAntElement, PsiAspect, PsiAspectField, PsiAspectFile, PsiAspectMethod, PsiBinaryFile, PsiClass, PsiCodeFragment, PsiDirectory, PsiDocTag, PsiEnumConstant, PsiEnumConstantInitializer, PsiExpressionCodeFragment, PsiField, PsiFile, PsiFileSystemItem, PsiInlineDocTag, PsiIntertypeField, PsiIntertypeMethod, PsiJavaCodeReferenceCodeFragment, PsiJavaFile, PsiJoinPointStaticPart, PsiLabeledStatement, PsiLocalVariable, PsiMethod, PsiPackage, PsiParameter, PsiPlainTextFile, PsiPointcutDef, PsiThisJoinPoint, PsiTypeCodeFragment, PsiTypeParameter, PsiVariable, WebDirectoryElement, XmlAttribute, XmlAttributeDecl, XmlElementDecl, XmlFile, XmlTag

public interface PsiNamedElement
extends PsiElement

A PSI element which has a name and can be renamed (for example, a class or a method).


Field Summary
static PsiNamedElement[] EMPTY_ARRAY
          The empty array of PSI named elements which can be reused to avoid unnecessary allocations.
 
Fields inherited from interface com.intellij.openapi.util.Iconable
ICON_FLAG_CLOSED, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITY
 
Method Summary
 java.lang.String getName()
          Returns the name of the element.
 PsiElement setName(java.lang.String name)
          Renames the element.
 
Methods inherited from interface com.intellij.psi.PsiElement
accept, acceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, checkAdd, checkDelete, copy, delete, deleteChildRange, findElementAt, findReferenceAt, getChildren, getContainingFile, getContext, getCopyableUserData, getFirstChild, getLanguage, getLastChild, getManager, getNavigationElement, getNextSibling, getNode, getOriginalElement, getParent, getPrevSibling, getProject, getReference, getReferences, getResolveScope, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, getUseScope, isPhysical, isValid, isWritable, processDeclarations, putCopyableUserData, replace, textContains, textMatches, textMatches, textToCharArray
 
Methods inherited from interface com.intellij.openapi.util.UserDataHolder
getUserData, putUserData
 
Methods inherited from interface com.intellij.openapi.util.Iconable
getIcon
 

Field Detail

EMPTY_ARRAY

static final PsiNamedElement[] EMPTY_ARRAY
The empty array of PSI named elements which can be reused to avoid unnecessary allocations.

Method Detail

getName

java.lang.String getName()
Returns the name of the element.

Returns:
the element name.

setName

PsiElement setName(java.lang.String name)
                   throws IncorrectOperationException
Renames the element.

Parameters:
name - the new element name.
Returns:
the element corresponding to this element after the rename (either this or a different element if the rename caused the element to be replaced).
Throws:
IncorrectOperationException - if the modification is not supported or not possible for some reason.