com.intellij.psi
Class PsiClassType

java.lang.Object
  extended by com.intellij.psi.PsiType
      extended by com.intellij.psi.PsiClassType

public abstract class PsiClassType
extends PsiType

Represents a class type.


Nested Class Summary
static interface PsiClassType.ClassResolveResult
          Represents the result of resolving a reference to a Java class.
 
Field Summary
static PsiClassType[] EMPTY_ARRAY
          The empty array of PSI class types which can be reused to avoid unnecessary allocations.
 
Fields inherited from class com.intellij.psi.PsiType
BOOLEAN, BYTE, CHAR, DOUBLE, FLOAT, INT, LONG, NULL, SHORT, VOID
 
Constructor Summary
PsiClassType()
           
 
Method Summary
<A> A
accept(PsiTypeVisitor<A> visitor)
          Passes the type to the specified visitor.
 boolean equals(java.lang.Object obj)
           
abstract  java.lang.String getClassName()
          Returns the non-qualified name of the class referenced by the type.
abstract  PsiType[] getParameters()
          Returns the list of type arguments for the type.
 PsiType[] getSuperTypes()
          Returns the list of superclass types for a class type.
 int hashCode()
           
 boolean hasNonTrivialParameters()
          Checks if the class type has any parameters which are not unbounded wildcards and do not have substituted arguments.
 boolean hasParameters()
          Checks if the class type has any parameters with no substituted arguments.
 boolean isRaw()
          Checks whether this type is a raw type.
static boolean isRaw(PsiClassType.ClassResolveResult resolveResult)
          Checks whether the specified resolve result representss a raw type.
abstract  PsiClassType rawType()
          Returns the raw type (with no values assigned to type parameters) corresponding to this type.
abstract  PsiClass resolve()
          Resolves the class reference and returns the resulting class.
abstract  PsiClassType.ClassResolveResult resolveGenerics()
          Returns the resolve result containing the class referenced by the class type and the substitutor which can substitute the values of type arguments used in the class type declaration.
 
Methods inherited from class com.intellij.psi.PsiType
createArrayType, equalsToText, getArrayDimensions, getCanonicalText, getDeepComponentType, getInternalCanonicalText, getJavaLangClass, getJavaLangError, getJavaLangObject, getJavaLangRuntimeException, getJavaLangString, getJavaLangTrowable, getPresentableText, getResolveScope, isAssignableFrom, isConvertibleFrom, isValid, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_ARRAY

public static final PsiClassType[] EMPTY_ARRAY
The empty array of PSI class types which can be reused to avoid unnecessary allocations.

Constructor Detail

PsiClassType

public PsiClassType()
Method Detail

resolve

@Nullable
public abstract PsiClass resolve()
Resolves the class reference and returns the resulting class.

Returns:
the class instance, or null if the reference resolve failed.

getClassName

public abstract java.lang.String getClassName()
Returns the non-qualified name of the class referenced by the type.

Returns:
the name of the class.

getParameters

@NotNull
public abstract PsiType[] getParameters()
Returns the list of type arguments for the type.

Returns:
the array of type arguments, or an empty array if the type does not point to a generic class or interface.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hasParameters

public boolean hasParameters()
Checks if the class type has any parameters with no substituted arguments.

Returns:
true if the class type has non-substituted parameters, false otherwise

hasNonTrivialParameters

public boolean hasNonTrivialParameters()
Checks if the class type has any parameters which are not unbounded wildcards and do not have substituted arguments.

Returns:
true if the class type has nontrivial non-substituted parameters, false otherwise

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getSuperTypes

@NotNull
public PsiType[] getSuperTypes()
Description copied from class: PsiType
Returns the list of superclass types for a class type.

Specified by:
getSuperTypes in class PsiType
Returns:
the array of superclass types, or an empty array if the type is not a class type.

isRaw

public static boolean isRaw(PsiClassType.ClassResolveResult resolveResult)
Checks whether the specified resolve result representss a raw type.
Raw type is a class type for a class with type parameters which does not assign any value to them. If a class does not have any type parameters, it cannot generate any raw type.


isRaw

public boolean isRaw()
Checks whether this type is a raw type.
Raw type is a class type for a class with type parameters which does not assign any value to them. If a class does not have any type parameters, it cannot generate any raw type.


resolveGenerics

@NotNull
public abstract PsiClassType.ClassResolveResult resolveGenerics()
Returns the resolve result containing the class referenced by the class type and the substitutor which can substitute the values of type arguments used in the class type declaration.

Returns:
the resolve result instance.

rawType

@NotNull
public abstract PsiClassType rawType()
Returns the raw type (with no values assigned to type parameters) corresponding to this type.

Returns:
the raw type instance.

accept

public <A> A accept(PsiTypeVisitor<A> visitor)
Description copied from class: PsiType
Passes the type to the specified visitor.

Specified by:
accept in class PsiType
Parameters:
visitor - the visitor to accept the type.
Returns:
the value returned by the visitor.