Is it correct that Jersey does not support declara

2019-06-28 04:27发布

问题:

public class Widget {
    @Ref(resource=WidgetResource.class)
    URI url;

    ...

    public URI getUrl() {
        return url;
    }

    public Wonkle getWonkle() {
        return wonkle;
    }

}

public class Wonkle {
    @Ref(resource=WonkleResource.class)
    URI url;

    public URI getUrl() {
        return url;
    }

   ...
}

The JSON representation of the the Wonkle type has a url attribute with an appropriate value. However, when the Wonkle is used as a nested attribute in the Widget type, its url attribute has a null value.

Am I doing something incorrectly, or is this this just the way the LinkFilter works?

Thanks!