What is the Spring equivalent for CDI's Instance, or Guices Provider
In CDI you can define an object that will give you items of a certain type, using:

<!-- language: lang-java --><pre>
@Inject
Instance&lt;MyObject> myObjectInstance;
//...
MyObject myObjectInstance.get();
</pre>

Similarly in Guice you can do:

<!-- language: lang-java --><pre>
@Inject
Provider&lt;MyObject> myObjectInstance;
//...
MyObject myObjectInstance.get();
</pre>

I am wondering if there is a similar construct in Spring, or you must use the `ApplicationContext` in order to get the reference?
What is the Spring equivalent for CDI's Instance, or Guices Provider
===

In CDI you can define an object that will give you items of a certain type, using:

<!-- language: lang-java --><pre>
@Inject
Instance&lt;MyObject> myObjectInstance;
//...
MyObject myObjectInstance.get();
</pre>

Similarly in Guice you can do:

<!-- language: lang-java --><pre>
@Inject
Provider&lt;MyObject> myObjectInstance;
//...
MyObject myObjectInstance.get();
</pre>

I am wondering if there is a similar construct in Spring, or you must use the `ApplicationContext` in order to get the reference?