public final class EmptySubstitutor extends java.lang.Object implements PsiSubstitutor
PsiSubstitutor.EMPTY
EMPTY, KEY, UNKNOWN
Constructor and Description |
---|
EmptySubstitutor() |
Modifier and Type | Method and Description |
---|---|
void |
ensureValid()
If this substitutor is not valid, throws an exception with some diagnostics
|
static EmptySubstitutor |
getInstance() |
java.util.Map<PsiTypeParameter,PsiType> |
getSubstitutionMap()
Returns the map from type parameters to types used for substitution by this substitutor.
|
boolean |
isValid()
Checks if all types which the substitutor can substitute are valid.
|
PsiSubstitutor |
put(PsiTypeParameter classParameter,
PsiType mapping)
Creates a substitutor instance which provides the specified parameter to type mapping in addition
to mappings contained in this substitutor.
|
PsiSubstitutor |
putAll(java.util.Map<? extends PsiTypeParameter,? extends PsiType> map)
Creates a substitutor instance containing all mappings from this substitutor and the
specified map.
|
PsiSubstitutor |
putAll(PsiClass parentClass,
PsiType[] mappings)
Creates a substitutor instance which maps the type parameters of the specified class to the
specified types in addition to mappings contained in this substitutor.
|
PsiSubstitutor |
putAll(PsiSubstitutor another)
Creates a substitutor instance containing all mappings from this substitutor and the
specified substitutor.
|
PsiType |
substitute(PsiType type)
Substitutes type parameters occurring in
type with their values. |
PsiType |
substitute(PsiTypeParameter typeParameter)
Returns a mapping that this substitutor contains for a given type parameter.
|
PsiType |
substituteWithBoundsPromotion(PsiTypeParameter typeParameter) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createSubstitutor
public static EmptySubstitutor getInstance()
public PsiType substitute(PsiTypeParameter typeParameter)
PsiSubstitutor
substitute
in interface PsiSubstitutor
typeParameter
- the parameter to return the mapping for.null
for a raw type.public PsiType substitute(PsiType type)
PsiSubstitutor
type
with their values.
If value for type parameter is null
, appropriate erasure is returned.substitute
in interface PsiSubstitutor
type
- the type to substitute the type parameters for.public PsiType substituteWithBoundsPromotion(PsiTypeParameter typeParameter)
substituteWithBoundsPromotion
in interface PsiSubstitutor
public PsiSubstitutor put(PsiTypeParameter classParameter, PsiType mapping)
PsiSubstitutor
put
in interface PsiSubstitutor
classParameter
- the parameter which is mapped.mapping
- the type to which the parameter is mapped.public PsiSubstitutor putAll(PsiClass parentClass, PsiType[] mappings)
PsiSubstitutor
putAll
in interface PsiSubstitutor
parentClass
- the class whose parameters are mapped.mappings
- the types to which the parameters are mapped.public PsiSubstitutor putAll(PsiSubstitutor another)
PsiSubstitutor
putAll
in interface PsiSubstitutor
another
- the substitutor to get the mappings from.public PsiSubstitutor putAll(java.util.Map<? extends PsiTypeParameter,? extends PsiType> map)
PsiSubstitutor
putAll
in interface PsiSubstitutor
map
- a map which contains additional mappingspublic java.util.Map<PsiTypeParameter,PsiType> getSubstitutionMap()
PsiSubstitutor
getSubstitutionMap
in interface PsiSubstitutor
public boolean isValid()
PsiSubstitutor
isValid
in interface PsiSubstitutor
PsiType.isValid()
public void ensureValid()
PsiSubstitutor
ensureValid
in interface PsiSubstitutor
public java.lang.String toString()
toString
in class java.lang.Object