【发布时间】:2013-11-05 20:17:10
【问题描述】:
我有课
public class Tree<T> {
private T value;
private Tree<T> parent;
private List<Tree<T>> children;
...
}
然后我想制作一个 MessageBodyReader 和 Writer 以便能够生成和使用表示此类实例的 JSON,但没有循环引用。所以 JSON 文档会排除父级。
然后我得到一个我要实现的方法,看起来像这样
@Override
public Tree<?> readFrom(Class<Tree<?>> type, Type genericType,
Annotation[] annotations, MediaType mediaType,
MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
throws IOException, WebApplicationException {
如何确定是什么?是在 Class
【问题讨论】: