title: Spring syntax for setting a Class object?
body: <p>Is there a way to set a property in spring to, not an instance of a class, but the class object itself? i.e.</p>
  
  <p>Rather than </p>
  
  <pre><code>&lt;bean&gt;
     &lt;property name="prototype" class="a.b.c.Foo"&gt;...
  </code></pre>
  
  <p>giving you an instance of "Foo", something like:</p>
  
  <pre><code>&lt;bean&gt;
    &lt;property name="prototype" class="java.lang.Class" value="a.b.c.Foo.class"...
  </code></pre>
  
  <p>edit:
  best (working) solution so far - use the normal instantiation and derive the class in the setter. In terms of solutions I think this we'd describe this as "cheating":</p>
  
  <pre><code>&lt;bean class="Bar"&gt;
     &lt;property name="prototype" class="a.b.c.Foo"&gt;...
  
  
  public class Bar{
          public void setPrototype(Object o){
                  this.prototypeClass=o.getClass();
  </code></pre>
  
  <p>edit:
  dtsazza's method works as well.</p>
  
  <p>edit:
  pedromarce's method works as well.</p>