com.intellij.psi
Class PsiWildcardType

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

public class PsiWildcardType
extends PsiType

Represents a wildcard type, with bounds.


Field Summary
 
Fields inherited from class com.intellij.psi.PsiType
BOOLEAN, BYTE, CHAR, DOUBLE, EMPTY_ARRAY, FLOAT, INT, LONG, NULL, SHORT, VOID
 
Method Summary
<A> A
accept(PsiTypeVisitor<A> visitor)
          Passes the type to the specified visitor.
static PsiWildcardType changeBound(PsiWildcardType type, PsiType newBound)
           
static PsiWildcardType createExtends(PsiManager manager, PsiType bound)
           
static PsiWildcardType createSuper(PsiManager manager, PsiType bound)
           
static PsiWildcardType createUnbounded(PsiManager manager)
           
 boolean equals(java.lang.Object o)
           
 boolean equalsToText(java.lang.String text)
          Checks if the specified string is equivalent to the canonical text of the type.
 PsiType getBound()
          Use this method to obtain a bound of wildcard type.
 java.lang.String getCanonicalText()
           
 PsiType getExtendsBound()
          A lower bound that this wildcard imposes on type parameter value.
 java.lang.String getInternalCanonicalText()
           
 PsiManager getManager()
           
 java.lang.String getPresentableText()
          Returns text of this type that can be presented to user.
 GlobalSearchScope getResolveScope()
          Returns the scope in which the reference to the underlying class of a class type is searched.
 PsiType getSuperBound()
          An upper bound that this wildcard imposes on type parameter value.
 PsiType[] getSuperTypes()
          Returns the list of superclass types for a class type.
 int hashCode()
           
 boolean isExtends()
          Returns whether this is a lower bound (?
 boolean isSuper()
          Returns whether this is an upper bound (?
 boolean isValid()
          Checks if the type is currently valid.
 
Methods inherited from class com.intellij.psi.PsiType
createArrayType, getArrayDimensions, getDeepComponentType, getJavaLangClass, getJavaLangError, getJavaLangObject, getJavaLangRuntimeException, getJavaLangString, getJavaLangTrowable, isAssignableFrom, isConvertibleFrom, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

createUnbounded

public static PsiWildcardType createUnbounded(PsiManager manager)

createExtends

public static PsiWildcardType createExtends(PsiManager manager,
                                            PsiType bound)

createSuper

public static PsiWildcardType createSuper(PsiManager manager,
                                          PsiType bound)

changeBound

public static PsiWildcardType changeBound(PsiWildcardType type,
                                          PsiType newBound)

getPresentableText

public java.lang.String getPresentableText()
Description copied from class: PsiType
Returns text of this type that can be presented to user.

Specified by:
getPresentableText in class PsiType

getCanonicalText

public java.lang.String getCanonicalText()
Specified by:
getCanonicalText in class PsiType

getInternalCanonicalText

public java.lang.String getInternalCanonicalText()
Specified by:
getInternalCanonicalText in class PsiType

getResolveScope

public GlobalSearchScope getResolveScope()
Description copied from class: PsiType
Returns the scope in which the reference to the underlying class of a class type is searched.

Specified by:
getResolveScope in class PsiType
Returns:
the resolve scope instance, or null if the type is a primitive or an array of primitives.

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.

equalsToText

public boolean equalsToText(java.lang.String text)
Description copied from class: PsiType
Checks if the specified string is equivalent to the canonical text of the type.

Specified by:
equalsToText in class PsiType
Parameters:
text - the text to compare with.
Returns:
true if the string is equivalent to the type, false otherwise

getManager

public PsiManager getManager()

equals

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

hashCode

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

getBound

public PsiType getBound()
Use this method to obtain a bound of wildcard type.

Returns:
null if unbounded, a bound otherwise.

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.

isValid

public boolean isValid()
Description copied from class: PsiType
Checks if the type is currently valid.

Specified by:
isValid in class PsiType
Returns:
true if the type is valid, false otherwise.
See Also:
PsiElement.isValid()

isExtends

public boolean isExtends()
Returns whether this is a lower bound (? extends XXX).

Returns:
true for extends wildcards, false for super and unbounded wildcards.

isSuper

public boolean isSuper()
Returns whether this is an upper bound (? super XXX).

Returns:
true for super wildcards, false for extends and unbounded wildcards.

getExtendsBound

public PsiType getExtendsBound()
A lower bound that this wildcard imposes on type parameter value.
That is:

Returns:
PsiType representing a lower bound. Never returns null.

getSuperBound

public PsiType getSuperBound()
An upper bound that this wildcard imposes on type parameter value.
That is:

Returns:
PsiType representing an upper bound. Never returns null.