org.wamblee.inject
Class Injectable

java.lang.Object
  extended by org.wamblee.inject.Injectable

public abstract class Injectable
extends java.lang.Object

This abstract base class performs injection at construction. Be sure not to initialize fields of derived classes to null as these will override the initializations of this base class. This class uses InjectorBuilder to obtain an implementation of a InjectorFactory to use.

Author:
Erik Brakkee

Constructor Summary
protected Injectable()
          Inheritance style constructor.
 
Method Summary
 Injector getInjector()
          Gets the default injector.
 void inject()
          Inject references.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Injectable

protected Injectable()
Inheritance style constructor.

Method Detail

inject

public void inject()
Inject references. This can be useful when injection is to be done again after construction to obtain new references or after zeroing out of the references.


getInjector

public Injector getInjector()
Gets the default injector.

Returns:
Injector.


Copyright © 2022. All Rights Reserved.