public class PsiEnumConstantImpl extends JavaStubPsiElement<PsiFieldStub> implements PsiEnumConstant
Iconable.IconFlags, Iconable.LastComputedIconCREATION_TRACE, ourTraceStubAstBindingFLAGS_LOCKED, ICON_PLACEHOLDERARRAY_FACTORY, EMPTY_ARRAYEMPTY_NAVIGATABLE_ELEMENT_ARRAYICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITYEMPTY_NAVIGATION_ITEM_ARRAY| Constructor and Description |
|---|
PsiEnumConstantImpl(ASTNode node) |
PsiEnumConstantImpl(PsiFieldStub stub) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(PsiElementVisitor visitor)
Passes the element to the specified visitor.
|
java.lang.Object |
computeConstantValue()
Calculates and returns the constant value of the variable initializer.
|
PsiExpressionList |
getArgumentList()
Returns the list of arguments passed to the constructor of the enum type to create the
instance of the constant.
|
PsiClass |
getContainingClass()
Returns the class containing the member.
|
PsiElement |
getContext()
Returns the element which should be used as the parent of this element in a tree up
walk during a resolve operation.
|
PsiDocComment |
getDocComment()
Returns the JavaDoc comment for the element, or
null when the element has no JavaDoc comment. |
javax.swing.Icon |
getElementIcon(int flags) |
PsiExpression |
getInitializer()
Returns the initializer for the variable.
|
PsiEnumConstantInitializer |
getInitializingClass()
Returns the class body attached to the enum constant declaration.
|
PsiModifierList |
getModifierList()
Returns the list of modifiers for the element.
|
java.lang.String |
getName()
Returns the name of the element.
|
PsiIdentifier |
getNameIdentifier()
Returns the identifier declaring the name of the variable.
|
PsiEnumConstantInitializer |
getOrCreateInitializingClass() |
ItemPresentation |
getPresentation() |
PsiReference |
getReference()
Returns the reference from this PSI element to another PSI element (or elements), if one exists.
|
PsiType |
getType()
Returns the type of the variable.
|
PsiTypeElement |
getTypeElement()
Returns the type element declaring the type of the variable.
|
boolean |
hasInitializer()
Checks if the variable has an initializer.
|
boolean |
hasModifierProperty(java.lang.String name)
Checks if the element has the specified modifier.
|
boolean |
isDeprecated()
Returns
true if the element is marked as deprecated via an annotation or a JavaDoc tag. |
boolean |
isEquivalentTo(PsiElement another)
This method shouldn't be called by clients directly, because there are no guarantees of it being symmetric.
|
protected boolean |
isVisibilitySupported() |
void |
normalizeDeclaration()
Ensures that the variable declaration is not combined in the same statement with
other declarations.
|
PsiMethod |
resolveConstructor()
Resolves the reference to the called constructor and returns the constructor.
|
PsiMethod |
resolveMethod()
Resolves the reference to the called method and returns the method.
|
JavaResolveResult |
resolveMethodGenerics()
Resolves the reference to the called method and returns the resolve result
containing the method and the substitutor for generic type parameters.
|
void |
setInitializer(PsiExpression initializer)
Adds initializer to the field declaration or, if
initializer parameter is null,
removes the initializer from the field declaration. |
PsiElement |
setName(java.lang.String name)
Renames the element.
|
java.lang.String |
toString()
toString() should never be presented to the user.
|
acceptChildren, add, addAfter, addBefore, calcTreeElement, checkAdd, clone, cloneImpl, delete, deleteChildRange, getChildren, getLanguage, getTextOffset, replacegetContainingFile, getElementType, getGreenStub, getManager, getNode, getParent, getParentByStub, getParentByTree, getProject, getRequiredStubOrPsiChild, getStub, getStubOrPsiChild, getStubOrPsiChildren, getStubOrPsiChildren, getStubOrPsiChildren, getStubOrPsiChildren, getStubOrPsiParentOfType, isPhysical, isValid, isWritable, setNode, setSubstrateRefaddInternal, addRange, addRangeAfter, addRangeBefore, checkDelete, copy, deleteChildInternal, findChildByFilter, findChildByType, findChildByType, findChildrenByType, findChildrenByType, findChildrenByType, findChildrenByType, findElementAt, findLastChildByType, findNotNullChildByType, findNotNullChildByType, getCopyableUserData, getFirstChild, getLastChild, getNextSibling, getPrevSibling, getStartOffsetInParent, getText, getTextLength, getTextRange, putCopyableUserData, replaceChildInternal, subtreeChanged, textContains, textMatches, textToCharArraycanNavigate, canNavigateToSource, findChildByClass, findChildrenByClass, findNotNullChildByClass, findReferenceAt, getNavigationElement, getOriginalElement, getReferences, getResolveScope, getUseScope, navigate, notNullChild, processDeclarations, textMatchesbuildRowIcon, computeBaseIcon, createLayeredIcon, getAdjustedBaseIcon, getBaseIcon, getIcon, iconWithVisibilityIfNeeded, isNativeFileType, overlayIcons, registerIconLayer, transformFlagschangeUserMap, clearUserData, copyCopyableDataTo, copyUserDataTo, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putUserData, putUserDataIfAbsent, replace, setUserMapequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAnnotation, getAnnotations, getSourceElement, hasAnnotation, hasModifiergetIdentifyingElementgetNavigationElementisWritableacceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, checkAdd, checkDelete, copy, delete, deleteChildRange, findElementAt, findReferenceAt, getChildren, getContainingFile, getCopyableUserData, getFirstChild, getLanguage, getLastChild, getManager, getNavigationElement, getNextSibling, getNode, getOriginalElement, getOwnReferences, getParent, getPrevSibling, getProject, getReferences, getResolveScope, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, getTextRangeInParent, getUseScope, isPhysical, isValid, isWritable, processDeclarations, putCopyableUserData, replace, textContains, textMatches, textMatches, textToCharArraygetUserData, putUserDatacanNavigate, canNavigateToSource, navigategetElementType, getStubpublic PsiEnumConstantImpl(PsiFieldStub stub)
public PsiEnumConstantImpl(ASTNode node)
public java.lang.String toString()
PsiElementtoString in interface PsiElementtoString in class java.lang.Objectpublic void accept(PsiElementVisitor visitor)
PsiElementaccept in interface PsiElementaccept in class PsiElementBasevisitor - the visitor to pass the element to.public PsiExpressionList getArgumentList()
PsiEnumConstantgetArgumentList in interface PsiCallgetArgumentList in interface PsiEnumConstantpublic PsiEnumConstantInitializer getInitializingClass()
PsiEnumConstantgetInitializingClass in interface PsiEnumConstantpublic PsiEnumConstantInitializer getOrCreateInitializingClass()
getOrCreateInitializingClass in interface PsiEnumConstantpublic PsiClass getContainingClass()
PsiMembergetContainingClass in interface JvmMembergetContainingClass in interface PsiJvmMembergetContainingClass in interface PsiMemberMember.getDeclaringClass()public PsiElement getContext()
PsiElementgetParent(),
but the context can be overridden for some elements like code fragments (see
JavaCodeFragmentFactory.createCodeBlockCodeFragment(String, PsiElement, boolean)).getContext in interface PsiElementgetContext in class StubBasedPsiElementBase<PsiFieldStub>public PsiModifierList getModifierList()
PsiModifierListOwnergetModifierList in interface PsiModifierListOwnerpublic boolean hasModifierProperty(java.lang.String name)
PsiModifierListOwnerPsiModifier class.hasModifierProperty in interface PsiModifierListOwnername - the name of the modifier to check.public PsiType getType()
PsiVariablepublic PsiTypeElement getTypeElement()
PsiVariablegetTypeElement in interface PsiVariablepublic PsiExpression getInitializer()
PsiVariablegetInitializer in interface PsiVariablePsiVariable.hasInitializer()public boolean hasInitializer()
PsiVariableChecks if the variable has an initializer.
Please note that even when PsiVariable.hasInitializer() returns true, PsiVariable.getInitializer() still can return null,
e.g. for implicit initializer in case of enum constant declaration.
hasInitializer in interface PsiVariablepublic void normalizeDeclaration()
throws IncorrectOperationException
PsiVariableint[] a)
and not in C style (int a[]).normalizeDeclaration in interface PsiVariableIncorrectOperationException - if the modification fails for some reason.public java.lang.Object computeConstantValue()
PsiVariablecomputeConstantValue in interface PsiVariablepublic PsiMethod resolveMethod()
PsiCallresolveMethod in interface PsiCallpublic JavaResolveResult resolveMethodGenerics()
PsiCallresolveMethodGenerics in interface PsiCallJavaResolveResult.EMPTY if unresolvedpublic PsiIdentifier getNameIdentifier()
PsiVariablegetNameIdentifier in interface PsiFieldgetNameIdentifier in interface PsiNameIdentifierOwnergetNameIdentifier in interface PsiVariablepublic java.lang.String getName()
PsiNamedElementgetName in interface JvmFieldgetName in interface JvmMembergetName in interface JvmNamedElementgetName in interface NavigationItemgetName in interface PomNamedTargetgetName in interface PsiFieldgetName in interface PsiNamedElementgetName in class PsiElementBaseMember.getName()public PsiElement setName(java.lang.String name) throws IncorrectOperationException
PsiNamedElementsetName in interface PomRenameableTarget<PsiElement>setName in interface PsiNamedElementsetName in interface PsiVariablename - the new element name.this
or a different element if the rename caused the element to be replaced).IncorrectOperationException - if the modification is not supported or not possible for some reason.public PsiDocComment getDocComment()
PsiJavaDocumentedElementnull when the element has no JavaDoc comment.getDocComment in interface PsiJavaDocumentedElementpublic boolean isDeprecated()
PsiDocCommentOwnertrue if the element is marked as deprecated via an annotation or a JavaDoc tag.isDeprecated in interface PsiDocCommentOwnerpublic PsiReference getReference()
PsiElementPsiElement.getReferences()
for an example), returns the first associated reference.getReference in interface PsiElementgetReference in class PsiElementBaseReferencesSearchpublic PsiMethod resolveConstructor()
PsiConstructorCallPsiCall.resolveMethod().resolveConstructor in interface PsiConstructorCallpublic javax.swing.Icon getElementIcon(int flags)
getElementIcon in class ElementBaseprotected boolean isVisibilitySupported()
isVisibilitySupported in class ElementBasepublic ItemPresentation getPresentation()
getPresentation in interface NavigationItemgetPresentation in class PsiElementBasepublic void setInitializer(PsiExpression initializer) throws IncorrectOperationException
PsiFieldinitializer parameter is null,
removes the initializer from the field declaration.setInitializer in interface PsiFieldsetInitializer in interface PsiVariableinitializer - the initializer to add.IncorrectOperationException - if the modifications fails for some reason.public boolean isEquivalentTo(PsiElement another)
PsiElementPsiManager.areElementsEquivalent(PsiElement, PsiElement) internally, which clients should invoke instead.
Implementations of this method should return true if the parameter is resolve-equivalent to this, i.e. it represents
the same entity from the language perspective. See also PsiManager.areElementsEquivalent(PsiElement, PsiElement) documentation.isEquivalentTo in interface PsiElementisEquivalentTo in class PsiElementBase