public class MultiInfoItemsCollector extends InfoItemsCollector<InfoItem,InfoItemExtractor>
This collector can handle the following extractor types:
Callingextract(InfoItemExtractor)
or InfoItemsCollector.commit(InfoItemExtractor)
with any
other extractor type will raise an exception.Constructor and Description |
---|
MultiInfoItemsCollector(int serviceId) |
Modifier and Type | Method and Description |
---|---|
InfoItem |
extract(InfoItemExtractor extractor)
Try to extract the item from an extractor without adding it to the collection
|
List<Throwable> |
getErrors()
Get all errors
|
void |
reset()
Reset all collected items and errors
|
addError, addItem, commit, getItems, getServiceId
public List<Throwable> getErrors()
Collector
getErrors
in interface Collector<InfoItem,InfoItemExtractor>
getErrors
in class InfoItemsCollector<InfoItem,InfoItemExtractor>
public void reset()
Collector
reset
in interface Collector<InfoItem,InfoItemExtractor>
reset
in class InfoItemsCollector<InfoItem,InfoItemExtractor>
public InfoItem extract(InfoItemExtractor extractor) throws ParsingException
Collector
extractor
- the extractor to useParsingException
- thrown if there is an error extracting the
required fields of the item.