Class Reflector

java.lang.Object
org.codehaus.groovy.runtime.Reflector

public class Reflector extends Object
Provides as alternative to reflection using bytecode generation.
  • Constructor Details

    • Reflector

      public Reflector()
  • Method Details

    • invoke

      public Object invoke(CachedMethod method, Object object, Object[] arguments)
      Does not call method. This base implementation always delegates to noSuchMethod(CachedMethod, Object, Object[]). Generated reflectors override this method to perform the call.
      Parameters:
      method - the method that was selected
      object - the receiver, passed through unused by this implementation
      arguments - the arguments, passed through
      Returns:
      nothing; this implementation always throws
    • noSuchMethod

      protected Object noSuchMethod(CachedMethod method, Object object, Object[] arguments)
      Throws a non-static MissingMethodException using method's name and declaring class. object is ignored. A null arguments array is recorded as an empty argument list; a non-null array is retained as given.
      Parameters:
      method - supplies the missing name and declaring class
      object - unused
      arguments - arguments recorded on the exception; null becomes an empty array
      Returns:
      nothing; this method always throws