@@ -0,0 +1,2452 @@
+/*%0A * Copyright 2019 Google Inc.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.google.template.soy.plugin.java.restricted;%0A%0Aimport com.google.auto.value.AutoValue;%0Aimport com.google.common.collect.ImmutableList;%0A%0A/**%0A * The signature of a method. This allows identifying a method without requiring a compile-time%0A * dependency on its declaring class.%0A */%0A@AutoValue%0Apublic abstract class MethodSignature %7B%0A%0A  /**%0A   * The fully qualified class name of the method, as returned by Class.getName.%0A   *%0A   * %3Cp%3EThis is the equivalent of %7B@link java.lang.reflect.Method#getDeclaringClass%0A   * Method.getDeclaringClass%7D().%7B@link Class#getName getName%7D(), except it doesn't require a%0A   * compile-time dependency on the declaring class.%0A   */%0A  public abstract String fullyQualifiedClassName();%0A%0A  /**%0A   * The name of the method.%0A   *%0A   * %3Cp%3EThis is the equivalent of %7B@link java.lang.reflect.Method#getName%7D, except it doesn't%0A   * require a compile-time dependency on the declaring class.%0A   */%0A  public abstract String methodName();%0A%0A  /**%0A   * The return type of the method.%0A   *%0A   * %3Cp%3EThis is the equivalent of %7B@link java.lang.reflect.Method#getReturnType%7D, except it doesn't%0A   * require a compile-time dependency on the declaring class.%0A   */%0A  public abstract Class%3C?%3E returnType();%0A%0A  /**%0A   * The arguments of the method.%0A   *%0A   * %3Cp%3EThis is the equivalent of %7B@link java.lang.reflect.Method#getParameterTypes%7D, except it%0A   * doesn't require a compile-time dependency on the declaring class.%0A   */%0A  public abstract ImmutableList%3CClass%3C?%3E%3E arguments();%0A%0A  MethodSignature() %7B%7D // package-private cxtor to users can't manually instantiate this.%0A%0A  /** Constructs a new MethodSignature. */%0A  public static MethodSignature create(%0A      String classFqn, String method, Class%3C?%3E returnType, Class%3C?%3E... args) %7B%0A    return new AutoValue_MethodSignature(classFqn, method, returnType, ImmutableList.copyOf(args));%0A  %7D%0A%7D%0A

Add a MethodSignature as an alternative to using Method for plugins to point to methods that will be called at runtime. This will allow plugins to refer to runtime logic without having the runtime code compiled in as a host dep.