Package com.yahoo.vespaxmlparser
Class VespaXMLFeedReader
java.lang.Object
com.yahoo.vespaxmlparser.VespaXMLReader
com.yahoo.vespaxmlparser.VespaXMLFeedReader
- All Implemented Interfaces:
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 Summary
ConstructorDescriptionVespaXMLFeedReader
(InputStream stream, DocumentTypeManager docTypeManager) Creates a reader that reads from the given stream.VespaXMLFeedReader
(String fileName, DocumentTypeManager docTypeManager) Creates a reader that reads from the given file. -
Method Summary
Methods inherited from class com.yahoo.vespaxmlparser.VespaXMLReader
isBase64EncodedElement, isBase64EncodingAttribute, newDeserializeException, newException, skipToEnd
-
Constructor Details
-
Method Details
-
readAll
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
Description copied from interface:FeedReader
Reads the next operation from the stream.- Specified by:
read
in interfaceFeedReader
- Returns:
- operation, possibly invalid if none was found.
- Throws:
Exception
-