Class RtParameter

java.lang.Object
spoon.support.visitor.java.reflect.RtParameter

public class RtParameter extends Object
To be compatible with Java 6, RtParameter has been created from the Parameter class in Java 8.
  • Constructor Details

  • Method Details

    • getName

      public String 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

      public Class<?> getType()
      Returns the Class which is the type of the parameter.
      Returns:
      The type of the parameter.
    • getGenericType

      public Type getGenericType()
    • getDeclaredAnnotations

      public Annotation[] getDeclaredAnnotations()
      Return annotations which declared on the parameter.
      Returns:
      Annotations declared on the parameter.
    • isVarArgs

      public boolean isVarArgs()
      Returns true if this parameter represents a variable argument list; returns false otherwise.
      Returns:
      true if an only if this parameter represents a variable argument list.
    • equals

      public boolean equals(Object obj)
      Compares based on the executable and the index.
      Overrides:
      equals in class Object
      Parameters:
      obj - The object to compare.
      Returns:
      Whether or not this is equal to the argument.
    • hashCode

      public int hashCode()
      Returns a hash code based on the executable's hash code and the index.
      Overrides:
      hashCode in class Object
      Returns:
      A hash code based on the executable's hash code.
    • parametersOf

      public static RtParameter[] parametersOf(RtMethod method)
      Get parameters in a method to spoon parameters.
      Parameters:
      method - Parent executable of parameters.
      Returns:
      Parameters of the executable.
    • parametersOf

      public static RtParameter[] parametersOf(Constructor constructor)
      Get parameters in a constructor to spoon parameters.
      Parameters:
      constructor - Parent executable of parameters.
      Returns:
      Parameters of the executable.