TextDocumentFactory Class
- public class TextDocumentFactory
extends DefaultDocumentHandler
-
Hierarchy
-
Object
DefaultDocumentHandler
TextDocumentFactory
-
All Implemented Interfaces
-
IDocumentHandler
-
Direct Known Subclasses
-
XmlDocumentFactory
protected IDocument |
-
createDocumentObject (URI uriFile)
- This method must be implemented by derived classes to create the actual IDocument interface
that this handler provides.
|
public int |
-
resolveUnknownPriority (IDocumentHandler.IHandlerContext hc)
- Declares that documents created by this factor have reasonable faith
that they can correctly understand .txt files, but only if the file
doesn't contain telltale binary characters (in the first 1K).
|
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextDocumentFactory
public TextDocumentFactory()
- Creates a document factory capable of handling .txt documents.
TextDocumentFactory
protected TextDocumentFactory(String
ext)
- Creates a document factory capable of handling documents with the specified extension.
createDocumentObject(URI) Method
protected IDocument
createDocumentObject(URI
uriFile)
throws IOException
Description copied from DefaultDocumentHandler.createDocumentObject(URI)
This method must be implemented by derived classes to create the actual IDocument interface
that this handler provides. It is expected that uriFile exists.
-
Overrides
-
DefaultDocumentHandler.createDocumentObject(URI)
Parameters
-
uriFile
- Name of the existing file to create the IDocument interface for
Returns
- An object implementing the IDocument interface that represents the contents of the
given file
Exceptions
-
IOException
Related Topics
DefaultDocumentHandler.createDocumentObject(URI)
resolveUnknownPriority(IDocumentHandler.IHandlerContext) Method
public int resolveUnknownPriority(IDocumentHandler.IHandlerContext
hc)
Declares that documents created by this factor have reasonable faith
that they can correctly understand .txt files, but only if the file
doesn't contain telltale binary characters (in the first 1K).
-
Overrides
-
DefaultDocumentHandler.resolveUnknownPriority(IDocumentHandler.IHandlerContext)
Parameters
-
hc
- Handler context containing relevant information about the file.
Returns
- Priority value indicating the degree to which this handler understands the file.