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