public class ClsEnumConstantImpl extends ClsFieldImpl implements PsiEnumConstant
ClsElementImpl.InvalidMirrorException
Iconable.IconFlags, Iconable.LastComputedIcon
COMPILED_ELEMENT, NEXT_LINE
FLAGS_LOCKED, ICON_PLACEHOLDER
ARRAY_FACTORY, EMPTY_ARRAY
EMPTY_NAVIGATABLE_ELEMENT_ARRAY
ICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITY
EMPTY_NAVIGATION_ITEM_ARRAY
Constructor and Description |
---|
ClsEnumConstantImpl(PsiFieldStub stub) |
Modifier and Type | Method and Description |
---|---|
void |
appendMirrorText(int indentLevel,
java.lang.StringBuilder buffer) |
java.lang.Object |
computeConstantValue(java.util.Set<PsiVariable> visitedVars) |
PsiExpressionList |
getArgumentList()
Returns the list of arguments passed to the constructor of the enum type to create the
instance of the constant.
|
PsiExpression |
getInitializer()
Returns the initializer for the variable.
|
PsiEnumConstantInitializer |
getInitializingClass()
Returns the class body attached to the enum constant declaration.
|
PsiEnumConstantInitializer |
getOrCreateInitializingClass() |
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.
|
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 |
setMirror(TreeElement element) |
accept, computeConstantValue, getChildren, getContainingClass, getElementIcon, getModifierList, getNavigationElement, getPresentation, getUseScope, isDeprecated, isEquivalentTo, isVisibilitySupported, normalizeDeclaration, setInitializer, toString
getDocComment, getName, getNameIdentifier, setName
getContainingFile, getElementType, getFirstChild, getLastChild, getManager, getNextSibling, getParent, getPrevSibling, getStub, isPhysical
add, addAfter, addBefore, appendText, appendText, checkAdd, checkDelete, copy, delete, findElementAt, findReferenceAt, getChildren, getIndentSize, getLanguage, getMirror, getNode, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, isValid, isWritable, replace, setMirror, setMirrorCheckingType, setMirrorIfPresent, setMirrors, setMirrors, textMatches, textMatches, textToCharArray
acceptChildren, addRange, addRangeAfter, addRangeBefore, canNavigate, canNavigateToSource, deleteChildRange, findChildByClass, findChildrenByClass, findNotNullChildByClass, getContext, getOriginalElement, getProject, getReference, getReferences, getResolveScope, navigate, notNullChild, processDeclarations, textContains
buildRowIcon, computeBaseIcon, createLayeredIcon, getAdjustedBaseIcon, getBaseIcon, getIcon, iconWithVisibilityIfNeeded, isNativeFileType, overlayIcons, registerIconLayer, transformFlags
changeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMap
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName, getNameIdentifier, setInitializer
getContainingClass
getAnnotation, getAnnotations, getSourceElement, hasAnnotation, hasModifier
computeConstantValue, normalizeDeclaration, setName
getIdentifyingElement
getNavigationElement
isWritable
isDeprecated
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, getOwnReferences, getParent, getPrevSibling, getProject, getReference, getReferences, getResolveScope, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, getTextRangeInParent, getUseScope, isEquivalentTo, isPhysical, isValid, isWritable, processDeclarations, putCopyableUserData, replace, textContains, textMatches, textMatches, textToCharArray, toString
getUserData, putUserData
getPresentation
canNavigate, canNavigateToSource, navigate
getDocComment
hasAnnotation
public ClsEnumConstantImpl(PsiFieldStub stub)
public void appendMirrorText(int indentLevel, java.lang.StringBuilder buffer)
appendMirrorText
in class ClsFieldImpl
public void setMirror(TreeElement element) throws ClsElementImpl.InvalidMirrorException
setMirror
in class ClsFieldImpl
ClsElementImpl.InvalidMirrorException
public PsiExpressionList getArgumentList()
PsiEnumConstant
getArgumentList
in interface PsiCall
getArgumentList
in interface PsiEnumConstant
public PsiMethod resolveMethod()
PsiCall
resolveMethod
in interface PsiCall
public JavaResolveResult resolveMethodGenerics()
PsiCall
resolveMethodGenerics
in interface PsiCall
JavaResolveResult.EMPTY
if unresolvedpublic PsiEnumConstantInitializer getInitializingClass()
PsiEnumConstant
getInitializingClass
in interface PsiEnumConstant
public PsiEnumConstantInitializer getOrCreateInitializingClass()
getOrCreateInitializingClass
in interface PsiEnumConstant
public PsiMethod resolveConstructor()
PsiConstructorCall
PsiCall.resolveMethod()
.resolveConstructor
in interface PsiConstructorCall
public PsiType getType()
PsiVariable
getType
in interface JvmField
getType
in interface PsiField
getType
in interface PsiVariable
getType
in class ClsFieldImpl
Field.getGenericType()
,
Field.getAnnotatedType()
public PsiTypeElement getTypeElement()
PsiVariable
getTypeElement
in interface PsiVariable
getTypeElement
in class ClsFieldImpl
public PsiExpression getInitializer()
PsiVariable
getInitializer
in interface PsiVariable
getInitializer
in class ClsFieldImpl
PsiVariable.hasInitializer()
public boolean hasInitializer()
PsiVariable
Checks 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 PsiVariable
hasInitializer
in class ClsFieldImpl
public boolean hasModifierProperty(java.lang.String name)
PsiModifierListOwner
PsiModifier
class.hasModifierProperty
in interface PsiModifierListOwner
hasModifierProperty
in class ClsFieldImpl
name
- the name of the modifier to check.public java.lang.Object computeConstantValue(java.util.Set<PsiVariable> visitedVars)
computeConstantValue
in interface PsiVariableEx
computeConstantValue
in class ClsFieldImpl