Autowire in deserialization class
<p>How to autowire inside deserialization class? </p>

<p>Here is the mapping class: </p>

<pre><code>@Component
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonNaming(PropertyNamingStrategy.PascalCaseStrategy.class)
public class Container {


    @Autowired
    private CalcResourceUsage calcResourcePercentage;
    private ContainerStats containerStats;
    @Autowired
    private AverageResourceUsage averageResourceUsage;

    public Container(){
        SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
    }


    private String Id;


    private List&lt;String&gt; Names;

    public String getId() {
        return Id;
    }

    public void setId(String id) {
        Id = id;
    }

    public List&lt;String&gt; getNames() {
        return Names;
    }

    public void setNames(List&lt;String&gt; names) {
        Names = names;
    }

    public CalcResourceUsage getCalcResourcePercentage() {
        return calcResourcePercentage;
    }


    public AverageResourceUsage getAverageResourceUsage() {
        return averageResourceUsage;
    }

    public ContainerStats getContainerStats() {
        return containerStats;
    }

    public void setContainerStats(ContainerStats containerStats) {
        this.containerStats = containerStats;
    }
}
</code></pre>

<p>So I use jackson to map objects into this class, using this line of code:</p>

<pre><code>Container[] containers = syncRestTemplate.getForObject(address + "json", Container[].class);
</code></pre>

<p>Then I have an array where for each container I need to do some calculations and if I can autowire <code>CalcResourceUsage</code> and <code>AverageResourceUsage</code>, I can do some calculations for each container.</p>

<p>currently <code>getAverageResourceUsage()</code> and <code>getCalcResourcePercentage()</code> return <code>null</code></p>