public abstract class Loader extends Object
Constructor and Description |
---|
Loader() |
Modifier and Type | Method and Description |
---|---|
abstract Binding<?> |
getAtInjectBinding(String key,
String className,
ClassLoader classLoader,
boolean mustHaveInjections)
Returns a binding that uses
@Inject annotations, or null if no valid binding can
be found or created. |
abstract <T> ModuleAdapter<T> |
getModuleAdapter(Class<T> moduleClass)
Returns a module adapter for
moduleClass or throws a TypeNotPresentException if
none can be found. |
abstract StaticInjection |
getStaticInjection(Class<?> injectedClass)
Returns the static injection for
injectedClass . |
protected <T> T |
instantiate(String name,
ClassLoader classLoader)
Instantiates a class using its default constructor and the given
ClassLoader . |
protected Class<?> |
loadClass(ClassLoader classLoader,
String name)
Loads a class from a
ClassLoader -specific cache if it's already there, or
loads it from the given ClassLoader and caching it for future requests. |
public abstract Binding<?> getAtInjectBinding(String key, String className, ClassLoader classLoader, boolean mustHaveInjections)
@Inject
annotations, or null if no valid binding can
be found or created.public abstract <T> ModuleAdapter<T> getModuleAdapter(Class<T> moduleClass)
moduleClass
or throws a TypeNotPresentException
if
none can be found.public abstract StaticInjection getStaticInjection(Class<?> injectedClass)
injectedClass
.protected Class<?> loadClass(ClassLoader classLoader, String name)
ClassLoader
-specific cache if it's already there, or
loads it from the given ClassLoader
and caching it for future requests. Failures
to load are also cached using the Void.class type. A null ClassLoader
is assumed
to be the system classloader.protected <T> T instantiate(String name, ClassLoader classLoader)
ClassLoader
. This
method does not attempt to set accessibility.Copyright © 2017 Square, Inc.. All rights reserved.