FileDocCategorySizeDatePackage
DexClassLoaderHelper.javaAPI DocAndroid 5.1 API2102Thu Mar 12 22:18:30 GMT 2015com.android.dexgen.util

DexClassLoaderHelper

public class DexClassLoaderHelper extends Object
Class used indirectly for loading generated dex classes. It allows the caller to obtain appropriate {@code DexClassLoader} instance, which can be then used for loading classes.

Fields Summary
Constructors Summary
private DexClassLoaderHelper()

    

      
        // intentionally empty to disable direct instantiation
    
Methods Summary
public java.lang.ClassLoadergetDexClassLoader(PathHolder pathHolder)
Creates and returns DexClassLoader instance with its classpath set to {@code pathHolder}.

param
pathHolder {@code non-null;} location of jar archive containing dex classes canned into a working PathHolder instance.
return
dex class loader instance with its classpath set to location indicated by {@code pathHolder}

        ClassLoader myLoader = DexClassLoaderHelper.class.getClassLoader();
        return new DexClassLoader(pathHolder.getJarFilePath(), pathHolder.getDirLocation(),
                null, myLoader);
    
public static com.android.dexgen.util.DexClassLoaderHelpergetInstance()
Returns the sole instance of {@code DexClassLoaderHelper}.

return
dex {@code DexClassLoaderHelper} sole instance

        return DexClassLoaderHelperHolder.INSTANCE;