de.aitools.aq.textextraction
Class TextExtractorRegistry

java.lang.Object
  extended by de.aitools.aq.textextraction.TextExtractorRegistry

public class TextExtractorRegistry
extends java.lang.Object

A register that provides instances of TextExtractor for supported MediaType's. Implementations of TextExtractor can register for the MIME type they support. The register can have only one associated converter per MIME type.

Version:
$Id: TextExtractorRegistry.java,v 1.2 2011/04/26 10:36:23 trenkman Exp $
Author:
martin.trenkmann@uni-weimar.de

Constructor Summary
TextExtractorRegistry()
           
 
Method Summary
static boolean contains(java.lang.String mimeType)
          Checks if some TextExtractor for the given mimeType has been registered.
static TextExtractor get(java.io.File file)
          Returns an instance of TextExtractor that supports the conversion of the given file.
static TextExtractor get(org.apache.tika.mime.MediaType mimeType)
          Returns an instance of TextExtractor that supports the given mimeType.
static TextExtractor get(java.lang.String mimeType)
          Returns an instance of TextExtractor that supports the given mimeType.
static void register(TextExtractor converter)
          Registers a concrete TextExtractor for the MIME type it supports.
static void unregister(TextExtractor converter)
          Unregisters the instance of TextExtractor.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextExtractorRegistry

public TextExtractorRegistry()
Method Detail

get

public static final TextExtractor get(java.lang.String mimeType)
Returns an instance of TextExtractor that supports the given mimeType.

Parameters:
mimeType - The string of the MIME type to get a converter for
Returns:
A converter that supports the given MIME type, or null if that MIME type is not supported

get

public static final TextExtractor get(org.apache.tika.mime.MediaType mimeType)
Returns an instance of TextExtractor that supports the given mimeType.

Parameters:
mimeType - The MIME type to get a converter for
Returns:
A converter that supports the given MIME type, or null if that MIME type is not supported

get

public static final TextExtractor get(java.io.File file)
Returns an instance of TextExtractor that supports the conversion of the given file. The MIME type of this file is detected automatically with best attempt.

Parameters:
file - A file to get the responsible converter for
Returns:
A converter that supports the given MIME type, or null if that MIME type is not supported

contains

public static final boolean contains(java.lang.String mimeType)
Checks if some TextExtractor for the given mimeType has been registered.

Parameters:
mimeType - The string of the MIME type to check
Returns:
true if an converter exists, false otherwise

register

public static final void register(TextExtractor converter)
Registers a concrete TextExtractor for the MIME type it supports.

Parameters:
converter - The converter instance to register

unregister

public static final void unregister(TextExtractor converter)
Unregisters the instance of TextExtractor.

Parameters:
converter - The converter instance to remove from the register