有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java基于月对对象进行分组,并在对象中使用日期属性

我需要根据月份对对象进行分组。我调用一个服务,该服务返回具有日期属性的对象列表(RegisteredOn在下面的响应中)。现在我需要根据月份对这些对象进行分组

输出应为:

January 2017
object1
object2

Feburary 2017
Object3
Object4

以下是服务响应:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
    <QueryLeadsResponseMessage schemaVersion="1.0" xmlns="http://schemas.discovery.co.za/leads" xmlns:ns0="http://schemas.discovery.co.za/leads/wellness">
        <LeadProfile>
            <LeadReferenceNumber>16997345</LeadReferenceNumber>
            .............
            <RegisteredOn>2017-01-19T14:08:21.000+02:00</RegisteredOn>
            <LeadProduct>
                ----------
            </LeadProduct>
        </LeadProfile>
        <LeadProfile>
            --------
            <RegisteredOn>2017-01-19T14:09:05.000+02:00</RegisteredOn>
            <LeadProduct>
                ---------
            </LeadProduct>
        </LeadProfile>

        <LeadProfile>
            --------
            <RegisteredOn>2017-02-19T14:09:05.000+02:00</RegisteredOn>
            <LeadProduct>
                ---------
            </LeadProduct>
        </LeadProfile>

        <LeadProfile>
            --------
            <RegisteredOn>2017-02-19T14:09:05.000+02:00</RegisteredOn>
            <LeadProduct>
                ---------
            </LeadProduct>
        </LeadProfile>


    </QueryLeadsResponseMessage>
</SOAP-ENV:Body>


共 (0) 个答案