Class VespaXMLFeedReader

java.lang.Object
com.yahoo.vespaxmlparser.VespaXMLReader
com.yahoo.vespaxmlparser.VespaXMLFeedReader
All Implemented Interfaces:
FeedReader

public class VespaXMLFeedReader extends VespaXMLReader implements FeedReader
XML parser for Vespa document XML. Parses an entire document "feed", which consists of a vespafeed element containing zero or more instances of documents, updates or removes. Standard usage is to create an Operation object and call read(Operation) until operation.getType() returns OperationType.INVALID. If you are looking to parse only a single document or update, use VespaXMLDocumentReader or VespaXMLUpdateReader respectively.
  • Constructor Details

  • Method Details

    • readAll

      public List<FeedOperation> readAll() throws Exception

      Reads all operations from the XML stream and puts into a list. Note that if the XML stream is large, this may cause out of memory errors, so make sure to use this only with small streams.

      Returns:
      The list of all read operations.
      Throws:
      Exception
    • read

      public FeedOperation read() throws Exception
      Description copied from interface: FeedReader
      Reads the next operation from the stream.
      Specified by:
      read in interface FeedReader
      Returns:
      operation, possibly invalid if none was found.
      Throws:
      Exception