Interface ContentWorkerSelector<W extends ContentWorker>
- All Known Implementing Classes:
RootElementNameContentWorkerSelector,XPathContentWorkerSelector
public interface ContentWorkerSelector<W extends ContentWorker>
An interface instances that are able to identify content based on the content reader. This is specifically aimed at extractors, transformers, injectors and similar classes.
The notion of supplying some type of worker looks a bit odd here, but really an instance of this type will act as an optional factory. Also, in the context of the calling class, the context and the generics will identify exactly which type is returned by the factory.
- Since:
- 2.1
- Author:
- Derek Hulley
-
Method Summary
Modifier and TypeMethodDescriptiongetWorker(ContentReader reader) Provides an worker appropriate to the given content, if possible.
-
Method Details
-
getWorker
Provides an worker appropriate to the given content, if possible. The reader should only be used if absolutely required. The caller should always request a new reader or check the reader's state.- Parameters:
reader- the content reader, providing the actual stream metadata and even the stream, if required.- Returns:
- Return a worker that can operate on the content, or null if this identifier doesn't support the content.
- Throws:
ContentIOException- if the search fails
-