Package lumis.util.parse
Class BaseFileParser
- java.lang.Object
-
- lumis.util.parse.BaseFileParser
-
- All Implemented Interfaces:
IFileParser
- Direct Known Subclasses:
HtmlParser
,TxtParser
public abstract class BaseFileParser extends java.lang.Object implements IFileParser
Base implementation ofIFileParser
.- Since:
- 4.0.10
- Version:
- $Revision: 10124 $ $Date: 2009-02-06 18:20:18 -0200 (Fri, 06 Feb 2009) $
-
-
Constructor Summary
Constructors Constructor Description BaseFileParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.String
extract(java.io.File inputFile)
java.lang.String
extract(java.io.File inputFile, java.nio.charset.Charset charset)
java.lang.String
extract(java.io.InputStream inputStream)
Extract text from an input stream.abstract java.lang.String
extract(java.io.InputStream inputStream, java.nio.charset.Charset charset)
protected boolean
inferCharset()
-
-
-
Method Detail
-
extract
public abstract java.lang.String extract(java.io.InputStream inputStream, java.nio.charset.Charset charset) throws ParseException
- Specified by:
extract
in interfaceIFileParser
- Throws:
ParseException
-
extract
public java.lang.String extract(java.io.File inputFile, java.nio.charset.Charset charset) throws ParseException, java.io.FileNotFoundException
- Specified by:
extract
in interfaceIFileParser
- Throws:
ParseException
java.io.FileNotFoundException
-
inferCharset
protected boolean inferCharset()
-
extract
public java.lang.String extract(java.io.File inputFile) throws ParseException
- Specified by:
extract
in interfaceIFileParser
- Throws:
ParseException
-
extract
public java.lang.String extract(java.io.InputStream inputStream) throws ParseException, java.io.IOException
Description copied from interface:IFileParser
Extract text from an input stream.- Specified by:
extract
in interfaceIFileParser
- Parameters:
inputStream
- the input stream.- Returns:
- the text extracted.
- Throws:
ParseException
- if an error occurred while parsing stream content.java.io.IOException
- if an I/O error occurred.
-
-