Class MethodTypeInfo
- java.lang.Object
-
- com.tonic.analysis.execution.dispatch.MethodTypeInfo
-
public final class MethodTypeInfo extends Object
A CONSTANT_MethodType entry wrapping a method descriptor with parsing helpers.
-
-
Constructor Summary
Constructors Constructor Description MethodTypeInfo(String descriptor)Creates a method type wrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDescriptor()intgetParameterCount()Counts the parameters declared in the descriptor.intgetParameterSlots()Counts the local-variable slots consumed by the parameters.String[]getParameterTypes()Parses the parameter type descriptors out of the method descriptor.StringgetReturnType()Extracts the return type from the descriptor.booleanisVoidReturn()Checks whether the method type returns void.StringtoString()
-
-
-
Constructor Detail
-
MethodTypeInfo
public MethodTypeInfo(String descriptor)
Creates a method type wrapper.- Parameters:
descriptor- the method descriptor to parse
-
-
Method Detail
-
getDescriptor
public String getDescriptor()
- Returns:
- the descriptor
-
getReturnType
public String getReturnType()
Extracts the return type from the descriptor.- Returns:
- the return type descriptor, or "V" if it cannot be parsed
-
isVoidReturn
public boolean isVoidReturn()
Checks whether the method type returns void.- Returns:
- true if the return type is "V"
-
getParameterCount
public int getParameterCount()
Counts the parameters declared in the descriptor.- Returns:
- the number of parameters
-
getParameterTypes
public String[] getParameterTypes()
Parses the parameter type descriptors out of the method descriptor.- Returns:
- the parameter descriptors in order, empty for a missing or malformed descriptor
-
getParameterSlots
public int getParameterSlots()
Counts the local-variable slots consumed by the parameters.- Returns:
- the total slot count, with long and double counting as two
-
-