Errai 3.0.1-SNAPSHOT

org.jboss.errai.codegen.util
Class ProxyUtil

java.lang.Object
  extended by org.jboss.errai.codegen.util.ProxyUtil

public abstract class ProxyUtil
extends Object

Utilities to avoid redundant code for proxy generation.

Author:
Christian Sadilek , Mike Brock

Nested Class Summary
static class ProxyUtil.InterceptorProvider
          A utility class that provides a list of interceptors for a given remote interface and method.
 
Method Summary
static String createCallSignature(Class<?> referenceClass, Method m)
           
static String createCallSignature(MetaMethod m)
           
static AnonymousClassStructureBuilder generateProxyMethodCallContext(com.google.gwt.core.ext.GeneratorContext context, Class<? extends RemoteCallContext> callContextType, MetaClass proxyClass, MetaMethod method, Statement proceed, List<Class<?>> interceptors)
          Generates the CallContext for method interception.
static Statement generateProxyMethodReturnStatement(MetaMethod method)
          Generates a valid return statement for the provided method.
static boolean isMethodInInterface(Class<?> iface, Method member)
           
static boolean shouldProxyMethod(MetaMethod method)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

generateProxyMethodCallContext

public static AnonymousClassStructureBuilder generateProxyMethodCallContext(com.google.gwt.core.ext.GeneratorContext context,
                                                                            Class<? extends RemoteCallContext> callContextType,
                                                                            MetaClass proxyClass,
                                                                            MetaMethod method,
                                                                            Statement proceed,
                                                                            List<Class<?>> interceptors)
Generates the CallContext for method interception. Ignores annotations in non-translatable packages.

Parameters:
callContextType - the type of RemoteCallContext to use.
proxyClass - the declaring proxy class
method - the method that is being proxied.
proceed - the logic that should be invoked if CallContext.proceed() is called.
interceptors - a list of interceptors to use
Returns:
statement representing an anonymous implementation of the provided CallContext

shouldProxyMethod

public static boolean shouldProxyMethod(MetaMethod method)

createCallSignature

public static String createCallSignature(MetaMethod m)

createCallSignature

public static String createCallSignature(Class<?> referenceClass,
                                         Method m)

isMethodInInterface

public static boolean isMethodInInterface(Class<?> iface,
                                          Method member)

generateProxyMethodReturnStatement

public static Statement generateProxyMethodReturnStatement(MetaMethod method)
Generates a valid return statement for the provided method.

Parameters:
method -
Returns:
return statement for the provided method

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.