Class RtParameter
java.lang.Object
spoon.support.visitor.java.reflect.RtParameter
To be compatible with Java 6, RtParameter has been created from
the Parameter class in Java 8.
-
Constructor Summary
ConstructorsConstructorDescriptionRtParameter(String name, Class<?> type, Type genericType, RtMethod method, Constructor constructor, int index) -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares based on the executable and the index.Return annotations which declared on the parameter.getName()Returns the name of the parameter.Class<?>getType()Returns theClasswhich is the type of the parameter.inthashCode()Returns a hash code based on the executable's hash code and the index.booleanReturnstrueif this parameter represents a variable argument list; returnsfalseotherwise.static RtParameter[]parametersOf(Constructor constructor)Get parameters in a constructor to spoon parameters.static RtParameter[]parametersOf(RtMethod method)Get parameters in a method to spoon parameters.
-
Constructor Details
-
RtParameter
public RtParameter(String name, Class<?> type, Type genericType, RtMethod method, Constructor constructor, int index)
-
-
Method Details
-
getName
Returns the name of the parameter.- Returns:
- The name of the parameter, either provided by the class file or synthesized if the class file does not provide a name.
-
getType
Returns theClasswhich is the type of the parameter.- Returns:
- The type of the parameter.
-
getGenericType
-
getDeclaredAnnotations
Return annotations which declared on the parameter.- Returns:
- Annotations declared on the parameter.
-
isVarArgs
public boolean isVarArgs()Returnstrueif this parameter represents a variable argument list; returnsfalseotherwise.- Returns:
trueif an only if this parameter represents a variable argument list.
-
equals
Compares based on the executable and the index. -
hashCode
public int hashCode()Returns a hash code based on the executable's hash code and the index. -
parametersOf
Get parameters in a method to spoon parameters.- Parameters:
method- Parent executable of parameters.- Returns:
- Parameters of the executable.
-
parametersOf
Get parameters in a constructor to spoon parameters.- Parameters:
constructor- Parent executable of parameters.- Returns:
- Parameters of the executable.
-