org.brains2b.coffee.file
Class FileContentHandler

java.lang.Object
  extended by org.brains2b.coffee.file.FileContentHandler
All Implemented Interfaces:
ProgressMonitor, org.xml.sax.ContentHandler
Direct Known Subclasses:
ArticleHandler, CoffeeMenuHandler, FilterHandler, GroupListHandler, NewsGroupHandler, NzbDocument, QueryHandler

public abstract class FileContentHandler
extends java.lang.Object
implements org.xml.sax.ContentHandler, ProgressMonitor

Abstract ContentHandler for reading XML-files from file system

Also handles calls to ProgressMonitor

Version:
$Revision: 1.6 $ $Date: 2009/10/05 02:17:18 $
Author:
dennis@brains2b.nl

Constructor Summary
FileContentHandler()
           
 
Method Summary
 void addProgressMonitor(ProgressMonitor monitor)
           
 void advance(int start, int value, int end)
           
 void endPrefixMapping(java.lang.String prefix)
           
 java.lang.String getDefaultDir()
          get the default directory for this kind of content
abstract  NNTPMessage getMessage()
          get the NNTPMessage as it was parsed from the specific ContentHandler
 void ignorableWhitespace(char[] ch, int start, int length)
           
 void processingInstruction(java.lang.String target, java.lang.String data)
           
 void removeProgressMonitor(ProgressMonitor monitor)
           
protected  void setDefaultDir(java.lang.String defaultDir)
          set the default directory for this kind of content
 void setDocumentLocator(org.xml.sax.Locator locator)
           
 void skippedEntity(java.lang.String name)
           
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.ContentHandler
characters, endDocument, endElement, startDocument, startElement
 

Constructor Detail

FileContentHandler

public FileContentHandler()
Method Detail

getMessage

public abstract NNTPMessage getMessage()
get the NNTPMessage as it was parsed from the specific ContentHandler

Returns:
NNTPMessage

getDefaultDir

public java.lang.String getDefaultDir()
get the default directory for this kind of content

The directory given here is relative to the save path of the CoffeeBreak instance

Returns:
String, directory name
See Also:
FileConnector.getPath()

setDefaultDir

protected void setDefaultDir(java.lang.String defaultDir)
set the default directory for this kind of content

The directory given here is relative to the save path of the CoffeeBreak instance

Parameters:
defaultDir - String, directory name
See Also:
FileConnector.getPath()

addProgressMonitor

public void addProgressMonitor(ProgressMonitor monitor)

advance

public void advance(int start,
                    int value,
                    int end)
Specified by:
advance in interface ProgressMonitor

removeProgressMonitor

public void removeProgressMonitor(ProgressMonitor monitor)

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException
Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws org.xml.sax.SAXException
Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler

skippedEntity

public void skippedEntity(java.lang.String name)
                   throws org.xml.sax.SAXException
Specified by:
skippedEntity in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException