1

在我的项目中,我得到了 base64 格式的响应。1)我有将元素类型定义为base64binary ex的响应模式。<xs:element name="title" type="xs:base64Binary" minOccurs="0"/> 2)我使用 xjc 命令生成 pojo。在上面的例子中。它将具有 getter setter 方法,例如

public byte[] getTitle() {
        return title;
    }

public void setTitle(byte[] value) {
        this.title = value;
    }

3) 在我的控制器中,当我执行 getTitle() 时,我得到了 base 64 编码的字节 [] 值。

有没有办法直接在字符串中获取解码的标题值所以这意味着如果我做 getTitle 它应该返回标题的解码字符串值而不是返回编码的字节 []。我应该如何生成覆盖默认数据类型的 pojo,即。字节 [] 到字符串?以及如何编写绑定/适配器类。

4

0 回答 0