@SuppressWarnings("unchecked")
    private Class<? extends T> generateProxyClass() throws IOException {
        if (ViewProxy.class.isAssignableFrom(mBaseClass)) {
            return mBaseClass;
        }

        Class<? extends T> proxyClass = (Class) sGeneratedProxyClasses.get(mBaseClass);
        if (proxyClass != null &&
                (proxyClass.getClassLoader() == mParentClassLoader ||
                 proxyClass.getClassLoader().getParent() == mParentClassLoader)) {
            // Cache hit; return immediately.
            return proxyClass;
        }

        proxyClass = (Class<? extends T>) findProxyViewClass(mContext, mBaseClass.getName());
        if (proxyClass != null) {
            // This app ships with the build-time proxy.
            sGeneratedProxyClasses.put(mBaseClass, proxyClass);
            return proxyClass;
        }

        try {
            Class.forName("com.google.dexmaker.DexMaker");
            return DexProxyBuilder.generateProxyClass(mContext, mBaseClass);
        } catch (ClassNotFoundException e) {
            return null;
        }
    }
@ SuppressWarnings ( "unchecked" ) private Class < ? extends T > generateProxyClass ( ) throws IOException { if ( ViewProxy . class . isAssignableFrom ( mBaseClass ) ) { return mBaseClass ; } Class < ? extends T > proxyClass = ( Class ) sGeneratedProxyClasses . get ( mBaseClass ) ; if ( proxyClass != null && ( proxyClass . getClassLoader ( ) == mParentClassLoader || proxyClass . getClassLoader ( ) . getParent ( ) == mParentClassLoader ) ) { return proxyClass ; } proxyClass = ( Class < ? extends T > ) findProxyViewClass ( mContext , mBaseClass . getName ( ) ) ; if ( proxyClass != null ) { sGeneratedProxyClasses . put ( mBaseClass , proxyClass ) ; return proxyClass ; } try { Class . forName ( "com.google.dexmaker.DexMaker" ) ; return DexProxyBuilder . generateProxyClass ( mContext , mBaseClass ) ; } catch ( ClassNotFoundException e ) { return null ; } }
Generates dynamic {@link View} proxy class.