Package com.google.common.reflect

Examples of com.google.common.reflect.AbstractInvocationHandler


  }

  private static <T> void testExceptionPropagation(
      Class<T> interfaceType, Method method, Function<? super T, ? extends T> wrapperFunction) {
    final RuntimeException exception = new RuntimeException();
    T proxy = Reflection.newProxy(interfaceType, new AbstractInvocationHandler() {
      @Override protected Object handleInvocation(Object p, Method m, Object[] args)
          throws Throwable {
        throw exception;
      }
    });
View Full Code Here


    Set<Class<? super T>> interfaceClasses =
        type.getTypes().interfaces().rawTypes();
    return (T) Proxy.newProxyInstance(
        interfaceClasses.iterator().next().getClassLoader(),
        interfaceClasses.toArray(new Class<?>[interfaceClasses.size()]),
        new AbstractInvocationHandler() {
          @Override protected Object handleInvocation(
              Object proxy, Method method, Object[] args) {
            return getDefaultValue(
                type.resolveType(method.getGenericReturnType()));
          }
View Full Code Here

TOP

Related Classes of com.google.common.reflect.AbstractInvocationHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.