title: how to convert xml notation to annotation based notation : Spring - Java
body: <p>I have following xml configuration in my spring context xml, I have used annotation based approach very less and unable to figure out how to represent following using annotation, need help.</p>
  
  <pre><code>&lt;bean id="myPolicyAdmin" class="org.springframework.security.oauth2.client.OAuth2RestTemplate"&gt;
          &lt;constructor-arg&gt;
              &lt;bean class="org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordResourceDetails"&gt;
                  &lt;property name="accessTokenUri" value="${accessTokenEndpointUrl}" /&gt;
                  &lt;property name="clientId" value="${clientId}" /&gt;
                  &lt;property name="clientSecret" value="${clientSecret}" /&gt;
                  &lt;property name="username" value="${policyAdminUserName}" /&gt;
                  &lt;property name="password" value="${policyAdminUserPassword}" /&gt;
              &lt;/bean&gt;
          &lt;/constructor-arg&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>In my java class(Policy manager) it is referred as following, I am actually referring a sample and trying to convert it all annotation baesed.</p>
  
  <pre><code>@Autowired
  @Qualifier("myPolicyAdmin")
  private OAuth2RestTemplate myPolicyAdminTemplate;
  </code></pre>
  
  <p>EDIT:
  I tried creating a bean for <code>org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordResourceDetails</code> but not sure how to set its properties and how to access it as constructor args to <code>myPolicyAdminTemplate</code></p>