JAXB无法正确地将Java Object属性编组为JSON(将其作为字符串编组)

时间:2015-06-02 09:45:48

标签: java json jaxb

我正在使用JAXB来将Java对象编组为JSON,但是我遇到了这个框架的一些问题。

事实上,我的Java对象的大多数属性都是正确的marhsall,除了一个作为字符串的马歇尔。

这是我得到的部分输出:

"locations": [
                            {
                                "locationName": "Barcelone",
                                "locationCode": "HOTEL_FRED",
                                "codeType": "SPECIFIC",
                                "locationType": "HOTEL"
                            }
                        ],
                        "contentCompletionType": "OnlyHeaders",
                        "roomCombinations": [
                            "com.travelsoft.cameleo.bookingprocess.data.RoomCombinationJson@1249fad0[\r\n  id=C2\r\n  status=<null>\r\n  priceValue=<null>\r\n  roomElements=[com.travelsoft.cameleo.bookingprocess.data.RoomElementJson@36f17711[\r\n  status=<null>\r\n  roomCategories=com.travelsoft.cameleo.bookingprocess.data.RoomCategoriesJson@26c01945[\r\n  status=<null>\r\n  roomCategories=[com.travelsoft.cameleo.bookingprocess.data.RoomCategoryJson@dbb14e3[\r\n  status=<null>\r\n  priceValue=<null>\r\n  priceRule=<null>\r\n  elements=[com.travelsoft.cameleo.bookingprocess.data.ElementJson@75584a1f[\r\n  status=<null>\r\n  priceValue=<null>\r\n  priceRule=<null>\r\n  elements=[]\r\n  property=com.travelsoft.cameleo.bookingprocess.data.PropertyJson@776a7568[\r\n  quantityConditions=<null>\r\n  quantityValues=<null>\r\n  dateAndDurations=<null>\r\n  dateAndDuration=<null>\r\n  quantity=1\r\n  needPassengerAssignment=<null>\r\n  processScope=<null>\r\n  selection=<null>\r\n  completionStatus=<null>\r\n  datesContainValidTime=<null>\r\n]\r\n  travellerReves=[]\r\n  nettCosts=<null>\r\n  informationObject=<null>\r\n  selected=<null>\r\n  subType=<null>\r\n  originalType=<null>\r\n  groupRef=<null>\r\n  metadata=<null>\r\n  id=CA2\r\n  ref=<null>\r\n  codifiedTypeType=<null>\r\n  descriptions=com.travelsoft.cameleo.bookingprocess.data.DescriptionsJson@6e423c17[\r\n  descriptions=[com.travelsoft.cameleo.bookingprocess.data.DescriptionJson@3e77428e[\r\n  label=Double pr�sidentielle\r\n  nature=<null>\r\n  providerType=TO\r\n]]\r\n  shortDescription=<null>\r\n  mainThumbnail=<null>\r\n  longDescription=<null>\r\n  galleryPhotos=<null>\r\n]\r\n  codes=com.travelsoft.cameleo.bookingprocess.data.CodeSystemJson@7b298ac[\r\n  source=com.travelsoft.cameleo.bookingprocess.data.CodeSystemInfoJson@5e454826[\r\n  providerType=TO\r\n  code=Double pr�sidentielle#61579\r\n  id=<null>\r\n  providerName=<null>\r\n  providerCode=<null>\r\n]\r\n  targets=<null>\r\n]\r\n  provider=<null>\r\n  parentProvider=<null>\r\n  _transient=false\r\n]]\r\n  property=<null>\r\n  travellerReves=[]\r\n  nettCosts=<null>\r\n  informationObject=<null>\r\n  selected=<null>\r\n  subType=<null>\r\n  originalType=<null>\r\n  groupRef=<null>\r\n  metadata=<null>\r\n  id=RCA2\r\n  ref=<null>\r\n  codifiedTypeType=<null>\r\n  descriptions=<null>\r\n  codes=<null>\r\n  provider=<null>\r\n  parentProvider=<null>\r\n  _transient=false\r\n]]\r\n]\r\n  travellerReves=[]\r\n]]\r\n  mealPlans=com.travelsoft.cameleo.bookingprocess.data.MealPLansJson@1683e724[\r\n  status=<null>\r\n  mealPlen=[com.travelsoft.cameleo.bookingprocess.data.MealPlanJson@2dbbf808[\r\n  status=<null>\r\n  priceValue=<null>\r\n  priceRule=<null>\r\n  elements=[]\r\n  property=com.travelsoft.cameleo.bookingprocess.data.PropertyJson@f98ecad[\r\n  quantityConditions=<null>\r\n  quantityValues=<null>\r\n  dateAndDurations=<null>\r\n  dateAndDuration=<null>\r\n  quantity=1\r\n  needPassengerAssignment=<null>\r\n  processScope=<null>\r\n  selection=DEFAULT\r\n  completionStatus=<null>\r\n  datesContainValidTime=<null>\r\n]\r\n  travellerReves=[]\r\n  nettCosts=<null>\r\n  informationObject=com.travelsoft.cameleo.bookingprocess.data.InformationObjectJson@da59db[\r\n  urls=[]\r\n  descriptions=[com.travelsoft.cameleo.bookingprocess.data.LongDescriptionJson@7f41394c[\r\n  title=<null>\r\n  documentCore=Petit-D�jeuner\r\n]]\r\n]\r\n  selected=<null>\r\n  subType=<null>\r\n  originalType=<null>\r\n  groupRef=<null>\r\n  metadata=<null>\r\n  id=M1\r\n  ref=<null>\r\n  codifiedTypeType=<null>\r\n  descriptions=com.travelsoft.cameleo.bookingprocess.data.DescriptionsJson@1318edd9[\r\n  descriptions=[com.travelsoft.cameleo.bookingprocess.data.DescriptionJson@49a74b5a[\r\n  label=Petit-D�jeuner\r\n  nature=<null>\r\n  providerType=TO\r\n]]\r\n  shortDescription=<null>\r\n  mainThumbnail=<null>\r\n  longDescription=<null>\r\n  galleryPhotos=<null>\r\n]\r\n  codes=com.travelsoft.cameleo.bookingprocess.data.CodeSystemJson@644277d[\r\n  source=com.travelsoft.cameleo.bookingprocess.data.CodeSystemInfoJson@647c82c1[\r\n  providerType=TO\r\n  code=petitdej\r\n  id=3717\r\n  providerName=<null>\r\n  providerCode=<null>\r\n]\r\n  targets=<null>\r\n]\r\n  provider=<null>\r\n  parentProvider=<null>\r\n  _transient=false\r\n]]\r\n]\r\n]"
                        ]
                    }
                }
            },
            "service": {
                "mandatoryService": {},
                "optionalService": {
                    "priceValue": {
                        "amount": 60,
                        "baseAmount": 60,
                        "currency": "EUR",

你们有没有人知道为什么只有“roomCombinations”没有正确编组?

感谢adance。

0 个答案:

没有答案