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 class
TextHandler.Builder
Provides a Builder for TextHandler.
-
Field Summary
Fields Modifier and Type Field Description static SimpleDateFormat
DATE_FORMAT
Defines a date format (yyyy-MM-dd).static String
KEY_AUTHOR
Key for parseTextFile setting, corresponding settings value should contain the author of the publication.static String
KEY_DATE
Key for parseTextFile setting, corresponding settings value should be a string containing a valid date on the form yyyy-MM-dd.static String
KEY_DUPLEX
Key for parseTextFile setting, corresponding settings value should be "true" for duplex or "false" for simplex.static String
KEY_IDENTIFIER
Key for parseTextFile setting, corresponding settings value should contain the identifier for the publication.static String
KEY_LANGUAGE
Key for parseTextFile setting, corresponding settings value should contain the language of the publication.static String
KEY_MODE
Key for parseTextFile setting, corresponding settings value should match the table to use.static String
KEY_TITLE
Key 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 void
parse()
Parse using current settings.static TextHandler.Builder
with(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 IOException
Parse using current settings.- Throws:
IOException
- if an I/O error occurs
-
-