Java xstream api异常
我正在使用前面提到的xml结构----Java xstream api异常,java,spring,xstream,Java,Spring,Xstream,我正在使用前面提到的xml结构---- 0 执行摘要 1. 关键事实 2. 位置图 3. 主要公司 4. 地质学 5. 介绍 1. 结构 2. 水库 3. 加拿大西部沉积岩 4. 阿萨巴斯卡油砂公司 5. 探索 6. 勘探地点 1. 勘探策略 2. 储量和资源 7. 生产 8. 油/液体 1. 生产技术 2. 基础设施 9 成本 10 政策法规 11 财政术语 12 表1 1. 表2 2. 图1 1. 图2 2. 图3 3. 尺寸 1. 1500 2000 此外,我用来映射这些数据的xtre
0
执行摘要
1.
关键事实
2.
位置图
3.
主要公司
4.
地质学
5.
介绍
1.
结构
2.
水库
3.
加拿大西部沉积岩
4.
阿萨巴斯卡油砂公司
5.
探索
6.
勘探地点
1.
勘探策略
2.
储量和资源
7.
生产
8.
油/液体
1.
生产技术
2.
基础设施
9
成本
10
政策法规
11
财政术语
12
表1
1.
表2
2.
图1
1.
图2
2.
图3
3.
尺寸
1.
1500
2000
此外,我用来映射这些数据的xtream类定义是----
package com.woodmac.framework.adapter.cdl.model;
导入java.io.Serializable;
导入com.thoughtworks.xstream.annotations.XStreamAlias;
@XStreamAlias(“内容响应”)
公共类ContentResponse实现可序列化{
/**常量serialVersionId*/
私有静态最终长serialVersionUID=4524143523466710047L;
/**概念*/
@XStreamAlias(“项目”)
私有ContentItem ContentItem;
/**响应状态*/
@XStreamAlias(“响应状态”)
私人反应状态;
/**
*获取响应状态。
*
*@返回响应状态
*/
公共响应状态getResponseStatus(){
返回响应状态;
}
/**
*设置响应状态。
*
*@param responseStatus新的响应状态
*/
公共无效设置ResponseStatus(ResponseStatus ResponseStatus){
this.responseStatus=responseStatus;
}
/**
*获取内容项。
*
*@返回概念
*/
public ContentItem getContentItem(){
返回内容项;
}
/**
*设置内容项。
*
*@param contentItem
*,新概念
*/
public void setContentItem(ContentItem ContentItem){
this.contentItem=contentItem;
}
}
包com.woodmac.framework.adapter.cdl.model;
导入java.io.Serializable;
导入java.util.List;
导入javax.xml.bind.annotation.XmlRootElement;
导入com.thoughtworks.xstream.annotations.XStreamAlias;
导入com.thoughtworks.xstream.annotations.XStreamAsAttribute;
/**
*类ContentItem。
*/
@XmlRootElement(name=“item”)
公共类ContentItem实现可序列化{
/**常量serialVersionId*/
私有静态最终长serialVersionUID=-2269696298918578400L;
/**概念*/
@XStreamAlias(“项目列表”)
私人物品清单;
/**分析家们*/
@XStreamAlias(“分析师”)
私人内容分析分析师;
/**相关工具*/
@XStreamAlias(“相关工具”)
私有关联工具列表关联工具;
/**相关下载*/
@XStreamAlias(“相关下载”)
私人相关下载列表相关下载;
/**类型*/
@XStreamAlias(“类型”)
@XStreamAsAttribute
私有字符串类型;
@XStreamAlias(“高度”)
@XStreamAsAttribute
私有字符串高度;
@XStreamAlias(“宽度”)
@XStreamAsAttribute
私有字符串宽度;
/**内容id*/
@XStreamAlias(“contentId”)
@XStreamAsAttribute
私有字符串contentId;
/**内容id*/
@XStreamAlias(“概念ID”)
@XStreamAsAttribute
私有字符串概念ID;
/**标题*/
@XStreamAlias(“标题”)
私有字符串标题;
/**显示顺序*/
@XStreamAlias(“显示顺序”)
私有字符串显示顺序;
/**发布日期*/
@XStreamAlias(“发布数据”)
私有字符串数据;
/**内容片段*/
@XStreamAlias(“内容片段”)
私有字符串contentFragment;
/**预览片段*/
@XStreamAlias(“预览片段”)
私有字符串预览片段;
/**视频url*/
@XStreamAlias(“视频URL”)
私有字符串videoUrl;
<?xml version="1.0" encoding="UTF-8"?>
<contentResponse>
<responseStatus status="Success">
<statusCode>0</statusCode>
</responseStatus>
<item type="report" contentId="1111">
<itemsList type="extendedTOC">
<item type="extendedTOCSectionOuter">
<title>Executive summary</title>
<displayOrder>1</displayOrder>
</item>
<item type="extendedTOCSectionOuter">
<title>Key facts</title>
<displayOrder>2</displayOrder>
</item>
<item type="extendedTOCSectionOuter">
<title>Location maps</title>
<displayOrder>3</displayOrder>
</item>
<item type="extendedTOCSectionOuter">
<title>Key Companies</title>
<displayOrder>4</displayOrder>
</item>
<item type="extendedTOCSectionOuter">
<title>Geology</title>
<displayOrder>5</displayOrder>
<itemsList type="">
<item type="extendedTOCSectionInner">
<title>Introduction</title>
<displayOrder>1</displayOrder>
</item>
<item type="extendedTOCSectionInner">
<title>Structure</title>
<displayOrder>2</displayOrder>
</item>
<item type="extendedTOCSectionInner">
<title>Reservoirs</title>
<displayOrder>3</displayOrder>
</item>
<item type="extendedTOCSectionInner">
<title>Western Canadian Sedimentary</title>
<displayOrder>4</displayOrder>
</item>
<item type="extendedTOCSectionInner">
<title>Athabasca Oil Sands</title>
<displayOrder>5</displayOrder>
</item>
</itemsList>
</item>
<item type="Exploration">
<title>Exploration</title>
<displayOrder>6</displayOrder>
<itemsList type="">
<item type="extendedTOCSectionInner">
<title>Exploration Sites</title>
<displayOrder>1</displayOrder>
</item>
<item type="extendedTOCSectionInner">
<title>Exploration strategy</title>
<displayOrder>2</displayOrder>
</item>
</itemsList>
</item>
<item type="extendedTOCSectionOuter">
<title>Reserves and resources</title>
<displayOrder>7</displayOrder>
</item>
<item type="extendedTOCSectionOuter">
<title>Production</title>
<displayOrder>8</displayOrder>
<itemsList type="">
<item type="extendedTOCSectionInner">
<title>Oil/Liquids</title>
<displayOrder>1</displayOrder>
</item>
<item type="extendedTOCSectionInner">
<title>Production Techniques</title>
<displayOrder>2</displayOrder>
</item>
</itemsList>
</item>
<item type="extendedTOCSectionOuter">
<title>Infrastructure</title>
<displayOrder>9</displayOrder>
</item>
<item type="extendedTOCSectionOuter">
<title>Costs</title>
<displayOrder>10</displayOrder>
</item>
<item type="extendedTOCSectionOuter">
<title>Policy and Regulation</title>
<displayOrder>11</displayOrder>
</item>
<item type="extendedTOCSectionOuter">
<title>Fiscal Terms</title>
<displayOrder>12</displayOrder>
</item>
</itemsList>
<itemsList type="tables">
<item type="tablesOuter">
<title>Table 1</title>
<displayOrder>1</displayOrder>
</item>
<item type="tablesOuter">
<title>Table 2</title>
<displayOrder>2</displayOrder>
</item>
</itemsList>
<itemsList type="figures">
<item type="figuresOuter">
<title>Figure 1</title>
<displayOrder>1</displayOrder>
</item>
<item type="figuresOuter">
<title>Figure 2</title>
<displayOrder>2</displayOrder>
</item>
<item type="figuresOuter">
<title>Figure 3</title>
<displayOrder>3</displayOrder>
</item>
</itemsList>
<itemsList type="map">
<item type="mapOuter">
<title>dimensions</title>
<displayOrder>1</displayOrder>
<height>1500</height>
<width>2000</width>
</item>
</itemsList>
</item>
</contentResponse>
package com.woodmac.framework.adapter.cdl.model;
import java.io.Serializable;
import com.thoughtworks.xstream.annotations.XStreamAlias;
@XStreamAlias("contentResponse")
public class ContentResponse implements Serializable {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 4524143523466710047L;
/** The concepts. */
@XStreamAlias("item")
private ContentItem contentItem;
/** The response status. */
@XStreamAlias("responseStatus")
private ResponseStatus responseStatus;
/**
* Gets the response status.
*
* @return the response status
*/
public ResponseStatus getResponseStatus() {
return responseStatus;
}
/**
* Sets the response status.
*
* @param responseStatus the new response status
*/
public void setResponseStatus(ResponseStatus responseStatus) {
this.responseStatus = responseStatus;
}
/**
* Gets the content item.
*
* @return the concepts
*/
public ContentItem getContentItem() {
return contentItem;
}
/**
* Sets the content Item.
*
* @param contentItem
* , the new concepts
*/
public void setContentItem(ContentItem contentItem) {
this.contentItem = contentItem;
}
}
package com.woodmac.framework.adapter.cdl.model;
import java.io.Serializable;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
/**
* The Class ContentItem.
*/
@XmlRootElement(name = "item")
public class ContentItem implements Serializable {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -2269696298918578400L;
/** The concepts. */
@XStreamAlias("itemsList")
private List<ContentItemsList> itemsList;
/** The analysts. */
@XStreamAlias("analysts")
private ContentAnalystList analysts;
/** The related tools. */
@XStreamAlias("relatedTools")
private RelatedToolsList relatedTools;
/** The related downloads. */
@XStreamAlias("relatedDownloads")
private RelatedDownloadsList relatedDownloads;
/** The type. */
@XStreamAlias("type")
@XStreamAsAttribute
private String type;
@XStreamAlias("height")
@XStreamAsAttribute
private String height;
@XStreamAlias("width")
@XStreamAsAttribute
private String width;
/** The content id. */
@XStreamAlias("contentId")
@XStreamAsAttribute
private String contentId;
/** The content id. */
@XStreamAlias("conceptId")
@XStreamAsAttribute
private String conceptId;
/** The title. */
@XStreamAlias("title")
private String title;
/** The display order. */
@XStreamAlias("displayOrder")
private String displayOrder;
/** The published date. */
@XStreamAlias("publishedDate")
private String publishedDate;
/** The content fragment. */
@XStreamAlias("contentFragment")
private String contentFragment;
/** The preview fragment. */
@XStreamAlias("previewFragment")
private String previewFragment;
/** The video url. */
@XStreamAlias("videoUrl")
private String videoUrl;
/** The video description. */
@XStreamAlias("videoDescription")
private String videoDescription;
/** The video published date. */
@XStreamAlias("videoPublishedDate")
private String videoPublishedDate;
/** The report type. */
@XStreamAlias("reportType")
private String reportType;
/**
* Gets the related tools.
*
* @return the related tools
*/
public RelatedToolsList getRelatedTools() {
return relatedTools;
}
/**
* Sets the related tools.
*
* @param relatedTools
* the new related tools
*/
public void setRelatedTools(RelatedToolsList relatedTools) {
this.relatedTools = relatedTools;
}
/**
* Gets the analysts.
*
* @return the analysts
*/
public ContentAnalystList getAnalysts() {
return analysts;
}
/**
* Sets the analysts.
*
* @param analysts
* the new analysts
*/
public void setAnalysts(ContentAnalystList analysts) {
this.analysts = analysts;
}
/**
* Preview fragment.
*
* @return the string
*/
public String PreviewFragment() {
return previewFragment;
}
/**
* Sets the preview fragment.
*
* @param previewFragment
* the new preview fragment
*/
public void setPreviewFragment(String previewFragment) {
this.previewFragment = previewFragment;
}
/**
* Gets the title.
*
* @return the title
*/
public String getTitle() {
return title;
}
/**
* Sets the title.
*
* @param tittle
* the new title
*/
public void setTitle(String tittle) {
this.title = tittle;
}
/**
* Gets the display order.
*
* @return the display order
*/
public String getDisplayOrder() {
return displayOrder;
}
/**
* Sets the display order.
*
* @param displayOrder
* the new display order
*/
public void setDisplayOrder(String displayOrder) {
this.displayOrder = displayOrder;
}
/**
* Gets the published date.
*
* @return the published date
*/
public String getPublishedDate() {
return publishedDate;
}
/**
* Sets the published date.
*
* @param publishedDate
* the new published date
*/
public void setPublishedDate(String publishedDate) {
this.publishedDate = publishedDate;
}
/**
* Gets the content fragment.
*
* @return the content fragment
*/
public String getContentFragment() {
return contentFragment;
}
/**
* Sets the content fragment.
*
* @param contentFragment
* the new content fragment
*/
public void setContentFragment(String contentFragment) {
this.contentFragment = contentFragment;
}
/**
* Gets the type.
*
* @return the type
*/
public String getType() {
return type;
}
/**
* Sets the type.
*
* @param type
* the new type
*/
public void setType(String type) {
this.type = type;
}
/**
* Gets the content id.
*
* @return the content id
*/
public String getContentId() {
return contentId;
}
/**
* Sets the concept id.
*
* @param conceptId the new concept id
*/
public void setConceptId(String conceptId) {
this.conceptId = conceptId;
}
/**
* Gets the concept id.
*
* @return the concept id
*/
public String getConceptId() {
return conceptId;
}
/**
* Sets the content id.
*
* @param contentId
* the new content id
*/
public void setContentId(String contentId) {
this.contentId = contentId;
}
/**
* Gets the items list.
*
* @return the items list
*/
public List<ContentItemsList> getItemsList() {
return itemsList;
}
/**
* Sets the items list.
*
* @param itemsList
* the new items list
*/
public void setItemsList(List<ContentItemsList> itemsList) {
this.itemsList = itemsList;
}
/**
* Gets the related downloads.
*
* @return the related downloads
*/
public RelatedDownloadsList getRelatedDownloads() {
return relatedDownloads;
}
/**
* Sets the related downloads.
*
* @param relatedDownloads
* the new related downloads
*/
public void setRelatedDownloads(RelatedDownloadsList relatedDownloads) {
this.relatedDownloads = relatedDownloads;
}
/**
* Gets the preview fragment.
* @return the previewFragment
*/
public String getPreviewFragment() {
return previewFragment;
}
/**
* Gets the video description.
*
* @return the video description
*/
public String getVideoDescription() {
return videoDescription;
}
/**
* Sets the video description.
*
* @param videoDescription the new video description
*/
public void setVideoDescription(String videoDescription) {
this.videoDescription = videoDescription;
}
/**
* Gets the video url.
*
* @return the video url
*/
public String getVideoUrl() {
return videoUrl;
}
/**
* Sets the video url.
*
* @param videoUrl the new video url
*/
public void setVideoUrl(String videoUrl) {
this.videoUrl = videoUrl;
}
/**
* Gets the video published date.
*
* @return the video published date
*/
public String getVideoPublishedDate() {
return videoPublishedDate;
}
/**
* Sets the video published date.
*
* @param videoPublishedDate the new video published date
*/
public void setVideoPublishedDate(String videoPublishedDate) {
this.videoPublishedDate = videoPublishedDate;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "ContentItem [itemsList=" + itemsList + ", analysts=" + analysts + ", relatedTools="
+ relatedTools + ", relatedDownloads=" + relatedDownloads + ", type=" + type
+ ", contentId=" + contentId + ", title=" + title + ", displayOrder="
+ displayOrder + ", publishedDate=" + publishedDate + ", contentFragment="
+ contentFragment + ", previewFragment=" + previewFragment + "]";
}
/**
* Gets the report type.
*
* @return the report type
*/
public String getReportType() {
return reportType;
}
/**
* Sets the report type.
*
* @param reportType the new report type
*/
public void setReportType(String reportType) {
this.reportType = reportType;
}
}
@XmlRootElement(name = "itemsList")
public class ContentItemsList implements Serializable {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 6364024022629324119L;
/** The item. */
@XStreamImplicit
private List<ContentItem> item;
/** The type. */
@XStreamAlias("type")
@XStreamAsAttribute
private String type;
/**
* get item.
*
*
* @return item , item
*/
public List<ContentItem> getItem() {
return item;
}
/**
* get item.
*
* @param itemList
* , itemList
*/
public void setItems(List<ContentItem> itemList) {
this.item = itemList;
}
/**
* get the list type.
* @return the listType
*/
public String getListType() {
return type;
}
/**
* set the list type.
* @param listType the listType to set
*/
public void setListType(String listType) {
this.type = listType;
}
}