JAXBWriter.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:sissi 作者:
public JAXBWriter(NamespacePrefixMapper mapper) {
    super();
    this.mapper = mapper;
    try {
        List<Class<?>> clazz = new ArrayList<Class<?>>();
        for (Class<?> each : ScanUtil.getClasses(this.protocol)) {
            if (each.getAnnotation(XmlRootElement.class) != null) {
                clazz.add(each);
            }
        }
        this.context = JAXBContext.newInstance(clazz.toArray(new Class[] {}));
        this.log.info("All classes in JAXB Context: " + clazz);
    } catch (Exception e) {
        this.log.error(e.toString());
        Trace.trace(this.log, e);
        throw new RuntimeException("Can't init JAXB context", e);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号