How to marshal/unmarshal Java objects with private fields using JAXB

前端 未结 2 1667
小鲜肉
小鲜肉 2021-01-02 20:34

I know the basics of the JAXB API, but I am stuck with something I am trying to do, and I am not sure whether it is actually possible. Details are as follows:

I have

2条回答
  •  庸人自扰
    2021-01-02 20:51

    JAXB will need either: - A public instance variable Or - A private instance variable with public mutators and accessors.

    You will need mutators for marshalling and acessors for unmarshalling

提交回复
热议问题