Class MethodTypeSignature
- java.lang.Object
-
- io.github.lukehutch.fastclasspathscanner.typesignature.HierarchicalTypeSignature
-
- io.github.lukehutch.fastclasspathscanner.typesignature.MethodTypeSignature
-
public class MethodTypeSignature extends HierarchicalTypeSignature
A method type signature (called "MethodSignature" in the classfile documentation).
-
-
Constructor Summary
Constructors Constructor Description MethodTypeSignature(List<TypeParameter> typeParameters, List<TypeSignature> paramTypes, TypeSignature resultType, List<ClassRefOrTypeVariableSignature> throwsSignatures)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)voidgetAllReferencedClassNames(Set<String> classNameListOut)Get the names of all classes referenced in the type signatureList<TypeSignature>getParameterTypeSignatures()Get the type signatures of the method parameters.TypeSignaturegetResultType()Get the result type for the method.List<ClassRefOrTypeVariableSignature>getThrowsSignatures()Get the throws type(s) for the method.List<TypeParameter>getTypeParameters()Get the type parameters for the method.inthashCode()static MethodTypeSignatureparse(ClassInfo classInfo, String typeDescriptor)Parse a method signature.static MethodTypeSignatureparse(String typeDescriptor)Parse a method signature (ignores class context, i.e.StringtoString()
-
-
-
Constructor Detail
-
MethodTypeSignature
public MethodTypeSignature(List<TypeParameter> typeParameters, List<TypeSignature> paramTypes, TypeSignature resultType, List<ClassRefOrTypeVariableSignature> throwsSignatures)
- Parameters:
typeParameters- The type parameters for the method.paramTypes- The parameter types for the method.resultType- The result type for the method.throwsSignatures- The throws signatures for the method.
-
-
Method Detail
-
getTypeParameters
public List<TypeParameter> getTypeParameters()
Get the type parameters for the method.- Returns:
- The type parameters for the method.
-
getParameterTypeSignatures
public List<TypeSignature> getParameterTypeSignatures()
Get the type signatures of the method parameters.- Returns:
- The parameter types for the method, as
TypeSignatureparsed type objects.
-
getResultType
public TypeSignature getResultType()
Get the result type for the method.- Returns:
- The result type for the method, as a
TypeSignatureparsed type object.
-
getThrowsSignatures
public List<ClassRefOrTypeVariableSignature> getThrowsSignatures()
Get the throws type(s) for the method.- Returns:
- The throws types for the method, as
TypeSignatureparsed type objects.
-
getAllReferencedClassNames
public void getAllReferencedClassNames(Set<String> classNameListOut)
Description copied from class:HierarchicalTypeSignatureGet the names of all classes referenced in the type signature- Specified by:
getAllReferencedClassNamesin classHierarchicalTypeSignature- Parameters:
classNameListOut- The set to store class names in.
-
parse
public static MethodTypeSignature parse(String typeDescriptor) throws Parser.ParseException
Parse a method signature (ignores class context, i.e. no ClassInfo needs to be provided -- this means that type variables cannot be resolved to the matching type parameter).- Parameters:
typeDescriptor- The low-level internal method type descriptor or type signature to parse.- Returns:
- The parsed type signature of the method.
- Throws:
Parser.ParseException- If method type signature could not be parsed.
-
parse
public static MethodTypeSignature parse(ClassInfo classInfo, String typeDescriptor) throws Parser.ParseException
Parse a method signature.- Parameters:
classInfo- TheClassInfoof the containing class.typeDescriptor- The type descriptor of the method.- Returns:
- The parsed method type signature.
- Throws:
Parser.ParseException- If method type signature could not be parsed.
-
-