public interface PsiSubstitutor
JavaResolveResult.getSubstitutor()
Modifier and Type | Field and Description |
---|---|
static PsiSubstitutor |
EMPTY
Empty, or natural, substitutor.
|
static Key<PsiSubstitutor> |
KEY |
static PsiSubstitutor |
UNKNOWN |
Modifier and Type | Method and Description |
---|---|
static PsiSubstitutor |
createSubstitutor(java.util.Map<? extends PsiTypeParameter,? extends PsiType> map)
Create a substitutor from the supplied map
|
void |
ensureValid()
If this substitutor is not valid, throws an exception with some diagnostics
|
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.
|
default 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) |
static final PsiSubstitutor EMPTY
T
,
substitutes type T
.
Example: consider class List<E>
. this
inside class List
has type List with EMPTY substitutor.static final Key<PsiSubstitutor> KEY
static final PsiSubstitutor UNKNOWN
PsiType substitute(PsiTypeParameter typeParameter)
typeParameter
- the parameter to return the mapping for.null
for a raw type.PsiType substitute(PsiType type)
type
with their values.
If value for type parameter is null
, appropriate erasure is returned.type
- the type to substitute the type parameters for.PsiType substituteWithBoundsPromotion(PsiTypeParameter typeParameter)
PsiSubstitutor put(PsiTypeParameter classParameter, PsiType mapping)
classParameter
- the parameter which is mapped.mapping
- the type to which the parameter is mapped.PsiSubstitutor putAll(PsiClass parentClass, PsiType[] mappings)
parentClass
- the class whose parameters are mapped.mappings
- the types to which the parameters are mapped.PsiSubstitutor putAll(PsiSubstitutor another)
another
- the substitutor to get the mappings from.default PsiSubstitutor putAll(java.util.Map<? extends PsiTypeParameter,? extends PsiType> map)
map
- a map which contains additional mappingsjava.util.Map<PsiTypeParameter,PsiType> getSubstitutionMap()
static PsiSubstitutor createSubstitutor(java.util.Map<? extends PsiTypeParameter,? extends PsiType> map)
map
- a map to create a substitutor fromboolean isValid()
PsiType.isValid()
void ensureValid()