How to optimize JAXB deserialization of list of objects?

Viewed 81

I want to deserialize RSS channel and I have the following class:

    @XmlAccessorType(XmlAccessType.NONE)
    data class Channel(
      @field:XmlElement
      val item: List<Item>
    )

I would like to stop deserializing this class after one element will appear in the item list since that list contains hundreds of items and I need only the first one.

Is there any annotation that I can put on item so JAXB will know that I need only one element?

0 Answers
Related