code: public GroovyCodeSource createGroovyCodeSource(final ClassSource source) throws IOException {
      checkNotNull(source);
  
      if (source.getUrl() != null) {
        return new GroovyCodeSource(source.getUrl());
      }
      if (source.getFile() != null) {
        return new GroovyCodeSource(source.getFile());
      }
      if (source.getInline() != null) {
        Inline inline = source.getInline();
        return new GroovyCodeSource(inline.getInput(), inline.getName(), inline.getCodeBase());
      }
  
      throw new Error("Unable to create GroovyCodeSource from: " + source);
    }
docs: Creates a {@link GroovyCodeSource} from a {@link ClassSource}.