Package org.daisy.braille.facade
Class PEFConverterFacade
java.lang.Object
org.daisy.braille.facade.PEFConverterFacade
Provides a facade for both PEFHandler and TextHandler
- Author:
- Joel HÃ¥kansson
-
Field Summary
Modifier and TypeFieldDescriptionstatic final SimpleDateFormat
static final String
Key for parsePefFile setting, corresponding settings value should match a value inPEFHandler.Alignment
static final String
Key for parsePefFile setting, corresponding settings value should be the number of characters to offset alignment bystatic final String
Key for parseTextFile setting, corresponding settings value should contain the author of the publicationstatic final String
Key for parsePefFile setting, corresponding settings value should match a value in StandardLineBreaks.Typestatic final String
Key for parsePefFile setting, corresponding settings value should be a number, in millimetersstatic final String
Key for parsePefFile setting, corresponding settings value should be a number, in millimetersstatic final String
Key for parseTextFile setting, corresponding settings value should be a string containing a valid date on the form yyyy-MM-ddstatic final String
Key for parseTextFile setting, corresponding settings value should be "true" for duplex or "false" for simplexstatic final String
Key for parsePefFile setting, corresponding settings value should match an embosser identifierstatic final String
Key for parsePefFile setting, corresponding settings value should match a value inEmbosserBrailleConverter.EightDotFallbackMethod
static final String
Key for parseTextFile setting, corresponding settings value should contain the identifier for the publicationstatic final String
Key for parseTextFile setting, corresponding settings value should contain the language of the publicationstatic final String
Key for parseTextFile setting, corresponding settings value should match the table to usestatic final String
Key for parsePefFile setting, corresponding settings value should match a padding stylestatic final String
Key for parsePefFile setting, corresponding settings value should match a rangestatic final String
Key for parsePefFile setting, corresponding settings value should be a character in the range 0x2800-0x283Fstatic final String
Key for parsePefFile setting, corresponding settings value should match a table identifierstatic final String
Key for parseTextFile setting, corresponding settings value should contain the title of the publication -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
parsePefFile
(File input, OutputStream os, PageFormat pf, Map<String, String> settings) Parses the given PEF-file input using the supplied output stream and settings.static void
parsePefFile
(File input, PEFHandler ph) Parses the given input using the supplied PEFHandler.static void
parsePefFile
(InputStream is, PEFHandler ph) Parses the given input stream using the supplied PEFHandler.static void
Parses a text file and outputs a PEF-file based on the contents of the file
-
Field Details
-
DATE_FORMAT
-
KEY_EMBOSSER
Key for parsePefFile setting, corresponding settings value should match an embosser identifier- See Also:
-
KEY_TABLE
Key for parsePefFile setting, corresponding settings value should match a table identifier- See Also:
-
KEY_BREAKS
Key for parsePefFile setting, corresponding settings value should match a value in StandardLineBreaks.Type- See Also:
-
KEY_RANGE
Key for parsePefFile setting, corresponding settings value should match a range- See Also:
-
KEY_FALLBACK
Key for parsePefFile setting, corresponding settings value should match a value inEmbosserBrailleConverter.EightDotFallbackMethod
- See Also:
-
KEY_REPLACEMENT
Key for parsePefFile setting, corresponding settings value should be a character in the range 0x2800-0x283F- See Also:
-
KEY_PADDING
Key for parsePefFile setting, corresponding settings value should match a padding style- See Also:
-
KEY_ALIGNMENT_OFFSET
Key for parsePefFile setting, corresponding settings value should be the number of characters to offset alignment by- See Also:
-
KEY_ALIGN
Key for parsePefFile setting, corresponding settings value should match a value inPEFHandler.Alignment
- See Also:
-
KEY_CELL_WIDTH
Key for parsePefFile setting, corresponding settings value should be a number, in millimeters- See Also:
-
KEY_CELL_HEIGHT
Key for parsePefFile setting, corresponding settings value should be a number, in millimeters- See Also:
-
KEY_TITLE
Key for parseTextFile setting, corresponding settings value should contain the title of the publication- See Also:
-
KEY_AUTHOR
Key for parseTextFile setting, corresponding settings value should contain the author of the publication- See Also:
-
KEY_IDENTIFIER
Key for parseTextFile setting, corresponding settings value should contain the identifier for the publication- See Also:
-
KEY_MODE
Key for parseTextFile setting, corresponding settings value should match the table to use- See Also:
-
KEY_LANGUAGE
Key for parseTextFile setting, corresponding settings value should contain the language of the publication- See Also:
-
KEY_DUPLEX
Key for parseTextFile setting, corresponding settings value should be "true" for duplex or "false" for simplex- See Also:
-
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:
-
-
Constructor Details
-
PEFConverterFacade
public PEFConverterFacade()
-
-
Method Details
-
parsePefFile
public static void parsePefFile(File input, OutputStream os, PageFormat pf, Map<String, String> settings) throws NumberFormatException, ParserConfigurationException, SAXException, IOException, EmbosserFactoryException, UnsupportedWidthExceptionParses the given PEF-file input using the supplied output stream and settings.- Parameters:
input
-os
-settings
-- Throws:
NumberFormatException
ParserConfigurationException
SAXException
IOException
EmbosserFactoryException
UnsupportedWidthException
-
parsePefFile
public static void parsePefFile(File input, PEFHandler ph) throws ParserConfigurationException, SAXException, IOException, UnsupportedWidthException Parses the given input using the supplied PEFHandler.- Parameters:
input
- the input PEF fileph
- the PEFHandler to use- Throws:
ParserConfigurationException
SAXException
IOException
UnsupportedWidthException
-
parsePefFile
public static void parsePefFile(InputStream is, PEFHandler ph) throws ParserConfigurationException, SAXException, IOException, UnsupportedWidthException Parses the given input stream using the supplied PEFHandler.- Parameters:
is
- the input streamph
- the PEFHandler- Throws:
ParserConfigurationException
SAXException
IOException
UnsupportedWidthException
-
parseTextFile
public static void parseTextFile(File input, File output, Map<String, String> settings) throws IOExceptionParses a text file and outputs a PEF-file based on the contents of the file- Parameters:
input
- input text fileoutput
- output PEF-filesettings
- settings- Throws:
IOException
- if IO fails
-