Package org.daisy.braille.utils.pef
Class TextHandler
- java.lang.Object
-
- org.daisy.braille.utils.pef.TextHandler
-
public class TextHandler extends Object
Provides a handler for reading text and writing a PEF-file.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTextHandler.BuilderProvides a Builder for TextHandler
-
Field Summary
Fields Modifier and Type Field Description static SimpleDateFormatDATE_FORMATDefines a date format (yyyy-MM-dd).static StringKEY_AUTHORKey for parseTextFile setting, corresponding settings value should contain the author of the publicationstatic StringKEY_DATEKey for parseTextFile setting, corresponding settings value should be a string containing a valid date on the form yyyy-MM-ddstatic StringKEY_DUPLEXKey for parseTextFile setting, corresponding settings value should be "true" for duplex or "false" for simplexstatic StringKEY_IDENTIFIERKey for parseTextFile setting, corresponding settings value should contain the identifier for the publicationstatic StringKEY_LANGUAGEKey for parseTextFile setting, corresponding settings value should contain the language of the publicationstatic StringKEY_MODEKey for parseTextFile setting, corresponding settings value should match the table to usestatic StringKEY_TITLEKey for parseTextFile setting, corresponding settings value should contain the title of the publication
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidparse()Parse using current settingsstatic TextHandler.Builderwith(File input, File output, TableCatalogService factory)Creates a new builder with the supplied parameters.
-
-
-
Field Detail
-
DATE_FORMAT
public static final SimpleDateFormat DATE_FORMAT
Defines a date format (yyyy-MM-dd).
-
KEY_TITLE
public static final String KEY_TITLE
Key for parseTextFile setting, corresponding settings value should contain the title of the publication- See Also:
- Constant Field Values
-
KEY_AUTHOR
public static final String KEY_AUTHOR
Key for parseTextFile setting, corresponding settings value should contain the author of the publication- See Also:
- Constant Field Values
-
KEY_IDENTIFIER
public static final String KEY_IDENTIFIER
Key for parseTextFile setting, corresponding settings value should contain the identifier for the publication- See Also:
- Constant Field Values
-
KEY_MODE
public static final String KEY_MODE
Key for parseTextFile setting, corresponding settings value should match the table to use- See Also:
- Constant Field Values
-
KEY_LANGUAGE
public static final String KEY_LANGUAGE
Key for parseTextFile setting, corresponding settings value should contain the language of the publication- See Also:
- Constant Field Values
-
KEY_DUPLEX
public static final String KEY_DUPLEX
Key for parseTextFile setting, corresponding settings value should be "true" for duplex or "false" for simplex- See Also:
- Constant Field Values
-
KEY_DATE
public static final String KEY_DATE
Key for parseTextFile setting, corresponding settings value should be a string containing a valid date on the form yyyy-MM-dd- See Also:
- Constant Field Values
-
-
Method Detail
-
with
public static TextHandler.Builder with(File input, File output, TableCatalogService factory)
Creates a new builder with the supplied parameters.- Parameters:
input- the input fileoutput- the output filefactory- the table catalog- Returns:
- returns a new builder
-
parse
public void parse() throws IOExceptionParse using current settings- Throws:
IOException- if an I/O error occurs
-
-