在通过javax.xml将响应解析为Mapping类之前,我需要检查对象,

在通过javax.xml将响应解析为Mapping类之前,我需要检查对象,,java,xml-parsing,objectmapper,Java,Xml Parsing,Objectmapper,有时我会将planName设置为('NewYork','China'),然后,我不想解析那个值,而不是那个些我想在数据库中保留空字符串的值。下面是我的解析类: import javax.xml.bind.annotation.XmlElement; public class Plan{ @XmlElement(name = "branch", required = true) protected String branch; @XmlElement(name = "

有时我会将planName设置为('NewYork','China'),然后,我不想解析那个值,而不是那个些我想在数据库中保留空字符串的值。下面是我的解析类:

import javax.xml.bind.annotation.XmlElement;

public class Plan{

    @XmlElement(name = "branch", required = true)
    protected String branch;

    @XmlElement(name = "planName",required = true)
    protected String planName;

    @XmlElement(name = "subPlan", required = true)
    protected String subPlan;

     //Getters and Setters..
 }
我尝试过,在解析之后,我可以通过字符串比较来检查字段值。但我在许多领域都面临着上述问题。所以我需要在解析每个字段之前检查它