AppComponentFactory
public
class
AppComponentFactory
extends Object
Interface used to control the instantiation of manifest elements.
Summary
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object.
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
|
Public constructors
AppComponentFactory
public AppComponentFactory ()
Public methods
instantiateActivity
public Activity instantiateActivity (ClassLoader cl,
String className,
Intent intent)
Allows application to override the creation of activities. This can be used to
perform things such as dependency injection or class loader changes to these
classes.
This method is only intended to provide a hook for instantiation. It does not provide
earlier access to the Activity object. The returned object will not be initialized
as a Context yet and should not be used to interact with other android APIs.
| Parameters |
cl |
ClassLoader: The default classloader to use for instantiation.
This value must never be null. |
className |
String: The class to be instantiated.
This value must never be null. |
intent |
Intent: Intent creating the class.
This value may be null. |
| Returns |
Activity |
This value will never be null. |
instantiateApplication
public Application instantiateApplication (ClassLoader cl,
String className)
Allows application to override the creation of the application object. This can be used to
perform things such as dependency injection or class loader changes to these
classes.
This method is only intended to provide a hook for instantiation. It does not provide
earlier access to the Application object. The returned object will not be initialized
as a Context yet and should not be used to interact with other android APIs.
| Parameters |
cl |
ClassLoader: The default classloader to use for instantiation.
This value must never be null. |
className |
String: The class to be instantiated.
This value must never be null. |
instantiateClassLoader
public ClassLoader instantiateClassLoader (ClassLoader cl,
ApplicationInfo aInfo)
Allows application to override the creation of the default class loader.
This can be used to perform things such as dependency injection or setting up
a custom class loader hierarchy.
| Parameters |
cl |
ClassLoader: The default classloader instantiated by platform.
This value must never be null. |
aInfo |
ApplicationInfo: Information about the application being loaded.
This value must never be null. |
instantiateProvider
public ContentProvider instantiateProvider (ClassLoader cl,
String className)
Allows application to override the creation of providers. This can be used to
perform things such as dependency injection or class loader changes to these
classes.
This method is only intended to provide a hook for instantiation. It does not provide
earlier access to the ContentProvider object. The returned object will not be initialized
with a Context yet and should not be used to interact with other android APIs.
| Parameters |
cl |
ClassLoader: The default classloader to use for instantiation.
This value must never be null. |
className |
String: The class to be instantiated.
This value must never be null. |
instantiateReceiver
public BroadcastReceiver instantiateReceiver (ClassLoader cl,
String className,
Intent intent)
Allows application to override the creation of receivers. This can be used to
perform things such as dependency injection or class loader changes to these
classes.
| Parameters |
cl |
ClassLoader: The default classloader to use for instantiation.
This value must never be null. |
className |
String: The class to be instantiated.
This value must never be null. |
intent |
Intent: Intent creating the class.
This value may be null. |
instantiateService
public Service instantiateService (ClassLoader cl,
String className,
Intent intent)
Allows application to override the creation of services. This can be used to
perform things such as dependency injection or class loader changes to these
classes.
This method is only intended to provide a hook for instantiation. It does not provide
earlier access to the Service object. The returned object will not be initialized
as a Context yet and should not be used to interact with other android APIs.
| Parameters |
cl |
ClassLoader: The default classloader to use for instantiation.
This value must never be null. |
className |
String: The class to be instantiated.
This value must never be null. |
intent |
Intent: Intent creating the class.
This value may be null. |
| Returns |
Service |
This value will never be null. |