MCPcopy Create free account
hub / github.com/antlr/codebuff / newProxy

Method newProxy

output/java_guava/1.4.16/Reflection.java:94–99  ·  view source on GitHub ↗

Returns a proxy instance that implements interfaceType by dispatching method invocations to handler. The class loader of interfaceType will be used to define the proxy class. To implement multiple interfaces or specify a class loader, use Proxy#newProxyInstance. @thr

(Class<T> interfaceType, InvocationHandler handler)

Source from the content-addressed store, hash-verified

92
93
94 public static <T> T newProxy(Class<T> interfaceType, InvocationHandler handler) {
95 checkNotNull(handler);
96 checkArgument(interfaceType.isInterface(), "%s is not an interface", interfaceType);
97 Object object = Proxy.newProxyInstance(interfaceType.getClassLoader(), new Class<?>[] {interfaceType}, handler);
98 return interfaceType.cast(object);
99 }
100
101 private Reflection() {}
102}

Callers 1

newTypeVariableImplMethod · 0.95

Calls 3

checkNotNullMethod · 0.45
checkArgumentMethod · 0.45
castMethod · 0.45

Tested by

no test coverage detected