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
ConstructorDescriptionRtParameter(String name, Class<?> type, Type genericType, RtMethod method, Constructor constructor, int index)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares based on the executable and the index.Return annotations which declared on the parameter.getName()
Returns the name of the parameter.Class<?>
getType()
Returns theClass
which is the type of the parameter.int
hashCode()
Returns a hash code based on the executable's hash code and the index.boolean
Returnstrue
if this parameter represents a variable argument list; returnsfalse
otherwise.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 theClass
which 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()Returnstrue
if this parameter represents a variable argument list; returnsfalse
otherwise.- Returns:
true
if 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.
-