Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用谷歌&xB4;s GSON解析JSON无效标识符?_Java_Json_Gson - Fatal编程技术网

Java 如何使用谷歌&xB4;s GSON解析JSON无效标识符?

Java 如何使用谷歌&xB4;s GSON解析JSON无效标识符?,java,json,gson,Java,Json,Gson,我有一个返回JSON的REST Web服务。作为一个例子,我有以下回应: {“oslc_cm:results”:[{“dc:identifier”:7,“calm:relatedTestCase”:[],“calm:relatedTestScript”:[],“rtc_cm:com.ibm.team.build.linktype.includeDeployments.com.ibm.team.build.common.link.includedDeployment”:[],“calm:relat

我有一个返回JSON的REST Web服务。作为一个例子,我有以下回应:

{“oslc_cm:results”:[{“dc:identifier”:7,“calm:relatedTestCase”:[],“calm:relatedTestScript”:[],“rtc_cm:com.ibm.team.build.linktype.includeDeployments.com.ibm.team.build.common.link.includedDeployment”:[],“calm:relatedTestPlan”:[],“rtc_cm:com.ibm.team.enterprise.deployment.linktype.deploymentDefinition.packageDefinition”:[],“rtc\U cm:com.ibm.team.workitem.linktype.attachment.attachment:[],“rtc\U cm:state:{”rdf:resource:“https:\/\/localhost:9443\/ccm\/oslc\/workflows\/\u X1GzsPC9EeCek69P-ztT9w\/states\/com.ibm.team.workitem.taskWorkflow\/1”;“rtc\u cm:com.ibm.team.enterprise.packaging.linktype.resultItem.result:[],“calm:tracksChanges:”、“tracksChanges:”RTCU:“contextId:”_X1GzsPC9EeCek69P-ztT9w,“rtc_cm:com.ibm.team.workitem.linktype.copiedworkitem.copies”:[],“rtc_cm:com.ibm.team.workitem.linktype.resolvesworkitem.resolvedBy”:[],“rtc_cm:com.ibm.team.enterprise.promotion.linktype.resultWorkItem.promoted”:[],“rtc_cm:com.ibm.team.enterprise.package.linktype.packageDefinition.packageDefinition:[],“dc:dc:rdf:resource:“https:\/\/localhost:9443\/ccm\/oslc\/users\/\uHHBOSPC1EECSJBI2ZGPDG”;“rtc\/\/cm:com.ibm.team.workitem.linktype.copiedworkitem.copiedFrom:[],“rtc\/u cm:modifiedBy:{“rdf:resource:”https:\/\/localhost:9443\/ccm\/oslc\/users\/\uBOSHHPC1ECSJBI2ZGPOG”;“rtc\/cm:ownedBy:{”rdf:resource:“:”https:\/\/localhost:9443\/ccm\/oslc\/users\/\u hhbosPC1EeCsJbI2ZgPDog“,“oslc\u cm:severity:{”rdf:resource:“https:\/\/localhost:9443\/ccm\/oslc\/enumerations\/\u x1gztspc9eecek69p-ztT9w\/severity\/severity.literal.l3“,“rtc\u cm:com.ibm.team.enterprise.deployment.linktype.deployment.deployment.deployment.deployment.deployment.deployment.deploymentBuildResult.packageBuildResult:”],“ClageBuildResult:rdf:resource:“https:\/\/localhost:9443\/ccm\/resource\/itemName\/com.ibm.team.workitem.workitem\/7”,“冷静:影响执行结果”:[],“rtc\u cm:projectArea:{”rdf:resource:“https:\/\/localhost:9443\/ccm\/oslc\/projectareas\/\u X1GzsPC9EeCek69P-ztT9w”,“rtc\u cm:com.ibm.team.enterprise.packaging.linktype.resultorkim.projection:”,“,”rtc_cm:com.ibm.team.workitem.linktype.SchedulePreference.Preference:[],“rtc_cm:correctedEstimate”:null,“rtc_cm:teamArea”:null,“rtc_cm:com.ibm.team.enterprise.promotion.linktype.promotionBuildResult.promotionBuildResult:[],“rtc_cm:com.ibm.team.enterprise.promotion.linktype.promotedChangeSets.promotedChangeSets:”,“dc:created:”2011-10-07T08:36:36.166Z,“rtc\U cm:解析”:null,“rtc\U cm:存档”:false,“rtc\U cm:com.ibm.team.workitem.linktype.blocksworkitem.dependsOn”:[],“calm:affectsPlanItem”:[],“dc:主题”:““rtc\U cm:解析人”:{“rdf:资源”:“https:\/\/localhost:9443\/ccm\/oslc\/users\//ynh4molsedsedXPIOQ45hVA”;“calm:relatedBY:”TestSuite[]:rtc\U cm:com.ibm.team.workitem.linktype.parentworkitem.parent:[],“rtc\U cm:filedAgainst:{”rdf:resource:“https:\/\/localhost:9443\/ccm\/resource\/itemOid\/com.ibm.team.workitem.Category\/\u ZQ3nEvC9EeCek69P-ztT9w”,“rtc\u cm:com.ibm.team.workitem.linktype.relatedartifact:[],“dc:type:”rdf:resource:{”https:\/\/localhost:9443\/ccm\/oslc\/types\/\u X1GzsPC9EeCek69P-ztT9w\/task“,”rtc\u cm:com.ibm.team.enterprise.promotion.linktype.promotedBuildMaps.promotedBuildMaps.:[],“dc:modified:”2011-10-07T08:51:52.006Z,“rtc\u cm:estimate:”null,“rtc\u cm:comments::::::[],“rtc\u cm:plannedFor:”null,”rtc_cm:com.ibm.team.workitem.linktype.textualReference.textuallyReferenced:[],“rtc_cm:com.ibm.team.connector.ccbridge.common.ver2wi.s:[],“rtc_cm:com.ibm.team.workitem.linktype.workitem.duplicateOf:[],“rtc_cm:foundIn:”null,“冷静:tracksRequirement::[],“冷静:实施要求”:[],”rtc_cm:com.ibm.team.workitem.linktype.resolveswkitem.resolves:[],“rtc_cm:com.ibm.team.scm.svn.linktype.workitem.s:[],“rtc_cm:com.ibm.team.enterprise.promotion.linktype.resultWorkItem.result:[],“rtc_cm:com.ibm.team.workitem.linktype.relatedworkitem.relatedworkitem:[],“rtc_cm:timeSheet:”{“rdf:resource:”https:\/\/localhost:9443\/ccm\/oslc\/workitems\/\u ZadWAPC\/EeC8XKWU4bgPxg\/rtc\u cm:timeSheet“,“rtc\u cm:com.ibm.team.workitem.linktype.blocksworkitem.blocks:[],“rtc\u cm:com.ibm.team.build.linktype.reportedWorkItems.com.ibm.team.build.common.link.reportedAgainstBuilds:[],“rtc\u cm:com.ibm.team.workitem.link.workitem.link.workitem.workitem.workitem.workitem.workitem.”parents:[],“父母子女”:rtc_cm:com.ibm.team.enterprise.promotion.linktype.promotionDefinition.promotionDefinition:“[]”,“rtc_cm:due”:null,“rtc_cm:com.ibm.team.workitem.linktype.schedulePreviouser.succurance:“[]”,“rtc_cm:com.workitems.change”;“calm:relatedRequirement:“[]”,“rtc_cm:timespunt”:null,“rtc_cm:resolved”:null,”rtc\U cm:startDate:null,“dc:title:“Test1”,“rtc\U cm:progressTracking:{”rdf:resource:“https:\/\/localhost:9443\/ccm\/oslc\/workitems\/\u ZadWAPC\u EeC8XKWU4bgPxg\/progressTracking”},“rtc\u cm:com.ibm.team.build.linktype.includedWorkItems.com.ibm.team.build.common.link.includedInBuilds:[],“calm:dedArchitectureElement:[],“C:progressTracking”:“C:priority”rdf:resource:“https:\/\/localhost:9443\/ccm\/oslc\/enumerations\/\u X1GzsPC9EeCek69P-ztT9w\/priority\/priority\/priority.literal.l01”;“rtc\/\/localhost:9443\/ccm\/oslc\/users\/\uHHBOSPC1EECSJBI2ZGPDOG”;“rtc\/com.ibm.team.workitem.linktype.workitem:“duplicates”;“[{“rdf:resource:”testedbcase:“testedcase”],“Testedbcase:”rtc_cm:com.ibm.team.build.linktype.includedPackages.com.ibm.team.build.common.link.includedInPackages:[],“dc:description:”,“calm:BlocksteExecutionRecord:“[],“rtc_cm:com.ibm.team.enterprise.package.linktype.packageBuildResult.packageBuildResult:[],“calm:affectedByDefect:[],“rtc_cm:com.ibm.team.connector.ccbridge.common.act2wi.s:”,”oslc_cm:relatedChangeManagement:[]},{“dc:identifier”:14,“calm:relatedTestCase:[],“calm:relatedTestScript:[],“rtc_cm:com.ibm.team.build.linktype.IncludeDeployments.com.ibm.team.build.common.link.IncludedDeployment:[],“calm:relatedTestPlan:[],“rtc_cm:com.ibm.team.enterprise.deployment.linktype.deployment.”
public class JSONContainer {

    ArrayList<JSONWorkItem> items = new ArrayList<JSONWorkItem>();

    public ArrayList<JSONWorkItem> getItems() {
        return items;
    }

}
public class JSONContainer {

    @SerializedName("oslc_cm:results")
    ArrayList<JSONWorkItem> items = new ArrayList<JSONWorkItem>();

    public ArrayList<JSONWorkItem> getItems() {
        return items;
    }

}