public class ClsClassImpl extends ClsMemberImpl<PsiClassStub<?>> implements PsiExtensibleClass, Queryable
ClsElementImpl.InvalidMirrorException
Iconable.IconFlags, Iconable.LastComputedIcon
Queryable.Contributor, Queryable.PrintInfo, Queryable.Util
Modifier and Type | Field and Description |
---|---|
static Key<PsiClass> |
DELEGATE_KEY |
COMPILED_ELEMENT, NEXT_LINE
FLAGS_LOCKED, ICON_PLACEHOLDER
ARRAY_FACTORY, EMPTY_ARRAY
EMPTY_NAVIGATABLE_ELEMENT_ARRAY
EMPTY_NAVIGATION_ITEM_ARRAY
ICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITY
Constructor and Description |
---|
ClsClassImpl(PsiClassStub 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) |
PsiField |
findFieldByName(java.lang.String name,
boolean checkBases)
Searches the class (and optionally its superclasses) for the field with the specified name.
|
PsiClass |
findInnerClassByName(java.lang.String name,
boolean checkBases)
Searches the class (and optionally its superclasses) for the inner class with the specified name.
|
PsiMethod |
findMethodBySignature(PsiMethod patternMethod,
boolean checkBases)
Searches the class (and optionally its superclasses) for the method with
the signature matching the signature of the specified method.
|
java.util.List<Pair<PsiMethod,PsiSubstitutor>> |
findMethodsAndTheirSubstitutorsByName(java.lang.String name,
boolean checkBases)
Searches the class (and optionally its superclasses) for the methods with the specified name
and returns the methods along with their substitutors.
|
PsiMethod [] |
findMethodsByName(java.lang.String name,
boolean checkBases)
Searches the class (and optionally its superclasses) for the methods with the specified name.
|
PsiMethod [] |
findMethodsBySignature(PsiMethod patternMethod,
boolean checkBases)
Searches the class (and optionally its superclasses) for the methods with the signature
matching the signature of the specified method.
|
PsiField [] |
getAllFields()
Returns the list of fields in the class and all its superclasses.
|
PsiClass [] |
getAllInnerClasses()
Returns the list of inner classes for the class and all its superclasses.
|
PsiMethod [] |
getAllMethods()
Returns the list of methods in the class and all its superclasses.
|
java.util.List<Pair<PsiMethod,PsiSubstitutor>> |
getAllMethodsAndTheirSubstitutors()
Returns the list of methods in the class and all its superclasses, along with their
substitutors.
|
PsiElement [] |
getChildren()
Returns the array of children for the PSI element.
|
PsiMethod [] |
getConstructors()
Returns the list of constructors for the class.
|
PsiClass |
getContainingClass()
For an inner class, returns its containing class.
|
javax.swing.Icon |
getElementIcon(int flags) |
PsiReferenceList |
getExtendsList()
Returns the list of classes that this class or interface extends.
|
PsiClassType [] |
getExtendsListTypes()
Returns the list of class types for the classes that this class or interface extends.
|
PsiField [] |
getFields()
Returns the list of fields in the class.
|
PsiReferenceList |
getImplementsList()
Returns the list of interfaces that this class implements.
|
PsiClassType [] |
getImplementsListTypes()
Returns the list of class types for the interfaces that this class implements.
|
PsiClassInitializer [] |
getInitializers()
Returns the list of class initializers for the class.
|
PsiClass [] |
getInnerClasses()
Returns the list of inner classes for the class.
|
PsiClass [] |
getInterfaces()
Returns the list of interfaces implemented by the class, or extended by the interface.
|
PsiJavaToken |
getLBrace()
Returns the token representing the opening curly brace of the class.
|
PsiMethod [] |
getMethods()
Returns the list of methods in the class.
|
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.
|
java.util.List<PsiField> |
getOwnFields() |
java.util.List<PsiClass> |
getOwnInnerClasses() |
java.util.List<PsiMethod> |
getOwnMethods() |
ItemPresentation |
getPresentation() |
java.lang.String |
getQualifiedName()
Returns the fully qualified name of the class.
|
PsiJavaToken |
getRBrace()
Returns the token representing the closing curly brace of the class.
|
PsiElement |
getScope()
Returns the PSI member in which the class has been declared (for example,
the method containing the anonymous inner class, or the file containing a regular
class, or the class owning a type parameter).
|
java.lang.String |
getSourceFileName() |
PsiClass |
getSourceMirrorClass() |
PsiClass |
getSuperClass()
Returns the base class of this class.
|
PsiClass [] |
getSupers()
Returns the list of classes and interfaces extended or implemented by the class.
|
PsiClassType [] |
getSuperTypes()
Returns the list of class types for the classes and interfaces extended or
implemented by the class.
|
PsiTypeParameterList |
getTypeParameterList()
Returns the type parameter list for the element.
|
PsiTypeParameter [] |
getTypeParameters()
Returns the array of type parameters for the element.
|
SearchScope |
getUseScope()
Returns the scope in which references to this element are searched.
|
java.util.Collection<HierarchicalMethodSignature> |
getVisibleSignatures()
Returns the hierarchical signatures for all methods in the specified class and
its superclasses and superinterfaces.
|
boolean |
hasModifierProperty(java.lang.String name)
Checks if the element has the specified modifier.
|
boolean |
hasTypeParameters()
Checks if the element has any type parameters.
|
boolean |
isAnnotationType()
Checks if the class is an annotation type.
|
boolean |
isAnonymousClass() |
boolean |
isDeprecated()
Returns
true if the element is marked as deprecated via an annotation or a JavaDoc tag. |
boolean |
isEnum()
Checks if the class is an enumeration.
|
boolean |
isEquivalentTo(PsiElement another)
This method shouldn't be called by clients directly, because there are no guarantees of it being symmetric.
|
boolean |
isInheritor(PsiClass baseClass,
boolean checkDeep)
Checks if this class is an inheritor of the specified base class.
|
boolean |
isInheritorDeep(PsiClass baseClass,
PsiClass classToByPass)
Checks if this class is a deep inheritor of the specified base class possibly bypassing a class
when checking inheritance chain.
|
boolean |
isInterface()
Checks if the class is an interface.
|
protected boolean |
isVisibilitySupported() |
boolean |
processDeclarations(PsiScopeProcessor processor,
ResolveState state,
PsiElement lastParent,
PsiElement place)
Passes the declarations contained in this PSI element and its children
for processing to the specified scope processor.
|
void |
putInfo(java.util.Map<java.lang.String,java.lang.String> info) |
void |
setMirror(TreeElement element) |
java.lang.String |
toString()
toString() should never be presented to the user.
|
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, 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
findMethodsByName, getClassKind, getInterfaceTypes, getNameIdentifier, getRecordComponents, getRecordHeader, getSuperClassType, isRecord, setName
getIdentifyingElement
getDocComment
getName
canNavigate, canNavigateToSource, navigate
getAnnotation, getAnnotations, getSourceElement, hasAnnotation, hasModifier
acceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, checkAdd, checkDelete, copy, delete, deleteChildRange, findElementAt, findReferenceAt, getContainingFile, getContext, getCopyableUserData, getFirstChild, getLanguage, getLastChild, getManager, getNextSibling, getNode, getOriginalElement, getOwnReferences, getParent, getPrevSibling, getProject, getReference, getReferences, getResolveScope, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, getTextRangeInParent, isPhysical, isValid, isWritable, putCopyableUserData, replace, textContains, textMatches, textMatches, textToCharArray
getUserData, putUserData
getName
isWritable
getName
public ClsClassImpl(PsiClassStub stub)
public PsiElement [] getChildren()
PsiElement
getChildren
in interface PsiElement
getChildren
in class ClsRepositoryPsiElement<PsiClassStub<?>>
public PsiTypeParameterList getTypeParameterList()
PsiTypeParameterListOwner
getTypeParameterList
in interface PsiTypeParameterListOwner
public boolean hasTypeParameters()
PsiTypeParameterListOwner
hasTypeParameters
in interface PsiTypeParameterListOwner
public java.lang.String getQualifiedName()
PsiClass
getQualifiedName
in interface JvmClass
getQualifiedName
in interface PsiClass
getQualifiedName
in interface PsiQualifiedNamedElement
Class.getCanonicalName()
public boolean isAnonymousClass()
public PsiModifierList getModifierList()
PsiModifierListOwner
getModifierList
in interface PsiModifierListOwner
public boolean hasModifierProperty(java.lang.String name)
PsiModifierListOwner
PsiModifier
class.hasModifierProperty
in interface PsiModifierListOwner
name
- the name of the modifier to check.public PsiReferenceList getExtendsList()
PsiClass
getExtendsList
in interface PsiClass
public PsiReferenceList getImplementsList()
PsiClass
getImplementsList
in interface PsiClass
public PsiClassType [] getExtendsListTypes()
PsiClass
getExtendsListTypes
in interface PsiClass
public PsiClassType [] getImplementsListTypes()
PsiClass
getImplementsListTypes
in interface PsiClass
public PsiClass getSuperClass()
PsiClass
getSuperClass
in interface PsiClass
public PsiClass [] getInterfaces()
PsiClass
getInterfaces
in interface PsiClass
public PsiClass [] getSupers()
PsiClass
public PsiClassType [] getSuperTypes()
PsiClass
getSuperTypes
in interface PsiClass
public PsiClass getContainingClass()
PsiClass
getContainingClass
in interface JvmMember
getContainingClass
in interface PsiClass
getContainingClass
in interface PsiJvmMember
getContainingClass
in interface PsiMember
Member.getDeclaringClass()
public java.util.Collection<HierarchicalMethodSignature> getVisibleSignatures()
PsiClass
getVisibleSignatures
in interface PsiClass
public PsiField [] getFields()
PsiClass
public PsiMethod [] getMethods()
PsiClass
getMethods
in interface JvmClass
getMethods
in interface PsiClass
Class.getDeclaredMethods()
,
Class.getDeclaredConstructors()
public PsiMethod [] getConstructors()
PsiClass
getConstructors
in interface PsiClass
public PsiClass [] getInnerClasses()
PsiClass
getInnerClasses
in interface JvmClass
getInnerClasses
in interface PsiClass
Class.getDeclaredClasses()
public java.util.List<PsiField> getOwnFields()
getOwnFields
in interface PsiExtensibleClass
public java.util.List<PsiMethod> getOwnMethods()
getOwnMethods
in interface PsiExtensibleClass
public java.util.List<PsiClass> getOwnInnerClasses()
getOwnInnerClasses
in interface PsiExtensibleClass
public PsiClassInitializer [] getInitializers()
PsiClass
getInitializers
in interface PsiClass
public PsiTypeParameter [] getTypeParameters()
PsiTypeParameterListOwner
getTypeParameters
in interface JvmTypeParametersOwner
getTypeParameters
in interface PsiTypeParameterListOwner
GenericDeclaration.getTypeParameters()
public PsiField [] getAllFields()
PsiClass
getAllFields
in interface PsiClass
public PsiMethod [] getAllMethods()
PsiClass
getAllMethods
in interface PsiClass
public PsiClass [] getAllInnerClasses()
PsiClass
getAllInnerClasses
in interface PsiClass
public PsiField findFieldByName(java.lang.String name, boolean checkBases)
PsiClass
findFieldByName
in interface PsiClass
name
- the name of the field to find.checkBases
- if true, the field is also searched in the base classes of the class.public PsiMethod findMethodBySignature(PsiMethod patternMethod, boolean checkBases)
PsiClass
findMethodBySignature
in interface PsiClass
patternMethod
- the method used as a pattern for the search.checkBases
- if true, the method is also searched in the base classes of the class.public PsiMethod [] findMethodsBySignature(PsiMethod patternMethod, boolean checkBases)
PsiClass
findMethodsBySignature
in interface PsiClass
patternMethod
- the method used as a pattern for the search.checkBases
- if true, the method is also searched in the base classes of the class.public PsiMethod [] findMethodsByName(java.lang.String name, boolean checkBases)
PsiClass
findMethodsByName
in interface PsiClass
name
- the name of the methods to find.checkBases
- if true, the methods are also searched in the base classes of the class.public java.util.List<Pair<PsiMethod,PsiSubstitutor>> findMethodsAndTheirSubstitutorsByName(java.lang.String name, boolean checkBases)
PsiClass
findMethodsAndTheirSubstitutorsByName
in interface PsiClass
name
- the name of the methods to find.checkBases
- if true, the methods are also searched in the base classes of the class.public java.util.List<Pair<PsiMethod,PsiSubstitutor>> getAllMethodsAndTheirSubstitutors()
PsiClass
getAllMethodsAndTheirSubstitutors
in interface PsiClass
public PsiClass findInnerClassByName(java.lang.String name, boolean checkBases)
PsiClass
findInnerClassByName
in interface PsiClass
name
- the name of the inner class to find.checkBases
- if true, the inner class is also searched in the base classes of the class.public boolean isDeprecated()
PsiDocCommentOwner
true
if the element is marked as deprecated via an annotation or a JavaDoc tag.isDeprecated
in interface PsiDocCommentOwner
public java.lang.String getSourceFileName()
public PsiJavaToken getLBrace()
PsiClass
public PsiJavaToken getRBrace()
PsiClass
public boolean isInterface()
PsiClass
isInterface
in interface PsiClass
public boolean isAnnotationType()
PsiClass
isAnnotationType
in interface PsiClass
public boolean isEnum()
PsiClass
public void appendMirrorText(int indentLevel, java.lang.StringBuilder buffer)
appendMirrorText
in class ClsElementImpl
public void setMirror(TreeElement element) throws ClsElementImpl.InvalidMirrorException
setMirror
in class ClsElementImpl
ClsElementImpl.InvalidMirrorException
public void accept(PsiElementVisitor visitor)
PsiElement
accept
in interface PsiElement
accept
in class PsiElementBase
visitor
- the visitor to pass the element to.public java.lang.String toString()
PsiElement
toString
in interface PsiElement
toString
in class java.lang.Object
public boolean processDeclarations(PsiScopeProcessor processor, ResolveState state, PsiElement lastParent, PsiElement place)
PsiElement
processDeclarations
in interface PsiElement
processDeclarations
in class PsiElementBase
processor
- the processor receiving the declarations.lastParent
- the child of this element has been processed during the previous
step of the tree up walk (declarations under this element do not need
to be processed again)place
- the original element from which the tree up walk was initiated.public PsiElement getScope()
PsiClass
public boolean isInheritorDeep(PsiClass baseClass, PsiClass classToByPass)
PsiClass
ClassInheritorsSearch
may return classes that are inheritors in broader, e.g. in ejb sense, but not in java sense.isInheritorDeep
in interface PsiClass
baseClass
- the base class to check the inheritance.
searched in the entire inheritance chainclassToByPass
- class to bypass the inheritance check forpublic boolean isInheritor(PsiClass baseClass, boolean checkDeep)
PsiClass
ClassInheritorsSearch
may return classes that are inheritors in broader, e.g. in ejb sense, but not in java sense.isInheritor
in interface PsiClass
baseClass
- the base class to check the inheritance.checkDeep
- if false, only direct inheritance is checked; if true, the base class is
searched in the entire inheritance chainpublic PsiClass getSourceMirrorClass()
public PsiElement getNavigationElement()
PsiElement
this
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 PsiElement
getNavigationElement
in interface PsiTarget
getNavigationElement
in class PsiElementBase
public ItemPresentation getPresentation()
getPresentation
in interface NavigationItem
getPresentation
in class PsiElementBase
public javax.swing.Icon getElementIcon(int flags)
getElementIcon
in class ElementBase
public boolean isEquivalentTo(PsiElement another)
PsiElement
PsiManager.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 PsiElement
isEquivalentTo
in class PsiElementBase
public SearchScope getUseScope()
PsiElement
getUseScope
in interface PsiElement
getUseScope
in class PsiElementBase
PsiSearchHelper.getUseScope(PsiElement)
public void putInfo(java.util.Map<java.lang.String,java.lang.String> info)
protected boolean isVisibilitySupported()
isVisibilitySupported
in class ElementBase