org.apache.jackrabbit.core.query.lucene
Class TextFilterExtractor

java.lang.Object
  extended by org.apache.jackrabbit.core.query.lucene.TextFilterExtractor
All Implemented Interfaces:
TextExtractor

public class TextFilterExtractor
extends Object
implements TextExtractor

Adapter class for achieving backwards compatibility with classes implementing the deprectated TextFilter interface. This class implements the TextExtractor interface through calls to an underlying TextFilter instance.


Constructor Summary
TextFilterExtractor(String[] types, TextFilter filter)
          Creates a text extractor adapter that supports the given content types using the given text filter.
TextFilterExtractor(String type, TextFilter filter)
          Creates a text extractor adapter that supports the given content type using the given text filter.
 
Method Summary
 Reader extractText(InputStream stream, String type, String encoding)
          Extracts the text content of the given binary stream by calling the underlying TextFilter instance.
 String[] getContentTypes()
          Returns the supported content types.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextFilterExtractor

public TextFilterExtractor(String[] types,
                           TextFilter filter)
Creates a text extractor adapter that supports the given content types using the given text filter.

Parameters:
types - supported content types
filter - text filter to be adapted

TextFilterExtractor

public TextFilterExtractor(String type,
                           TextFilter filter)
Creates a text extractor adapter that supports the given content type using the given text filter.

Parameters:
type - supported content type
filter - text filter to be adapted
Method Detail

getContentTypes

public String[] getContentTypes()
Returns the supported content types.

Specified by:
getContentTypes in interface TextExtractor
Returns:
supported content types

extractText

public Reader extractText(InputStream stream,
                          String type,
                          String encoding)
                   throws IOException
Extracts the text content of the given binary stream by calling the underlying TextFilter instance. A dummy PropertyState instance is created to comply with the TextFilter.doFilter(PropertyState, String) method signature.

Specified by:
extractText in interface TextExtractor
Parameters:
stream - binary stream
type - content type
encoding - character encoding, or null
Returns:
reader reader for the extracted text content
Throws:
IOException - if the adapted call fails


Copyright © 2004-2007 The Apache Software Foundation. All Rights Reserved.