public class ClsFieldImpl extends ClsMemberImpl<PsiFieldStub> implements PsiField, PsiVariableEx, ClsModifierListOwner
ClsElementImpl.InvalidMirrorExceptionCOMPILED_ELEMENT, NEXT_LINEFLAGS_LOCKED, ICON_PLACEHOLDERARRAY_FACTORY, EMPTY_ARRAYEMPTY_NAVIGATABLE_ELEMENT_ARRAYEMPTY_NAVIGATION_ITEM_ARRAY| Constructor and Description |
|---|
ClsFieldImpl(PsiFieldStub stub) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(PsiElementVisitor visitor)
Passes the element to the specified visitor.
|
void |
appendMirrorText(int indentLevel,
java.lang.StringBuilder buffer) |
java.lang.Object |
computeConstantValue()
Calculates and returns the constant value of the variable initializer.
|
java.lang.Object |
computeConstantValue(java.util.Set<PsiVariable> visitedVars) |
PsiElement [] |
getChildren()
Returns the array of children for the PSI element.
|
PsiClass |
getContainingClass()
Returns the class containing the member.
|
javax.swing.Icon |
getElementIcon(int flags) |
PsiExpression |
getInitializer()
Returns the initializer for the variable.
|
PsiModifierList |
getModifierList()
Returns the list of modifiers for the element.
|
PsiElement |
getNavigationElement()
Returns the PSI element which should be used as a navigation target
when navigation to this PSI element is requested.
|
ItemPresentation |
getPresentation() |
PsiType |
getType()
Returns the type of the variable.
|
PsiTypeElement |
getTypeElement()
Returns the type element declaring the type of the variable.
|
SearchScope |
getUseScope()
Returns the scope in which references to this element are searched.
|
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.
|
void |
setInitializer(PsiExpression initializer)
Adds initializer to the field declaration or, if
initializer parameter is null,
removes the initializer from the field declaration. |
void |
setMirror(TreeElement element) |
java.lang.String |
toString()
toString() should never be presented to the user.
|
getDocComment, getName, getNameIdentifier, setNamegetContainingFile, getElementType, getFirstChild, getLastChild, getManager, getNextSibling, getParent, getPrevSibling, getStub, isPhysicaladd, 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, textToCharArrayacceptChildren, addRange, addRangeAfter, addRangeBefore, canNavigate, canNavigateToSource, deleteChildRange, findChildByClass, findChildrenByClass, findNotNullChildByClass, getContext, getOriginalElement, getProject, getReference, getReferences, getResolveScope, navigate, notNullChild, processDeclarations, textContainsbuildRowIcon, computeBaseIcon, createLayeredIcon, getAdjustedBaseIcon, getBaseIcon, getIcon, iconWithVisibilityIfNeeded, isNativeFileType, overlayIcons, registerIconLayer, transformFlagschangeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMapequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetName, getNameIdentifiergetAnnotation, getAnnotations, getSourceElement, hasAnnotation, hasModifiergetDocCommentsetNamegetIdentifyingElementisWritablepublic ClsFieldImpl(PsiFieldStub stub)
public PsiElement [] getChildren()
PsiElementgetChildren in interface PsiElementgetChildren in class ClsRepositoryPsiElement<PsiFieldStub>public PsiClass getContainingClass()
PsiMembergetContainingClass in interface JvmMembergetContainingClass in interface PsiJvmMembergetContainingClass in interface PsiMemberMember.getDeclaringClass()public PsiType getType()
PsiVariablepublic PsiTypeElement getTypeElement()
PsiVariablegetTypeElement in interface PsiVariablepublic 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 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 java.lang.Object computeConstantValue()
PsiVariablecomputeConstantValue in interface PsiVariablepublic java.lang.Object computeConstantValue(java.util.Set<PsiVariable> visitedVars)
computeConstantValue in interface PsiVariableExpublic boolean isDeprecated()
PsiDocCommentOwnertrue if the element is marked as deprecated via an annotation or a JavaDoc tag.isDeprecated in interface PsiDocCommentOwnerpublic 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 void appendMirrorText(int indentLevel,
java.lang.StringBuilder buffer)
appendMirrorText in class ClsElementImplpublic void setMirror(TreeElement element) throws ClsElementImpl.InvalidMirrorException
setMirror in class ClsElementImplClsElementImpl.InvalidMirrorExceptionpublic void accept(PsiElementVisitor visitor)
PsiElementaccept in interface PsiElementaccept in class PsiElementBasevisitor - the visitor to pass the element to.public PsiElement getNavigationElement()
PsiElementthis or substitute a different element if this element
does not have an associated file and offset. (For example, if the source code
of a library is attached to a project, the navigation element for a compiled
library class is its source class.)getNavigationElement in interface PsiElementgetNavigationElement in interface PsiTargetgetNavigationElement in class PsiElementBasepublic 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 javax.swing.Icon getElementIcon(int flags)
getElementIcon in class ElementBasepublic 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 PsiElementBasepublic SearchScope getUseScope()
PsiElementgetUseScope in interface PsiElementgetUseScope in class PsiElementBasePsiSearchHelper.getUseScope(PsiElement)protected boolean isVisibilitySupported()
isVisibilitySupported in class ElementBasepublic java.lang.String toString()
PsiElementtoString in interface PsiElementtoString in class java.lang.Object