net.sourceforge.sconman.handlers
Class NullHandler

java.lang.Object
  extended by net.sourceforge.sconman.handlers.NullHandler
All Implemented Interfaces:
IContentTypeHandler
Direct Known Subclasses:
ImageHandler, MailHandler, MSOfficeHandler, PDFHandler, TaggedTextHandler, TextHandler

public class NullHandler
extends java.lang.Object
implements IContentTypeHandler

The simplest implementation: just do nothing, as the incoming input stream already is an indexable text stream.

Author:
mikeshadow

Constructor Summary
NullHandler()
          Constructor for NullHandler.
 
Method Summary
protected  java.lang.String getFieldsAsString(Content content)
           
 void getInfo(Content content, boolean overrideAttributes, boolean createThumbnail)
          Tries to read info from content's data
 java.io.Reader getTextReader(Content content)
          Implement this method to return a reader that provides the text associated to the content
 boolean hasThumbnail()
          Return true if the content has thumbnail
 void writeAttributes(Content content)
          Tries to write attributes to content's data
 void writeText(java.io.InputStream is, java.io.Writer out)
          Writes all the text associated to the incoming input stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullHandler

public NullHandler()
Constructor for NullHandler.

Method Detail

getFieldsAsString

protected java.lang.String getFieldsAsString(Content content)

getTextReader

public java.io.Reader getTextReader(Content content)
                             throws java.io.IOException
Description copied from interface: IContentTypeHandler
Implement this method to return a reader that provides the text associated to the content

Specified by:
getTextReader in interface IContentTypeHandler
Parameters:
content - The content
Returns:
A filtered input stream
Throws:
java.io.IOException - If there's an IO problem

writeText

public void writeText(java.io.InputStream is,
                      java.io.Writer out)
               throws java.io.IOException
Description copied from interface: IContentTypeHandler
Writes all the text associated to the incoming input stream

Specified by:
writeText in interface IContentTypeHandler
Throws:
java.io.IOException

hasThumbnail

public boolean hasThumbnail()
Description copied from interface: IContentTypeHandler
Return true if the content has thumbnail

Specified by:
hasThumbnail in interface IContentTypeHandler
Returns:
true if the content has thumbnail

writeAttributes

public void writeAttributes(Content content)
Description copied from interface: IContentTypeHandler
Tries to write attributes to content's data

Specified by:
writeAttributes in interface IContentTypeHandler

getInfo

public void getInfo(Content content,
                    boolean overrideAttributes,
                    boolean createThumbnail)
Description copied from interface: IContentTypeHandler
Tries to read info from content's data

Specified by:
getInfo in interface IContentTypeHandler
Parameters:
content - The content to read attributes from
overrideAttributes - True to extract attributes from file and override existent content attributes
createThumbnail - True to create thumbnail


Copyright null null. All Rights Reserved.