org.alfresco.repo.content.selector
Interface ContentWorkerSelector

All Known Implementing Classes:
RootElementNameContentWorkerSelector, XPathContentWorkerSelector

public interface ContentWorkerSelector

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

Method Summary
 ContentWorker getWorker(org.alfresco.service.cmr.repository.ContentReader reader)
          Provides an worker appropriate to the given content, if possible.
 

Method Detail

getWorker

ContentWorker getWorker(org.alfresco.service.cmr.repository.ContentReader reader)
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:
org.alfresco.service.cmr.repository.ContentIOException - if the search fails


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.