带有jenkins提要对象的java jaxb解组

带有jenkins提要对象的java jaxb解组,java,jaxb,Java,Jaxb,我的代码运行,但我的提要对象不包含任何值 我的XML: <feed xmlns="http://www.w3.org/2005/Atom"> <title>All last builds only</title> <updated>2019-03-11T11:32:16Z</updated> <author> <name>Jenkins Server</name>

我的代码运行,但我的
提要
对象不包含任何值

我的XML:

<feed xmlns="http://www.w3.org/2005/Atom">
    <title>All last builds only</title>
    <updated>2019-03-11T11:32:16Z</updated>
    <author>
        <name>Jenkins Server</name>
    </author>
    <id>urn:uuid:903deee0-7bfa-11db-9fe1-0800200c9a88</id>
    <entry>
        <title>integration-tests #12 (14 less tests are failing (total 4))</title>
        <link rel="alternate" type="text/html" href="http://localhost/jenkins/job/integration-tests/12/" />
        <id>tag:hudson.dev.java.net,2008:http://localhost/jenkins/job/integration-tests/</id>
        <published>2019-03-11T11:32:16Z</published>
        <updated>2019-03-11T11:32:16Z</updated>
    </entry>
    <entry>
        <title>NetworkTest #2 (back to normal)</title>
        <link rel="alternate" type="text/html" href="http://localhost/jenkins/job/NetworkTest/2/" />
        <id>tag:hudson.dev.java.net,2008:http://localhost/jenkins/job/NetworkTest/</id>
        <published>2019-03-11T08:09:59Z</published>
        <updated>2019-03-11T08:09:59Z</updated>
    </entry>
    <entry>
        <title>Release ng-back #3 - ng-back - Release 1.0.0 (stable)</title>
        <link rel="alternate" type="text/html" href="http://localhost/jenkins/job/Release%20ng-back/3/" />
        <id>tag:hudson.dev.java.net,2008:http://localhost/jenkins/job/Release%20ng-back/</id>
        <published>2019-02-06T17:39:54Z</published>
        <updated>2019-02-06T17:39:54Z</updated>
    </entry>
    <entry>
        <title>Release ng-front #1 - Release 1.0.0 (stable)</title>
        <link rel="alternate" type="text/html" href="http://localhost/jenkins/job/Release%20ng-front/1/" />
        <id>tag:hudson.dev.java.net,2008:http://localhost/jenkins/job/Release%20ng-front/</id>
        <published>2019-02-08T10:43:59Z</published>
        <updated>2019-02-08T10:43:59Z</updated>
    </entry>
</feed>
饲料Pojo:

@XmlRootElement(namespace="http://www.w3.org/2005/Atom")
public class Feed {
    private String title;
    Link LinkObject;
    private String updated;
    Author AuthorObject;
    private String id;
    ArrayList<Object> entry = new ArrayList<>();
    private String _xmlns;

    // Getter Methods

    public String getTitle() {
        return title;
    }

    public Link getLink() {
        return LinkObject;
    }

    public String getUpdated() {
        return updated;
    }

    public Author getAuthor() {
        return AuthorObject;
    }

    public String getId() {
        return id;
    }

    public String get_xmlns() {
        return _xmlns;
    }

    // Setter Methods

    public void setTitle(String title) {
        this.title = title;
    }

    public void setLink(Link linkObject) {
        this.LinkObject = linkObject;
    }

    public void setUpdated(String updated) {
        this.updated = updated;
    }

    public void setAuthor(Author authorObject) {
        this.AuthorObject = authorObject;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void set_xmlns(String _xmlns) {
        this._xmlns = _xmlns;
    }
}

我认为需要更多的JAXB注释。 你能试试这个吗

@XmlRootElement(name = "feed", namespace="http://www.w3.org/2005/Atom")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "title",
    "updated",
    "author",
    "id",
    "entry"
})
public class Feed {

    @XmlElement(name = "title")
    private String title;

    Link LinkObject;

    @XmlElement(name = "updated")
    private String updated;

    @XmlElement(name = "author")
    Author AuthorObject;

    @XmlElement(name = "id")
    private String id;

    @XmlElement(name = "entry")
    ArrayList<Object> entry = new ArrayList<>();

    private String _xmlns;

    // Getter Methods
}
@XmlRootElement(name=“feed”,命名空间=”http://www.w3.org/2005/Atom")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name=),比例={
“头衔”,
“更新”,
“作者”,
“身份证”,
“条目”
})
公共类提要{
@xmlement(name=“title”)
私有字符串标题;
链接对象;
@xmlement(name=“updated”)
私有字符串更新;
@xmlement(name=“author”)
作者对象;
@xmlement(name=“id”)
私有字符串id;
@xmlement(name=“entry”)
ArrayList条目=新建ArrayList();
私有字符串_xmlns;
//吸气剂法
}
文档:


我认为需要更多的JAXB注释。 你能试试这个吗

@XmlRootElement(name = "feed", namespace="http://www.w3.org/2005/Atom")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "title",
    "updated",
    "author",
    "id",
    "entry"
})
public class Feed {

    @XmlElement(name = "title")
    private String title;

    Link LinkObject;

    @XmlElement(name = "updated")
    private String updated;

    @XmlElement(name = "author")
    Author AuthorObject;

    @XmlElement(name = "id")
    private String id;

    @XmlElement(name = "entry")
    ArrayList<Object> entry = new ArrayList<>();

    private String _xmlns;

    // Getter Methods
}
@XmlRootElement(name=“feed”,命名空间=”http://www.w3.org/2005/Atom")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name=),比例={
“头衔”,
“更新”,
“作者”,
“身份证”,
“条目”
})
公共类提要{
@xmlement(name=“title”)
私有字符串标题;
链接对象;
@xmlement(name=“updated”)
私有字符串更新;
@xmlement(name=“author”)
作者对象;
@xmlement(name=“id”)
私有字符串id;
@xmlement(name=“entry”)
ArrayList条目=新建ArrayList();
私有字符串_xmlns;
//吸气剂法
}
文档:


抱歉不再工作(我添加了@on Autor和Link类)控制台中是否有异常?抱歉不再工作(我添加@on Autor和Link类)控制台中是否有异常?
@XmlRootElement(name = "feed", namespace="http://www.w3.org/2005/Atom")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "title",
    "updated",
    "author",
    "id",
    "entry"
})
public class Feed {

    @XmlElement(name = "title")
    private String title;

    Link LinkObject;

    @XmlElement(name = "updated")
    private String updated;

    @XmlElement(name = "author")
    Author AuthorObject;

    @XmlElement(name = "id")
    private String id;

    @XmlElement(name = "entry")
    ArrayList<Object> entry = new ArrayList<>();

    private String _xmlns;

    // Getter Methods
}