Class GeneratedMetaMethod.DgmMethodRecord

java.lang.Object
org.codehaus.groovy.reflection.GeneratedMetaMethod.DgmMethodRecord
All Implemented Interfaces:
Serializable
Enclosing class:
GeneratedMetaMethod

public static class GeneratedMetaMethod.DgmMethodRecord extends Object implements Serializable
One generated default-Groovy-method adapter, as written to META-INF/dgminfo. parameters[0] is the receiver type.
See Also:
  • Field Details

    • className

      public String className
      Internal name of the generated adapter, org/codehaus/groovy/runtime/dgm$ plus its index.
    • methodName

      public String methodName
      Name of the extension method.
    • returnType

      public Class returnType
      Return type of the extension method.
    • parameters

      public Class[] parameters
      Native parameter types of the extension method, with the receiver at index 0.
  • Constructor Details

    • DgmMethodRecord

      public DgmMethodRecord()
  • Method Details

    • saveDgmInfo

      public static void saveDgmInfo(List<GeneratedMetaMethod.DgmMethodRecord> records, String file) throws IOException
      Writes records to file. Primitive classes take the first ids, then each distinct return type and parameter type. A blank UTF string ends the class table. Each record then stores its class name, method name, return-type id, and parameter-type ids.
      Parameters:
      records - the adapters to persist
      file - path of the file to write
      Throws:
      IOException - when the file cannot be written
    • loadDgmInfo

      public static List<GeneratedMetaMethod.DgmMethodRecord> loadDgmInfo() throws IOException
      Reads META-INF/dgminfo from this class's loader. A record is omitted when its return type or any parameter type could not be loaded. Primitive classes are taken from the fixed table rather than loaded by name.

      A missing META-INF/dgminfo fails immediately.

      Returns:
      the records whose classes all loaded
      Throws:
      IOException - when the resource cannot be read