public class TypeUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
@Nullable ArgType |
checkForUnknownTypeVars(MethodNode mth,
ArgType checkType)
Search for unknown type vars at current method.
|
boolean |
containsUnknownTypeVar(MethodNode mth,
ArgType type) |
ArgType |
expandTypeVariables(ClassNode cls,
ArgType type) |
ArgType |
expandTypeVariables(MethodNode mth,
ArgType type) |
java.util.List<ArgType> |
getClassGenerics(ArgType type) |
@Nullable ClassTypeVarsAttr |
getClassTypeVars(ArgType type) |
java.util.Set<ArgType> |
getKnownTypeVarsAtMethod(MethodNode mth) |
java.util.Map<ArgType,ArgType> |
getTypeVariablesMapping(ArgType clsType) |
java.util.Map<ArgType,ArgType> |
getTypeVarMappingForInvoke(BaseInvokeNode invokeInsn) |
@Nullable ArgType |
replaceClassGenerics(ArgType instanceType,
ArgType typeWithGeneric)
Replace generic types in
typeWithGeneric using instance types
Example: instanceType: Set<String>
typeWithGeneric: Iterator<E>
return: Iterator<String>
|
@Nullable ArgType |
replaceClassGenerics(ArgType instanceType,
ArgType genericSourceType,
ArgType typeWithGeneric) |
@Nullable ArgType |
replaceMethodGenerics(BaseInvokeNode invokeInsn,
IMethodDetails details,
ArgType typeWithGeneric) |
@Nullable ArgType |
replaceTypeVariablesUsingMap(ArgType replaceType,
java.util.Map<ArgType,ArgType> replaceMap) |
void |
visitSuperTypes(ArgType type,
java.util.function.BiConsumer<ArgType,ArgType> consumer) |
public TypeUtils(RootNode rootNode)
@Nullable public @Nullable ClassTypeVarsAttr getClassTypeVars(ArgType type)
public ArgType expandTypeVariables(MethodNode mth, ArgType type)
public java.util.Set<ArgType> getKnownTypeVarsAtMethod(MethodNode mth)
@Nullable public @Nullable ArgType checkForUnknownTypeVars(MethodNode mth, ArgType checkType)
public boolean containsUnknownTypeVar(MethodNode mth, ArgType type)
@Nullable public @Nullable ArgType replaceClassGenerics(ArgType instanceType, ArgType typeWithGeneric)
typeWithGeneric using instance types
instanceType: Set<String>
typeWithGeneric: Iterator<E>
return: Iterator<String>
@Nullable public @Nullable ArgType replaceClassGenerics(ArgType instanceType, ArgType genericSourceType, ArgType typeWithGeneric)
public java.util.Map<ArgType,ArgType> getTypeVariablesMapping(ArgType clsType)
public java.util.Map<ArgType,ArgType> getTypeVarMappingForInvoke(BaseInvokeNode invokeInsn)
@Nullable public @Nullable ArgType replaceMethodGenerics(BaseInvokeNode invokeInsn, IMethodDetails details, ArgType typeWithGeneric)
@Nullable public @Nullable ArgType replaceTypeVariablesUsingMap(ArgType replaceType, java.util.Map<ArgType,ArgType> replaceMap)